[BACK]Return to rcs.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / cvs

Diff for /src/usr.bin/cvs/rcs.c between version 1.14 and 1.15

version 1.14, 2004/12/06 21:03:12 version 1.15, 2004/12/07 17:10:56
Line 1 
Line 1 
 /*      $OpenBSD$       */  /*      $OpenBSD$       */
 /*  /*
  * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>   * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
  * All rights reserved.   * All rights reserved.
  *   *
  * Redistribution and use in source and binary forms, with or without   * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions   * modification, are permitted provided that the following conditions
  * are met:   * are met:
  *   *
  * 1. Redistributions of source code must retain the above copyright   * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.   *    notice, this list of conditions and the following disclaimer.
  * 2. The name of the author may not be used to endorse or promote products   * 2. The name of the author may not be used to endorse or promote products
  *    derived from this software without specific prior written permission.   *    derived from this software without specific prior written permission.
  *   *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY   * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
Line 21 
Line 21 
  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,   * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR   * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF   * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */   */
   
 #include <sys/param.h>  #include <sys/param.h>
Line 74 
Line 74 
 #define RCS_VOPT     0x02   /* value is optional */  #define RCS_VOPT     0x02   /* value is optional */
   
   
   
 /* opaque parse data */  /* opaque parse data */
 struct rcs_pdata {  struct rcs_pdata {
         u_int  rp_line;          u_int  rp_line;
Line 162 
Line 161 
  * first operation that requires information from the file.   * first operation that requires information from the file.
  * Returns a handle to the opened file on success, or NULL on failure.   * Returns a handle to the opened file on success, or NULL on failure.
  */   */
   
 RCSFILE*  RCSFILE*
 rcs_open(const char *path, u_int mode)  rcs_open(const char *path, u_int mode)
 {  {
Line 225 
Line 223 
  *   *
  * Close an RCS file handle.   * Close an RCS file handle.
  */   */
   
 void  void
 rcs_close(RCSFILE *rfp)  rcs_close(RCSFILE *rfp)
 {  {
Line 283 
Line 280 
  * path is in <rf_path>.   * path is in <rf_path>.
  * Returns 0 on success, or -1 on failure.   * Returns 0 on success, or -1 on failure.
  */   */
   
 int  int
 rcs_write(RCSFILE *rfp)  rcs_write(RCSFILE *rfp)
 {  {
Line 377 
Line 373 
  * is named <sym> and is bound to the RCS revision <snum>.   * is named <sym> and is bound to the RCS revision <snum>.
  * Returns 0 on success, or -1 on failure.   * Returns 0 on success, or -1 on failure.
  */   */
   
 int  int
 rcs_addsym(RCSFILE *rfp, const char *sym, RCSNUM *snum)  rcs_addsym(RCSFILE *rfp, const char *sym, RCSNUM *snum)
 {  {
Line 947 
Line 942 
                         rcs_freedelta(rdp);                          rcs_freedelta(rdp);
                         return (-1);                          return (-1);
                 } else if (tok == RCS_TOK_NUM || tok == RCS_TOK_DESC) {                  } else if (tok == RCS_TOK_NUM || tok == RCS_TOK_DESC) {
                         rcs_pushtok(rfp, RCS_TOKSTR(rfp), tok);                          rcs_pushtok(rfp, RCS_TOKSTR(rfp), tok);
                         ret = (tok == RCS_TOK_NUM ? 1 : 0);                          ret = (tok == RCS_TOK_NUM ? 1 : 0);
                         break;                          break;
                 }                  }
Line 994 
Line 989 
                                 free(tokstr);                                  free(tokstr);
                         tokstr = strdup(RCS_TOKSTR(rfp));                          tokstr = strdup(RCS_TOKSTR(rfp));
                         if (tokstr == NULL) {                          if (tokstr == NULL) {
                                 cvs_log(LP_ERRNO,                                  cvs_log(LP_ERRNO,
                                     "failed to duplicate rcs token");                                      "failed to duplicate rcs token");
                                 rcs_freedelta(rdp);                                  rcs_freedelta(rdp);
                                 return (-1);                                  return (-1);
Line 1488 
Line 1483 
                 *bp = '\0';                  *bp = '\0';
   
                 for (i = 0; i < sizeof(rcs_keys)/sizeof(rcs_keys[0]); i++) {                  for (i = 0; i < sizeof(rcs_keys)/sizeof(rcs_keys[0]); i++) {
                         if (strcmp(rcs_keys[i].rk_str, pdp->rp_buf) == 0) {                          if (strcmp(rcs_keys[i].rk_str, pdp->rp_buf) == 0) {
                                 type = rcs_keys[i].rk_id;                                  type = rcs_keys[i].rk_id;
                                 break;                                  break;
                         }                          }

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15