home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3620 < prev    next >
Encoding:
Text File  |  1991-07-11  |  39.0 KB  |  1,557 lines

  1. Newsgroups: comp.unix.sysv386,alt.sources
  2. From: eric@egsner.cirr.com (Eric Schnoebelen)
  3. Subject: cvs patches for System V release 3.2 (was: rcs and cvs)
  4. Date: Thu, 11 Jul 91 03:57:14 GMT
  5. Message-ID: <1991Jul11.035714.28526@egsner.cirr.com>
  6.  
  7. Well, here they are.  The patches to allow cvs to build and run under
  8. System V/386 (specifically, ISC 2.0.2).  They are based upon the cvs-1.2
  9. sources available on prep.ai.mit.edu, the Free Software Foundations home
  10. machine.
  11.  
  12. Also needed to build cvs is gdbm, also from the Free Software Foundation.
  13.  
  14. But, before applying the patches, the following commands will need to be
  15. executed in the cvs-1.2 directory.  The reason for this is that Brian
  16. Berliner, being on a BSD based machine, named a number of files with
  17. names longer that fourteen characters.  The following commands rename
  18. the files with too long of names to something less than twelve
  19. characters (so cvs/rcs can handle them).  The commands are:
  20.  
  21. mv man/mkmodules.man    man/mkmod.man
  22. mv src/build_entry.c    src/build_ent.c
  23. mv src/collect_sets.c    src/coll_sets.c
  24. mv src/create_admin.c    src/creat_adm.c
  25. mv src/entries_file.c    src/entr_file.c
  26. mv src/name_repository.c    src/name_repos.c
  27. mv src/no_difference.c    src/no_diff.c
  28. mv src/scratch_entry.c    src/scratch_en.c
  29. mv src/version_number.c    src/vers_num.c
  30.  
  31. The following patches generated with 'cvs patch', except for
  32. src/misc.c and src/regexp.c.
  33.  
  34. Apply with patch -l -p0
  35.  
  36. cvs patch: Examining examples
  37. diff -c Makefile:1.1.1.4 tools/Makefile:1.2
  38. *** Makefile:1.1.1.4    Wed Jul 10 22:00:36 1991
  39. --- Makefile    Wed Jul 10 22:00:36 1991
  40. ***************
  41. *** 1,12 ****
  42.   #
  43. ! #    $Id: Makefile,v 1.1.1.4 91/03/03 21:59:31 eric Exp $
  44.   #
  45.   # Master Makefile for CVS
  46.   #
  47.   
  48.   DESTDIR=    /usr/local/bin
  49.   CFLAGS=        -O # -g
  50. ! LDFLAGS=    # -Bstatic
  51.   SUBDIRS=    doc examples man src
  52.   
  53.   FILES=        README Makefile COPYING
  54. --- 1,13 ----
  55.   #
  56. ! #    $Id: Makefile,v 1.2 91/03/04 02:59:06 eric Exp $
  57.   #
  58.   # Master Makefile for CVS
  59.   #
  60. + SHELL=/bin/sh
  61.   
  62.   DESTDIR=    /usr/local/bin
  63.   CFLAGS=        -O # -g
  64. ! LDFLAGS=    -lbsd # -Bstatic
  65.   SUBDIRS=    doc examples man src
  66.   
  67.   FILES=        README Makefile COPYING
  68. cvs patch: Examining src
  69. diff -c src/Makefile:1.1.1.4 tools/src/Makefile:1.2
  70. *** src/Makefile:1.1.1.4    Wed Jul 10 22:00:53 1991
  71. --- src/Makefile    Wed Jul 10 22:00:53 1991
  72. ***************
  73. *** 1,19 ****
  74.   #
  75. ! #    $Id: Makefile,v 1.1.1.4 91/03/03 22:00:42 eric Exp $
  76.   #
  77.   # Makefile for CVS
  78.   #
  79. ! COMMONSRCS=    subr.c
  80.   COMMONOBJS=    ${COMMONSRCS:.c=.o}
  81.   
  82.   CVS=        cvs
  83.   CVSSRCS=    add.c build_ent.c checkin.c checkout.c coll_sets.c\
  84. !         commit.c create_admin.c diff.c entr_file.c\
  85.           find_names.c join.c locate_rcs.c log.c main.c\
  86.           maketime.c modules.c name_repos.c no_diff.c\
  87.           options.c partime.c patch.c register.c remove.c\
  88.           scratch_en.c set_lock.c status.c tag.c update.c\
  89. !         vers_num.c version_ts.c
  90.   CVSOBJS=    ${CVSSRCS:.c=.o} ${COMMONOBJS}
  91.   
  92.   MOD=        mkmodules
  93. --- 1,21 ----
  94.   #
  95. ! #    $Id: Makefile,v 1.2 91/03/04 03:07:08 eric Exp $
  96.   #
  97.   # Makefile for CVS
  98.   #
  99. ! SHELL=        /bin/sh
  100. ! COMMONSRCS=    subr.c misc.c
  101.   COMMONOBJS=    ${COMMONSRCS:.c=.o}
  102.   
  103.   CVS=        cvs
  104.   CVSSRCS=    add.c build_ent.c checkin.c checkout.c coll_sets.c\
  105. !         commit.c creat_adm.c diff.c entr_file.c\
  106.           find_names.c join.c locate_rcs.c log.c main.c\
  107.           maketime.c modules.c name_repos.c no_diff.c\
  108.           options.c partime.c patch.c register.c remove.c\
  109.           scratch_en.c set_lock.c status.c tag.c update.c\
  110. !         vers_num.c version_ts.c regex.c 
  111.   CVSOBJS=    ${CVSSRCS:.c=.o} ${COMMONOBJS}
  112.   
  113.   MOD=        mkmodules
  114. ***************
  115. *** 31,38 ****
  116.   FILES=        Makefile ${HEADERS} ${ALLSRCS} ${CSHELLS}
  117.   
  118.   PROGS=        ${CVS} ${MOD}
  119. ! CFLAGS=        -O # -g
  120.   LDFLAGS=    # -Bstatic
  121.   
  122.   ETAGS=        /usr/local/bin/etags
  123.   CTAGS=        ctags
  124. --- 33,41 ----
  125.   FILES=        Makefile ${HEADERS} ${ALLSRCS} ${CSHELLS}
  126.   
  127.   PROGS=        ${CVS} ${MOD}
  128. ! CFLAGS=        -O -DS5r3 
  129.   LDFLAGS=    # -Bstatic
  130. + LIBS=        -lndbm -lc_s
  131.   
  132.   ETAGS=        /usr/local/bin/etags
  133.   CTAGS=        ctags
  134. ***************
  135. *** 40,54 ****
  136.   all: ${PROGS}
  137.   
  138.   ${CVS}: ${CVSOBJS}
  139. !     ${CC} -o ${CVS} ${CFLAGS} ${CVSOBJS} ${LDFLAGS}
  140.   
  141.   ${MOD}: ${MODOBJS}
  142. !     ${CC} -o ${MOD} ${CFLAGS} ${MODOBJS} ${LDFLAGS}
  143.   
  144.   install: ${PROGS}
  145. !     install -m 755 ${PROGS} ${DESTDIR}
  146.       for i in ${CSHELLS}; do\
  147. !         install -m 755 $$i ${DESTDIR}/`basename $$i ${CSHEXT}`;\
  148.       done
  149.   
  150.   clean:
  151. --- 43,59 ----
  152.   all: ${PROGS}
  153.   
  154.   ${CVS}: ${CVSOBJS}
  155. !     ${CC} -o ${CVS} ${CFLAGS} ${CVSOBJS} ${LDFLAGS} ${LIBS}
  156.   
  157.   ${MOD}: ${MODOBJS}
  158. !     ${CC} -o ${MOD} ${CFLAGS} ${MODOBJS} ${LDFLAGS} ${LIBS}
  159.   
  160.   install: ${PROGS}
  161. !     for i in ${PROGS} ; do \
  162. !         install -c -m 755 $$i ${DESTDIR} ;\
  163. !     done
  164.       for i in ${CSHELLS}; do\
  165. !         install -c -m 755 $$i ${DESTDIR}/`basename $$i ${CSHEXT}`;\
  166.       done
  167.   
  168.   clean:
  169. diff -c src/add.c:1.1.1.4 tools/src/add.c:1.3
  170. *** src/add.c:1.1.1.4    Wed Jul 10 22:00:55 1991
  171. --- src/add.c    Wed Jul 10 22:00:55 1991
  172. ***************
  173. *** 1,6 ****
  174.   #ifndef lint
  175. ! static char rcsid[] = "$Id: add.c,v 1.1.1.4 91/03/03 22:00:45 eric Exp $";
  176. ! #endif !lint
  177.   
  178.   /*
  179.    *    Copyright (c) 1989, Brian Berliner
  180. --- 1,6 ----
  181.   #ifndef lint
  182. ! static char rcsid[] = "$Id: add.c,v 1.3 91/03/04 11:35:37 eric Exp $";
  183. ! #endif /* !lint */
  184.   
  185.   /*
  186.    *    Copyright (c) 1989, Brian Berliner
  187. diff -c src/build_ent.c:1.1.1.3 tools/src/build_ent.c:1.3
  188. *** src/build_ent.c:1.1.1.3    Wed Jul 10 22:00:56 1991
  189. --- src/build_ent.c    Wed Jul 10 22:00:56 1991
  190. ***************
  191. *** 1,6 ****
  192.   #ifndef lint
  193. ! static char rcsid[] = "$Id: build_ent.c,v 1.1.1.3 91/03/03 22:00:48 eric Exp $";
  194. ! #endif !lint
  195.   
  196.   /*
  197.    *    Copyright (c) 1989, Brian Berliner
  198. --- 1,6 ----
  199.   #ifndef lint
  200. ! static char rcsid[] = "$Id: build_ent.c,v 1.3 91/03/04 11:35:39 eric Exp $";
  201. ! #endif /* !lint */
  202.   
  203.   /*
  204.    *    Copyright (c) 1989, Brian Berliner
  205. diff -c src/checkin.c:1.1.1.3 tools/src/checkin.c:1.3
  206. *** src/checkin.c:1.1.1.3    Wed Jul 10 22:00:58 1991
  207. --- src/checkin.c    Wed Jul 10 22:00:59 1991
  208. ***************
  209. *** 1,6 ****
  210.   #ifndef lint
  211. ! static char rcsid[] = "$Id: checkin.c,v 1.1.1.3 91/03/03 22:00:51 eric Exp $";
  212. ! #endif !lint
  213.   
  214.   /*
  215.    *    Copyright (c) 1989, Brian Berliner
  216. --- 1,6 ----
  217.   #ifndef lint
  218. ! static char rcsid[] = "$Id: checkin.c,v 1.3 91/03/04 11:35:41 eric Exp $";
  219. ! #endif /* !lint */
  220.   
  221.   /*
  222.    *    Copyright (c) 1989, Brian Berliner
  223. diff -c src/checkin.csh:1.1.1.3 tools/src/checkin.csh:1.2
  224. *** src/checkin.csh:1.1.1.3    Wed Jul 10 22:01:00 1991
  225. --- src/checkin.csh    Wed Jul 10 22:01:01 1991
  226. ***************
  227. *** 1,6 ****
  228.   #!/bin/csh
  229.   #
  230. ! # $Id: checkin.csh,v 1.1.1.3 91/03/03 22:00:55 eric Exp $
  231.   #
  232.   #   Copyright (c) 1989, Brian Berliner
  233.   #
  234. --- 1,6 ----
  235.   #!/bin/csh
  236.   #
  237. ! # $Id: checkin.csh,v 1.2 91/03/04 03:07:18 eric Exp $
  238.   #
  239.   #   Copyright (c) 1989, Brian Berliner
  240.   #
  241. ***************
  242. *** 44,49 ****
  243. --- 44,53 ----
  244.   set message_file = /tmp/checkin.$$
  245.   set got_one = 0
  246.   
  247. + if ( $?RCSBIN ) then
  248. +     set rcsbin=$RCSBIN
  249. + endif
  250.   if ( $#argv < 3 ) then
  251.       echo "Usage: checkin [-v] [-m message] [-f message_file] repository"
  252.       echo "    Vendor_Tag Vendor_Release_Tag [Vendor_Release_tag...]"
  253. ***************
  254. *** 94,100 ****
  255.       if ( $?EDITOR ) then
  256.       $EDITOR $message_file > /dev/tty
  257.       else
  258. !     /usr/ucb/vi $message_file > /dev/tty
  259.       endif
  260.       set got_one = 1
  261.   endif
  262. --- 98,104 ----
  263.       if ( $?EDITOR ) then
  264.       $EDITOR $message_file > /dev/tty
  265.       else
  266. !     /usr/bin/vi $message_file > /dev/tty
  267.       endif
  268.       set got_one = 1
  269.   endif
  270. diff -c src/checkout.c:1.1.1.3 tools/src/checkout.c:1.3
  271. *** src/checkout.c:1.1.1.3    Wed Jul 10 22:01:03 1991
  272. --- src/checkout.c    Wed Jul 10 22:01:03 1991
  273. ***************
  274. *** 1,6 ****
  275.   #ifndef lint
  276. ! static char rcsid[] = "$Id: checkout.c,v 1.1.1.3 91/03/03 22:00:58 eric Exp $";
  277. ! #endif !lint
  278.   
  279.   /*
  280.    *    Copyright (c) 1989, Brian Berliner
  281. --- 1,6 ----
  282.   #ifndef lint
  283. ! static char rcsid[] = "$Id: checkout.c,v 1.3 91/03/04 11:35:44 eric Exp $";
  284. ! #endif /* !lint */
  285.   
  286.   /*
  287.    *    Copyright (c) 1989, Brian Berliner
  288. diff -c src/coll_sets.c:1.1.1.3 tools/src/coll_sets.c:1.3
  289. *** src/coll_sets.c:1.1.1.3    Wed Jul 10 22:01:05 1991
  290. --- src/coll_sets.c    Wed Jul 10 22:01:06 1991
  291. ***************
  292. *** 1,6 ****
  293.   #ifndef lint
  294. ! static char rcsid[] = "$Id: coll_sets.c,v 1.1.1.3 91/03/03 22:01:01 eric Exp $";
  295. ! #endif !lint
  296.   
  297.   /*
  298.    *    Copyright (c) 1989, Brian Berliner
  299. --- 1,6 ----
  300.   #ifndef lint
  301. ! static char rcsid[] = "$Id: coll_sets.c,v 1.3 91/03/04 11:35:46 eric Exp $";
  302. ! #endif /* !lint */
  303.   
  304.   /*
  305.    *    Copyright (c) 1989, Brian Berliner
  306. diff -c src/commit.c:1.1.1.3 tools/src/commit.c:1.3
  307. *** src/commit.c:1.1.1.3    Wed Jul 10 22:01:09 1991
  308. --- src/commit.c    Wed Jul 10 22:01:09 1991
  309. ***************
  310. *** 1,6 ****
  311.   #ifndef lint
  312. ! static char rcsid[] = "$Id: commit.c,v 1.1.1.3 91/03/03 22:01:05 eric Exp $";
  313. ! #endif !lint
  314.   
  315.   /*
  316.    *    Copyright (c) 1989, Brian Berliner
  317. --- 1,6 ----
  318.   #ifndef lint
  319. ! static char rcsid[] = "$Id: commit.c,v 1.3 91/03/04 11:35:49 eric Exp $";
  320. ! #endif /* !lint */
  321.   
  322.   /*
  323.    *    Copyright (c) 1989, Brian Berliner
  324. ***************
  325. *** 673,679 ****
  326.    */
  327.   #ifndef MAXHOSTNAMELEN
  328.   #define    MAXHOSTNAMELEN    64
  329. ! #endif !MAXHOSTNAMELEN
  330.   
  331.   /*
  332.    * Writes some stuff to the logfile "filter" and returns the status of the
  333. --- 673,679 ----
  334.    */
  335.   #ifndef MAXHOSTNAMELEN
  336.   #define    MAXHOSTNAMELEN    64
  337. ! #endif /* !MAXHOSTNAMELEN */
  338.   
  339.   /*
  340.    * Writes some stuff to the logfile "filter" and returns the status of the
  341. diff -c src/creat_adm.c:1.1.1.3 tools/src/creat_adm.c:1.3
  342. *** src/creat_adm.c:1.1.1.3    Wed Jul 10 22:01:12 1991
  343. --- src/creat_adm.c    Wed Jul 10 22:01:12 1991
  344. ***************
  345. *** 1,6 ****
  346.   #ifndef lint
  347. ! static char rcsid[] = "$Id: creat_adm.c,v 1.1.1.3 91/03/03 22:01:09 eric Exp $";
  348. ! #endif !lint
  349.   
  350.   /*
  351.    *    Copyright (c) 1989, Brian Berliner
  352. --- 1,6 ----
  353.   #ifndef lint
  354. ! static char rcsid[] = "$Id: creat_adm.c,v 1.3 91/03/04 11:35:52 eric Exp $";
  355. ! #endif /* !lint */
  356.   
  357.   /*
  358.    *    Copyright (c) 1989, Brian Berliner
  359. diff -c src/cvs.h:1.1.1.3 tools/src/cvs.h:1.2
  360. *** src/cvs.h:1.1.1.3    Wed Jul 10 22:01:14 1991
  361. --- src/cvs.h    Wed Jul 10 22:01:15 1991
  362. ***************
  363. *** 1,8 ****
  364. ! /*    $Id: cvs.h,v 1.1.1.3 91/03/03 22:01:12 eric Exp $    */
  365.   
  366.   #include <strings.h>
  367.   #include <string.h>
  368.   #include <stdio.h>
  369.   
  370.   /*
  371.    *    Copyright (c) 1989, Brian Berliner
  372. --- 1,18 ----
  373. ! /*    $Id: cvs.h,v 1.2 91/03/04 03:07:33 eric Exp $    */
  374.   
  375.   #include <strings.h>
  376.   #include <string.h>
  377.   #include <stdio.h>
  378. + #ifdef S5r3
  379. + #    include <limits.h>
  380. + #    define    MAXPATHLEN    PATH_MAX
  381. + #    define    USG    1
  382. + #endif
  383. + #if USG
  384. + #    define    bzero(addr, len)    memset(addr, 0, len)
  385. + #    define    bcmp(addr1, addr2, len)    memcmp(addr1, addr2, len)
  386. + #    define    bcopy(addr1, addr2, len)    memcpy(addr1, addr2, len)
  387. + #endif
  388.   
  389.   /*
  390.    *    Copyright (c) 1989, Brian Berliner
  391. ***************
  392. *** 36,45 ****
  393.   
  394.   /* support for the CVSROOTADM files */
  395.   #define    CVSMODULE_FILE    "modules" /* last component of CVSROOTADM_MODULES */
  396. ! #define    CVSMODULE_TMP    ".#modules.XXXXXX"
  397.   #define    CVSMODULE_OPTS    "ai:o:t:"
  398.   #define    CVSLOGINFO_FILE    "loginfo" /* last component of CVSROOTADM_LOGINFO */
  399. ! #define    CVSLOGINFO_TMP    ".#loginfo.XXXXXX"
  400.   
  401.   /* Other CVS file names */
  402.   #define    CVSATTIC    "Attic"
  403. --- 46,55 ----
  404.   
  405.   /* support for the CVSROOTADM files */
  406.   #define    CVSMODULE_FILE    "modules" /* last component of CVSROOTADM_MODULES */
  407. ! #define    CVSMODULE_TMP    "cvsMXXXXXX"
  408.   #define    CVSMODULE_OPTS    "ai:o:t:"
  409.   #define    CVSLOGINFO_FILE    "loginfo" /* last component of CVSROOTADM_LOGINFO */
  410. ! #define    CVSLOGINFO_TMP    "cvsLXXXXXX"
  411.   
  412.   /* Other CVS file names */
  413.   #define    CVSATTIC    "Attic"
  414. ***************
  415. *** 83,89 ****
  416.   #define    DATEFORM    "%02d.%02d.%02d.%02d.%02d.%02d"
  417.   
  418.   /* Programs that cvs runs */
  419. ! #define    DIFF        "/bin/diff"
  420.   #define    GREP        "/bin/grep"
  421.   #define    RM        "/bin/rm"
  422.   #define    SORT        "/usr/bin/sort"
  423. --- 93,99 ----
  424.   #define    DATEFORM    "%02d.%02d.%02d.%02d.%02d.%02d"
  425.   
  426.   /* Programs that cvs runs */
  427. ! #define    DIFF        "/usr/local/bin/diff"
  428.   #define    GREP        "/bin/grep"
  429.   #define    RM        "/bin/rm"
  430.   #define    SORT        "/usr/bin/sort"
  431. ***************
  432. *** 98,104 ****
  433.   #define    RCSBIN_DFLT    "/usr/local/bin" /* directory to find RCS progs */
  434.   
  435.   #define    EDITOR_ENV    "EDITOR"    /* which editor to use */
  436. ! #define    EDITOR_DFLT    "/usr/ucb/vi"    /* somewhat standard */
  437.   
  438.   #define    CVSROOT_ENV    "CVSROOT"    /* source directory root */
  439.   #define    CVSROOT_DFLT    NULL        /* No dflt; must set for checkout */
  440. --- 108,114 ----
  441.   #define    RCSBIN_DFLT    "/usr/local/bin" /* directory to find RCS progs */
  442.   
  443.   #define    EDITOR_ENV    "EDITOR"    /* which editor to use */
  444. ! #define    EDITOR_DFLT    "/usr/bin/vi"    /* somewhat standard */
  445.   
  446.   #define    CVSROOT_ENV    "CVSROOT"    /* source directory root */
  447.   #define    CVSROOT_DFLT    NULL        /* No dflt; must set for checkout */
  448. ***************
  449. *** 109,115 ****
  450.    *
  451.    * If the CVSROOT environment variable is set, it overrides this define.
  452.    */
  453. ! #define    REPOS_STRIP    "/src/master/"
  454.   
  455.   /*
  456.    * The maximum number of files per each CVS directory.
  457. --- 119,125 ----
  458.    *
  459.    * If the CVSROOT environment variable is set, it overrides this define.
  460.    */
  461. ! #define    REPOS_STRIP    "/usr/acct/mastersrc/"
  462.   
  463.   /*
  464.    * The maximum number of files per each CVS directory.
  465. ***************
  466. *** 157,164 ****
  467. --- 167,182 ----
  468.    * Externs that are included in libc, but are used frequently
  469.    * enough to warrant defining here.
  470.    */
  471. + /*
  472. +  * sprintf() returns an int under System V
  473.   extern char *sprintf();
  474. +  */
  475.   extern char *optarg;            /* for getopt() support */
  476. + #ifdef USG
  477. + extern char *getcwd();
  478. + #define getwd(c)    getcwd((c), (MAXPATHLEN-2))
  479. + #else
  480.   extern char *getwd();
  481. + #endif
  482.   extern char *re_comp();
  483.   extern int optind;
  484. diff -c src/diff.c:1.1.1.3 tools/src/diff.c:1.3
  485. *** src/diff.c:1.1.1.3    Wed Jul 10 22:01:16 1991
  486. --- src/diff.c    Wed Jul 10 22:01:17 1991
  487. ***************
  488. *** 1,6 ****
  489.   #ifndef lint
  490. ! static char rcsid[] = "$Id: diff.c,v 1.1.1.3 91/03/03 22:01:15 eric Exp $";
  491. ! #endif !lint
  492.   
  493.   /*
  494.    *    Copyright (c) 1989, Brian Berliner
  495. --- 1,6 ----
  496.   #ifndef lint
  497. ! static char rcsid[] = "$Id: diff.c,v 1.3 91/03/04 11:35:55 eric Exp $";
  498. ! #endif /* !lint */
  499.   
  500.   /*
  501.    *    Copyright (c) 1989, Brian Berliner
  502. diff -c src/entr_file.c:1.1.1.3 tools/src/entr_file.c:1.3
  503. *** src/entr_file.c:1.1.1.3    Wed Jul 10 22:01:18 1991
  504. --- src/entr_file.c    Wed Jul 10 22:01:18 1991
  505. ***************
  506. *** 1,6 ****
  507.   #ifndef lint
  508. ! static char rcsid[] = "$Id: entr_file.c,v 1.1.1.3 91/03/03 22:01:19 eric Exp $";
  509. ! #endif !lint
  510.   
  511.   /*
  512.    *    Copyright (c) 1989, Brian Berliner
  513. --- 1,6 ----
  514.   #ifndef lint
  515. ! static char rcsid[] = "$Id: entr_file.c,v 1.3 91/03/04 11:35:57 eric Exp $";
  516. ! #endif /* !lint */
  517.   
  518.   /*
  519.    *    Copyright (c) 1989, Brian Berliner
  520. diff -c src/find_names.c:1.1.1.3 tools/src/find_names.c:1.3
  521. *** src/find_names.c:1.1.1.3    Wed Jul 10 22:01:19 1991
  522. --- src/find_names.c    Wed Jul 10 22:01:20 1991
  523. ***************
  524. *** 1,6 ****
  525.   #ifndef lint
  526. ! static char rcsid[] = "$Id: find_names.c,v 1.1.1.3 91/03/03 22:01:22 eric Exp $";
  527. ! #endif !lint
  528.   
  529.   /*
  530.    *    Copyright (c) 1989, Brian Berliner
  531. --- 1,6 ----
  532.   #ifndef lint
  533. ! static char rcsid[] = "$Id: find_names.c,v 1.3 91/03/04 11:35:59 eric Exp $";
  534. ! #endif /* !lint */
  535.   
  536.   /*
  537.    *    Copyright (c) 1989, Brian Berliner
  538. diff -c src/join.c:1.1.1.3 tools/src/join.c:1.3
  539. *** src/join.c:1.1.1.3    Wed Jul 10 22:01:21 1991
  540. --- src/join.c    Wed Jul 10 22:01:22 1991
  541. ***************
  542. *** 1,6 ****
  543.   #ifndef lint
  544. ! static char rcsid[] = "$Id: join.c,v 1.1.1.3 91/03/03 22:01:26 eric Exp $";
  545. ! #endif !lint
  546.   
  547.   /*
  548.    *    Copyright (c) 1989, Brian Berliner
  549. --- 1,6 ----
  550.   #ifndef lint
  551. ! static char rcsid[] = "$Id: join.c,v 1.3 91/03/04 11:36:01 eric Exp $";
  552. ! #endif /* !lint */
  553.   
  554.   /*
  555.    *    Copyright (c) 1989, Brian Berliner
  556. diff -c src/locate_rcs.c:1.1.1.3 tools/src/locate_rcs.c:1.3
  557. *** src/locate_rcs.c:1.1.1.3    Wed Jul 10 22:01:26 1991
  558. --- src/locate_rcs.c    Wed Jul 10 22:01:26 1991
  559. ***************
  560. *** 1,6 ****
  561.   #ifndef lint
  562. ! static char rcsid[] = "$Id: locate_rcs.c,v 1.1.1.3 91/03/03 22:01:29 eric Exp $";
  563. ! #endif !lint
  564.   
  565.   /*
  566.    *    Copyright (c) 1989, Brian Berliner
  567. --- 1,6 ----
  568.   #ifndef lint
  569. ! static char rcsid[] = "$Id: locate_rcs.c,v 1.3 91/03/04 11:36:04 eric Exp $";
  570. ! #endif /* !lint */
  571.   
  572.   /*
  573.    *    Copyright (c) 1989, Brian Berliner
  574. diff -c src/log.c:1.1.1.3 tools/src/log.c:1.3
  575. *** src/log.c:1.1.1.3    Wed Jul 10 22:01:29 1991
  576. --- src/log.c    Wed Jul 10 22:01:30 1991
  577. ***************
  578. *** 1,6 ****
  579.   #ifndef lint
  580. ! static char rcsid[] = "$Id: log.c,v 1.1.1.3 91/03/03 22:01:32 eric Exp $";
  581. ! #endif !lint
  582.   
  583.   /*
  584.    *    Copyright (c) 1989, Brian Berliner
  585. --- 1,6 ----
  586.   #ifndef lint
  587. ! static char rcsid[] = "$Id: log.c,v 1.3 91/03/04 11:36:07 eric Exp $";
  588. ! #endif /* !lint */
  589.   
  590.   /*
  591.    *    Copyright (c) 1989, Brian Berliner
  592. diff -c src/mkmodules.c:1.1.1.3 tools/src/mkmodules.c:1.3
  593. *** src/mkmodules.c:1.1.1.3    Wed Jul 10 22:01:37 1991
  594. --- src/mkmodules.c    Wed Jul 10 22:01:37 1991
  595. ***************
  596. *** 1,6 ****
  597.   #ifndef lint
  598. ! static char rcsid[] = "$Id: mkmodules.c,v 1.1.1.3 91/03/03 22:01:43 eric Exp $";
  599. ! #endif !lint
  600.   
  601.   /*
  602.    *    Copyright (c) 1989, Brian Berliner
  603. --- 1,6 ----
  604.   #ifndef lint
  605. ! static char rcsid[] = "$Id: mkmodules.c,v 1.3 91/03/04 11:36:10 eric Exp $";
  606. ! #endif /* !lint */
  607.   
  608.   /*
  609.    *    Copyright (c) 1989, Brian Berliner
  610. ***************
  611. *** 96,101 ****
  612. --- 96,105 ----
  613.       return (0);
  614.   }
  615.   
  616. + #ifndef DBLKSIZ
  617. + #define DBLKSIZ    2048
  618. + #endif
  619.   static
  620.   write_dbmfile(temp)
  621.       char *temp;
  622. ***************
  623. *** 107,116 ****
  624.       datum key, val;
  625.       int len, cont, err = 0;
  626.   
  627.       fp = open_file(temp, "r");
  628.       if ((db = dbm_open(temp, O_RDWR|O_CREAT|O_TRUNC, 0666)) == NULL)
  629.       error(1, "cannot open dbm file %s for creation", temp);
  630. !     for (cont = 0; fgets(line, sizeof(line), fp) != NULL; ) {
  631.       if ((cp = rindex(line, '\n')) != NULL)
  632.           *cp = '\0';            /* strip the newline */
  633.       /*
  634. --- 111,121 ----
  635.       datum key, val;
  636.       int len, cont, err = 0;
  637.   
  638.       fp = open_file(temp, "r");
  639.       if ((db = dbm_open(temp, O_RDWR|O_CREAT|O_TRUNC, 0666)) == NULL)
  640.       error(1, "cannot open dbm file %s for creation", temp);
  641. !     for (cont = 0; fgets(line, DBLKSIZ, fp) != NULL; ) {
  642.       if ((cp = rindex(line, '\n')) != NULL)
  643.           *cp = '\0';            /* strip the newline */
  644.       /*
  645. ***************
  646. *** 234,240 ****
  647.   {
  648.   #ifdef lint
  649.       sig = sig;
  650. ! #endif lint
  651.   }
  652.   
  653.   static
  654. --- 239,245 ----
  655.   {
  656.   #ifdef lint
  657.       sig = sig;
  658. ! #endif /* lint */
  659.   }
  660.   
  661.   static
  662. diff -c src/modules.c:1.1.1.3 tools/src/modules.c:1.3
  663. *** src/modules.c:1.1.1.3    Wed Jul 10 22:01:39 1991
  664. --- src/modules.c    Wed Jul 10 22:01:40 1991
  665. ***************
  666. *** 1,6 ****
  667.   #ifndef lint
  668. ! static char rcsid[] = "$Id: modules.c,v 1.1.1.3 91/03/03 22:01:46 eric Exp $";
  669. ! #endif !lint
  670.   
  671.   /*
  672.    *    Copyright (c) 1989, Brian Berliner
  673. --- 1,6 ----
  674.   #ifndef lint
  675. ! static char rcsid[] = "$Id: modules.c,v 1.3 91/03/04 11:36:13 eric Exp $";
  676. ! #endif /* !lint */
  677.   
  678.   /*
  679.    *    Copyright (c) 1989, Brian Berliner
  680. ***************
  681. *** 23,32 ****
  682.    *    command line.
  683.    */
  684.   
  685.   #include <sys/param.h>
  686. ! #include <sys/file.h>
  687.   #include <ndbm.h>
  688. - #include "cvs.h"
  689.   
  690.   extern int update_build_dirs;
  691.   
  692. --- 23,36 ----
  693.    *    command line.
  694.    */
  695.   
  696. + #include "cvs.h"
  697.   #include <sys/param.h>
  698. ! #ifdef USG
  699. ! #    include    <sys/fcntl.h>
  700. ! #else
  701. ! #    include <sys/file.h>
  702. ! #endif
  703.   #include <ndbm.h>
  704.   
  705.   extern int update_build_dirs;
  706.   
  707. diff -c src/name_repos.c:1.1.1.3 tools/src/name_repos.c:1.3
  708. *** src/name_repos.c:1.1.1.3    Wed Jul 10 22:01:41 1991
  709. --- src/name_repos.c    Wed Jul 10 22:01:41 1991
  710. ***************
  711. *** 1,6 ****
  712.   #ifndef lint
  713. ! static char rcsid[] = "$Id: name_repos.c,v 1.1.1.3 91/03/03 22:01:49 eric Exp $";
  714. ! #endif !lint
  715.   
  716.   /*
  717.    *    Copyright (c) 1989, Brian Berliner
  718. --- 1,6 ----
  719.   #ifndef lint
  720. ! static char rcsid[] = "$Id: name_repos.c,v 1.3 91/03/04 11:36:15 eric Exp $";
  721. ! #endif /* !lint */
  722.   
  723.   /*
  724.    *    Copyright (c) 1989, Brian Berliner
  725. diff -c src/no_diff.c:1.1.1.3 tools/src/no_diff.c:1.3
  726. *** src/no_diff.c:1.1.1.3    Wed Jul 10 22:01:42 1991
  727. --- src/no_diff.c    Wed Jul 10 22:01:43 1991
  728. ***************
  729. *** 1,6 ****
  730.   #ifndef lint
  731. ! static char rcsid[] = "$Id: no_diff.c,v 1.1.1.3 91/03/03 22:01:52 eric Exp $";
  732. ! #endif !lint
  733.   
  734.   /*
  735.    *    Copyright (c) 1989, Brian Berliner
  736. --- 1,6 ----
  737.   #ifndef lint
  738. ! static char rcsid[] = "$Id: no_diff.c,v 1.3 91/03/04 11:36:17 eric Exp $";
  739. ! #endif /* !lint */
  740.   
  741.   /*
  742.    *    Copyright (c) 1989, Brian Berliner
  743. diff -c src/options.c:1.1.1.3 tools/src/options.c:1.3
  744. *** src/options.c:1.1.1.3    Wed Jul 10 22:01:44 1991
  745. --- src/options.c    Wed Jul 10 22:01:44 1991
  746. ***************
  747. *** 1,6 ****
  748.   #ifndef lint
  749. ! static char rcsid[] = "$Id: options.c,v 1.1.1.3 91/03/03 22:01:55 eric Exp $";
  750. ! #endif !lint
  751.   
  752.   /*
  753.    *    Copyright (c) 1989, Brian Berliner
  754. --- 1,6 ----
  755.   #ifndef lint
  756. ! static char rcsid[] = "$Id: options.c,v 1.3 91/03/04 11:36:20 eric Exp $";
  757. ! #endif /* !lint */
  758.   
  759.   /*
  760.    *    Copyright (c) 1989, Brian Berliner
  761. diff -c src/patch.c:1.1.1.3 tools/src/patch.c:1.3
  762. *** src/patch.c:1.1.1.3    Wed Jul 10 22:01:50 1991
  763. --- src/patch.c    Wed Jul 10 22:01:50 1991
  764. ***************
  765. *** 1,6 ****
  766.   #ifndef lint
  767. ! static char rcsid[] = "$Id: patch.c,v 1.1.1.3 91/03/03 22:02:03 eric Exp $";
  768. ! #endif !lint
  769.   
  770.   /*
  771.    *    Copyright (c) 1989, Brian Berliner
  772. --- 1,6 ----
  773.   #ifndef lint
  774. ! static char rcsid[] = "$Id: patch.c,v 1.3 91/03/04 11:36:22 eric Exp $";
  775. ! #endif /* !lint */
  776.   
  777.   /*
  778.    *    Copyright (c) 1989, Brian Berliner
  779. ***************
  780. *** 15,20 ****
  781. --- 15,21 ----
  782.    *    specify the release as either a date or a revision number.
  783.    */
  784.   
  785. + #include <sys/types.h>
  786.   #include <sys/param.h>
  787.   #include <time.h>
  788.   #include <ndbm.h>
  789. ***************
  790. *** 21,26 ****
  791. --- 22,30 ----
  792.   #include <dirent.h>
  793.   #include <ctype.h>
  794.   #include "cvs.h"
  795. + #ifdef USG
  796. + #    include <signal.h>
  797. + #endif
  798.   
  799.   extern char update_dir[];
  800.   extern DBM *open_module();
  801. diff -c src/register.c:1.1.1.3 tools/src/register.c:1.3
  802. *** src/register.c:1.1.1.3    Wed Jul 10 22:01:53 1991
  803. --- src/register.c    Wed Jul 10 22:01:54 1991
  804. ***************
  805. *** 1,6 ****
  806.   #ifndef lint
  807. ! static char rcsid[] = "$Id: register.c,v 1.1.1.3 91/03/03 22:02:10 eric Exp $";
  808. ! #endif !lint
  809.   
  810.   /*
  811.    *    Copyright (c) 1989, Brian Berliner
  812. --- 1,6 ----
  813.   #ifndef lint
  814. ! static char rcsid[] = "$Id: register.c,v 1.3 91/03/04 11:36:24 eric Exp $";
  815. ! #endif /* !lint */
  816.   
  817.   /*
  818.    *    Copyright (c) 1989, Brian Berliner
  819. diff -c src/remove.c:1.1.1.3 tools/src/remove.c:1.3
  820. *** src/remove.c:1.1.1.3    Wed Jul 10 22:01:55 1991
  821. --- src/remove.c    Wed Jul 10 22:01:55 1991
  822. ***************
  823. *** 1,6 ****
  824.   #ifndef lint
  825. ! static char rcsid[] = "$Id: remove.c,v 1.1.1.3 91/03/03 22:02:12 eric Exp $";
  826. ! #endif !lint
  827.   
  828.   /*
  829.    *    Copyright (c) 1989, Brian Berliner
  830. --- 1,6 ----
  831.   #ifndef lint
  832. ! static char rcsid[] = "$Id: remove.c,v 1.3 91/03/04 11:36:27 eric Exp $";
  833. ! #endif /* !lint */
  834.   
  835.   /*
  836.    *    Copyright (c) 1989, Brian Berliner
  837. diff -c src/scratch_en.c:1.1.1.3 tools/src/scratch_en.c:1.3
  838. *** src/scratch_en.c:1.1.1.3    Wed Jul 10 22:01:56 1991
  839. --- src/scratch_en.c    Wed Jul 10 22:01:57 1991
  840. ***************
  841. *** 1,6 ****
  842.   #ifndef lint
  843. ! static char rcsid[] = "$Id: scratch_en.c,v 1.1.1.3 91/03/03 22:02:16 eric Exp $";
  844. ! #endif !lint
  845.   
  846.   /*
  847.    *    Copyright (c) 1989, Brian Berliner
  848. --- 1,6 ----
  849.   #ifndef lint
  850. ! static char rcsid[] = "$Id: scratch_en.c,v 1.3 91/03/04 11:36:29 eric Exp $";
  851. ! #endif /* !lint */
  852.   
  853.   /*
  854.    *    Copyright (c) 1989, Brian Berliner
  855. ***************
  856. *** 16,21 ****
  857. --- 16,25 ----
  858.   
  859.   #include <sys/param.h>
  860.   #include "cvs.h"
  861. + #ifndef MAX
  862. + #define MAX(a,b)    ((a) > (b) ? (a) : (b))
  863. + #endif
  864.   
  865.   Scratch_Entry(fname)
  866.       char *fname;
  867. diff -c src/set_lock.c:1.1.1.3 tools/src/set_lock.c:1.3
  868. *** src/set_lock.c:1.1.1.3    Wed Jul 10 22:01:58 1991
  869. --- src/set_lock.c    Wed Jul 10 22:01:58 1991
  870. ***************
  871. *** 1,6 ****
  872.   #ifndef lint
  873. ! static char rcsid[] = "$Id: set_lock.c,v 1.1.1.3 91/03/03 22:02:19 eric Exp $";
  874. ! #endif !lint
  875.   
  876.   /*
  877.    *    Copyright (c) 1989, Brian Berliner
  878. --- 1,6 ----
  879.   #ifndef lint
  880. ! static char rcsid[] = "$Id: set_lock.c,v 1.3 91/03/04 11:36:32 eric Exp $";
  881. ! #endif /* !lint */
  882.   
  883.   /*
  884.    *    Copyright (c) 1989, Brian Berliner
  885. diff -c src/status.c:1.1.1.3 tools/src/status.c:1.3
  886. *** src/status.c:1.1.1.3    Wed Jul 10 22:02:00 1991
  887. --- src/status.c    Wed Jul 10 22:02:00 1991
  888. ***************
  889. *** 1,6 ****
  890.   #ifndef lint
  891. ! static char rcsid[] = "$Id: status.c,v 1.1.1.3 91/03/03 22:02:22 eric Exp $";
  892. ! #endif !lint
  893.   
  894.   /*
  895.    *    Copyright (c) 1989, Brian Berliner
  896. --- 1,6 ----
  897.   #ifndef lint
  898. ! static char rcsid[] = "$Id: status.c,v 1.3 91/03/04 11:36:34 eric Exp $";
  899. ! #endif /* !lint */
  900.   
  901.   /*
  902.    *    Copyright (c) 1989, Brian Berliner
  903. diff -c src/subr.c:1.1.1.3 tools/src/subr.c:1.3
  904. *** src/subr.c:1.1.1.3    Wed Jul 10 22:02:02 1991
  905. --- src/subr.c    Wed Jul 10 22:02:02 1991
  906. ***************
  907. *** 1,6 ****
  908.   #ifndef lint
  909. ! static char rcsid[] = "$Id: subr.c,v 1.1.1.3 91/03/03 22:02:25 eric Exp $";
  910. ! #endif !lint
  911.   
  912.   /*
  913.    *    Copyright (c) 1989, Brian Berliner
  914. --- 1,6 ----
  915.   #ifndef lint
  916. ! static char rcsid[] = "$Id: subr.c,v 1.3 91/03/04 11:36:36 eric Exp $";
  917. ! #endif /* !lint */
  918.   
  919.   /*
  920.    *    Copyright (c) 1989, Brian Berliner
  921. ***************
  922. *** 16,21 ****
  923. --- 16,25 ----
  924.   #include <sys/file.h>
  925.   #include <varargs.h>
  926.   #include "cvs.h"
  927. + #ifdef USG
  928. + #    include    <sys/fcntl.h>
  929. + #    include <unistd.h>
  930. + #endif
  931.   
  932.   /*
  933.    * Send a "printf" format string to stderr and die, calling the
  934. ***************
  935. *** 239,251 ****
  936.   /* Some UNIX distributions don't include these in their stat.h */
  937.   #ifndef S_IWRITE
  938.   #define    S_IWRITE    0000200        /* write permission, owner */
  939. ! #endif !S_IWRITE
  940.   #ifndef S_IWGRP
  941.   #define    S_IWGRP        0000020        /* write permission, grougroup */
  942. ! #endif !S_IWGRP
  943.   #ifndef S_IWOTH
  944.   #define    S_IWOTH        0000002        /* write permission, other */
  945. ! #endif !S_IWOTH
  946.   
  947.   /*
  948.    * Change the mode of a file, either adding write permissions, or
  949. --- 243,255 ----
  950.   /* Some UNIX distributions don't include these in their stat.h */
  951.   #ifndef S_IWRITE
  952.   #define    S_IWRITE    0000200        /* write permission, owner */
  953. ! #endif /* !S_IWRITE */
  954.   #ifndef S_IWGRP
  955.   #define    S_IWGRP        0000020        /* write permission, grougroup */
  956. ! #endif /* !S_IWGRP */
  957.   #ifndef S_IWOTH
  958.   #define    S_IWOTH        0000002        /* write permission, other */
  959. ! #endif /* !S_IWOTH */
  960.   
  961.   /*
  962.    * Change the mode of a file, either adding write permissions, or
  963. diff -c src/tag.c:1.1.1.3 tools/src/tag.c:1.3
  964. *** src/tag.c:1.1.1.3    Wed Jul 10 22:02:04 1991
  965. --- src/tag.c    Wed Jul 10 22:02:04 1991
  966. ***************
  967. *** 1,6 ****
  968.   #ifndef lint
  969. ! static char rcsid[] = "$Id: tag.c,v 1.1.1.3 91/03/03 22:02:29 eric Exp $";
  970. ! #endif !lint
  971.   
  972.   /*
  973.    *    Copyright (c) 1989, Brian Berliner
  974. --- 1,6 ----
  975.   #ifndef lint
  976. ! static char rcsid[] = "$Id: tag.c,v 1.3 91/03/04 11:36:39 eric Exp $";
  977. ! #endif /* !lint */
  978.   
  979.   /*
  980.    *    Copyright (c) 1989, Brian Berliner
  981. ***************
  982. *** 15,20 ****
  983. --- 15,21 ----
  984.    */
  985.   
  986.   #include <sys/param.h>
  987. + #include <sys/types.h>
  988.   #include <ndbm.h>
  989.   #include <dirent.h>
  990.   #include <ctype.h>
  991. diff -c src/update.c:1.1.1.3 tools/src/update.c:1.3
  992. *** src/update.c:1.1.1.3    Wed Jul 10 22:02:06 1991
  993. --- src/update.c    Wed Jul 10 22:02:07 1991
  994. ***************
  995. *** 1,6 ****
  996.   #ifndef lint
  997. ! static char rcsid[] = "$Id: update.c,v 1.1.1.3 91/03/03 22:02:32 eric Exp $";
  998. ! #endif !lint
  999.   
  1000.   /*
  1001.    *    Copyright (c) 1989, Brian Berliner
  1002. --- 1,6 ----
  1003.   #ifndef lint
  1004. ! static char rcsid[] = "$Id: update.c,v 1.3 91/03/04 11:36:41 eric Exp $";
  1005. ! #endif /* !lint */
  1006.   
  1007.   /*
  1008.    *    Copyright (c) 1989, Brian Berliner
  1009. diff -c src/vers_num.c:1.1.1.3 tools/src/vers_num.c:1.3
  1010. *** src/vers_num.c:1.1.1.3    Wed Jul 10 22:02:09 1991
  1011. --- src/vers_num.c    Wed Jul 10 22:02:09 1991
  1012. ***************
  1013. *** 1,6 ****
  1014.   #ifndef lint
  1015. ! static char rcsid[] = "$Id: vers_num.c,v 1.1.1.3 91/03/03 22:02:37 eric Exp $";
  1016. ! #endif !lint
  1017.   
  1018.   /*
  1019.    *    Copyright (c) 1989, Brian Berliner
  1020. --- 1,6 ----
  1021.   #ifndef lint
  1022. ! static char rcsid[] = "$Id: vers_num.c,v 1.3 91/03/04 11:36:44 eric Exp $";
  1023. ! #endif /* !lint */
  1024.   
  1025.   /*
  1026.    *    Copyright (c) 1989, Brian Berliner
  1027. diff -c src/version_ts.c:1.1.1.3 tools/src/version_ts.c:1.3
  1028. *** src/version_ts.c:1.1.1.3    Wed Jul 10 22:02:11 1991
  1029. --- src/version_ts.c    Wed Jul 10 22:02:11 1991
  1030. ***************
  1031. *** 1,6 ****
  1032.   #ifndef lint
  1033. ! static char rcsid[] = "$Id: version_ts.c,v 1.1.1.3 91/03/03 22:02:40 eric Exp $";
  1034. ! #endif !lint
  1035.   
  1036.   /*
  1037.    *    Copyright (c) 1989, Brian Berliner
  1038. --- 1,6 ----
  1039.   #ifndef lint
  1040. ! static char rcsid[] = "$Id: version_ts.c,v 1.3 91/03/04 11:36:48 eric Exp $";
  1041. ! #endif /* !lint */
  1042.   
  1043.   /*
  1044.    *    Copyright (c) 1989, Brian Berliner
  1045. ***************
  1046. *** 93,105 ****
  1047.   /* Some UNIX distributions don't include these in their stat.h */
  1048.   #ifndef S_IWRITE
  1049.   #define    S_IWRITE    0000200        /* write permission, owner */
  1050. ! #endif !S_IWRITE
  1051.   #ifndef S_IWGRP
  1052.   #define    S_IWGRP        0000020        /* write permission, grougroup */
  1053. ! #endif !S_IWGRP
  1054.   #ifndef S_IWOTH
  1055.   #define    S_IWOTH        0000002        /* write permission, other */
  1056. ! #endif !S_IWOTH
  1057.   
  1058.   /*
  1059.    * Gets the time-stamp for the file "file" and puts it in the already
  1060. --- 93,105 ----
  1061.   /* Some UNIX distributions don't include these in their stat.h */
  1062.   #ifndef S_IWRITE
  1063.   #define    S_IWRITE    0000200        /* write permission, owner */
  1064. ! #endif /* !S_IWRITE */
  1065.   #ifndef S_IWGRP
  1066.   #define    S_IWGRP        0000020        /* write permission, grougroup */
  1067. ! #endif /* !S_IWGRP */
  1068.   #ifndef S_IWOTH
  1069.   #define    S_IWOTH        0000002        /* write permission, other */
  1070. ! #endif /* !S_IWOTH */
  1071.   
  1072.   /*
  1073.    * Gets the time-stamp for the file "file" and puts it in the already
  1074. diff -c /dev/null src/misc.c
  1075. *** /dev/null    Wed Jul 10 21:29:33 1991
  1076. --- src/misc.c    Wed Jul 10 13:11:29 1991
  1077. ***************
  1078. *** 0 ****
  1079. --- 1,68 ----
  1080. + /*
  1081. +  *    Copyright (c) 1991, Eric Schnoebelen
  1082. +  *
  1083. +  *    You may distribute under the terms of the GNU General Public License
  1084. +  *    as specified in the README file that comes with the CVS 1.0 kit.
  1085. +  *
  1086. +  * This is a file of miscelanous routines needed to make CVS compile 
  1087. +  * under System V
  1088. +  *
  1089. +  * Eric Schnoebelen
  1090. +  * 03/01/91
  1091. +  */
  1092. + #include <sys/types.h>
  1093. + #include "cvs.h"
  1094. + #ifdef USG
  1095. + #include <sys/utsname.h>
  1096. + #include <unistd.h>
  1097. + #include <fcntl.h>
  1098. + #include <stdio.h>
  1099. + #include <errno.h>
  1100. + int
  1101. + rename(from, to)
  1102. + char *from, *to;
  1103. + {
  1104. +     if (unlink(to) && errno != ENOENT)
  1105. +     return -1;
  1106. +     if (link(from,to))
  1107. +     return -1;
  1108. +     if (unlink(from))
  1109. +     return -1;
  1110. +     return 0;
  1111. + }
  1112. + gethostname(name, namlen) 
  1113. + char *name;
  1114. + int namlen;
  1115. + {
  1116. +     int i;
  1117. +     struct utsname uts;
  1118. +     uname(&uts);
  1119. +     i = strlen(uts.nodename) + 1;
  1120. +     (void) strncpy(name, uts.nodename, i < namlen ? i : namlen);
  1121. + }
  1122. + int
  1123. + mkstemp(template)
  1124. + char *template;
  1125. + {
  1126. +     return(open(mktemp(template),O_RDWR|O_CREAT, 0666));
  1127. + }
  1128. + int
  1129. + setlinebuf(stream)
  1130. + FILE *stream;
  1131. + {
  1132. + char *buf, *malloc();
  1133. +     buf = malloc(BUFSIZ);
  1134. +     fflush(stream);
  1135. +     return setvbuf(stream, buf, _IOLBF, BUFSIZ);
  1136. + }
  1137. + #endif /* USG */
  1138. diff -c /dev/null src/regex.c
  1139. *** /dev/null    Wed Jul 10 21:29:33 1991
  1140. --- src/regex.c    Wed Jul 10 13:11:38 1991
  1141. ***************
  1142. *** 0 ****
  1143. --- 1,394 ----
  1144. + /* @(#)regex.c    4.1 (Berkeley) 12/21/80 */
  1145. + /*
  1146. +  * routines to do regular expression matching
  1147. +  *
  1148. +  * Entry points:
  1149. +  *
  1150. +  *    re_comp(s)
  1151. +  *        char *s;
  1152. +  *     ... returns 0 if the string s was compiled successfully,
  1153. +  *             a pointer to an error message otherwise.
  1154. +  *         If passed 0 or a null string returns without changing
  1155. +  *           the currently compiled re (see note 11 below).
  1156. +  *
  1157. +  *    re_exec(s)
  1158. +  *        char *s;
  1159. +  *     ... returns 1 if the string s matches the last compiled regular
  1160. +  *               expression, 
  1161. +  *             0 if the string s failed to match the last compiled
  1162. +  *               regular expression, and
  1163. +  *            -1 if the compiled regular expression was invalid 
  1164. +  *               (indicating an internal error).
  1165. +  *
  1166. +  * The strings passed to both re_comp and re_exec may have trailing or
  1167. +  * embedded newline characters; they are terminated by nulls.
  1168. +  *
  1169. +  * The identity of the author of these routines is lost in antiquity;
  1170. +  * this is essentially the same as the re code in the original V6 ed.
  1171. +  *
  1172. +  * The regular expressions recognized are described below. This description
  1173. +  * is essentially the same as that for ed.
  1174. +  *
  1175. +  *    A regular expression specifies a set of strings of characters.
  1176. +  *    A member of this set of strings is said to be matched by
  1177. +  *    the regular expression.  In the following specification for
  1178. +  *    regular expressions the word `character' means any character but NUL.
  1179. +  *
  1180. +  *    1.  Any character except a special character matches itself.
  1181. +  *        Special characters are the regular expression delimiter plus
  1182. +  *        \ [ . and sometimes ^ * $.
  1183. +  *    2.  A . matches any character.
  1184. +  *    3.  A \ followed by any character except a digit or ( )
  1185. +  *        matches that character.
  1186. +  *    4.  A nonempty string s bracketed [s] (or [^s]) matches any
  1187. +  *        character in (or not in) s. In s, \ has no special meaning,
  1188. +  *        and ] may only appear as the first letter. A substring 
  1189. +  *        a-b, with a and b in ascending ASCII order, stands for
  1190. +  *        the inclusive range of ASCII characters.
  1191. +  *    5.  A regular expression of form 1-4 followed by * matches a
  1192. +  *        sequence of 0 or more matches of the regular expression.
  1193. +  *    6.  A regular expression, x, of form 1-8, bracketed \(x\)
  1194. +  *        matches what x matches.
  1195. +  *    7.  A \ followed by a digit n matches a copy of the string that the
  1196. +  *        bracketed regular expression beginning with the nth \( matched.
  1197. +  *    8.  A regular expression of form 1-8, x, followed by a regular
  1198. +  *        expression of form 1-7, y matches a match for x followed by
  1199. +  *        a match for y, with the x match being as long as possible
  1200. +  *        while still permitting a y match.
  1201. +  *    9.  A regular expression of form 1-8 preceded by ^ (or followed
  1202. +  *        by $), is constrained to matches that begin at the left
  1203. +  *        (or end at the right) end of a line.
  1204. +  *    10. A regular expression of form 1-9 picks out the longest among
  1205. +  *        the leftmost matches in a line.
  1206. +  *    11. An empty regular expression stands for a copy of the last
  1207. +  *        regular expression encountered.
  1208. +  */
  1209. + /*
  1210. +  * constants for re's
  1211. +  */
  1212. + #define    CBRA    1
  1213. + #define    CCHR    2
  1214. + #define    CDOT    4
  1215. + #define    CCL    6
  1216. + #define    NCCL    8
  1217. + #define    CDOL    10
  1218. + #define    CEOF    11
  1219. + #define    CKET    12
  1220. + #define    CBACK    18
  1221. + #define    CSTAR    01
  1222. + #define    ESIZE    512
  1223. + #define    NBRA    9
  1224. + static    char    regex_expbuf[ESIZE], *regex_braslist[NBRA],
  1225. +         *regex_braelist[NBRA];
  1226. + static    char    regex_circf;
  1227. + /*
  1228. +  * compile the regular expression argument into a dfa
  1229. +  */
  1230. + char *
  1231. + re_comp(sp)
  1232. +     register char    *sp;
  1233. + {
  1234. +     register int    c;
  1235. +     register char    *ep = regex_expbuf;
  1236. +     int    cclcnt, numbra = 0;
  1237. +     char    *lastep = 0;
  1238. +     char    bracket[NBRA];
  1239. +     char    *bracketp = &bracket[0];
  1240. +     /* this is read-only & needs no semaphoring; is static to save space */
  1241. +     static    char    *retoolong = "Regular expression too long";
  1242. + #define    comerr(msg) {regex_expbuf[0] = 0; numbra = 0; return(msg); }
  1243. +     if (sp == 0 || *sp == '\0') {
  1244. +         if (*ep == 0)
  1245. +             return("No previous regular expression");
  1246. +         return(0);
  1247. +     }
  1248. +     if (*sp == '^') {
  1249. +         regex_circf = 1;
  1250. +         sp++;
  1251. +     }
  1252. +     else
  1253. +         regex_circf = 0;
  1254. +     for (;;) {
  1255. +         if (ep >= ®ex_expbuf[ESIZE])
  1256. +             comerr(retoolong);
  1257. +         if ((c = *sp++) == '\0') {
  1258. +             if (bracketp != bracket)
  1259. +                 comerr("unmatched \\(");
  1260. +             *ep++ = CEOF;
  1261. +             *ep++ = 0;
  1262. +             return(0);
  1263. +         }
  1264. +         if (c != '*')
  1265. +             lastep = ep;
  1266. +         switch (c) {
  1267. +         case '.':
  1268. +             *ep++ = CDOT;
  1269. +             continue;
  1270. +         case '*':
  1271. +             if (lastep == 0 || *lastep == CBRA || *lastep == CKET)
  1272. +                 goto defchar;
  1273. +             *lastep |= CSTAR;
  1274. +             continue;
  1275. +         case '$':
  1276. +             if (*sp != '\0')
  1277. +                 goto defchar;
  1278. +             *ep++ = CDOL;
  1279. +             continue;
  1280. +         case '[':
  1281. +             *ep++ = CCL;
  1282. +             *ep++ = 0;
  1283. +             cclcnt = 1;
  1284. +             if ((c = *sp++) == '^') {
  1285. +                 c = *sp++;
  1286. +                 ep[-2] = NCCL;
  1287. +             }
  1288. +             do {
  1289. +                 if (c == '\0')
  1290. +                     comerr("missing ]");
  1291. +                 if (c == '-' && ep [-1] != 0) {
  1292. +                     if ((c = *sp++) == ']') {
  1293. +                         *ep++ = '-';
  1294. +                         cclcnt++;
  1295. +                         break;
  1296. +                     }
  1297. +                     while (ep[-1] < c) {
  1298. +                         *ep = ep[-1] + 1;
  1299. +                         ep++;
  1300. +                         cclcnt++;
  1301. +                         if (ep >= ®ex_expbuf[ESIZE])
  1302. +                             comerr(retoolong);
  1303. +                     }
  1304. +                 }
  1305. +                 *ep++ = c;
  1306. +                 cclcnt++;
  1307. +                 if (ep >= ®ex_expbuf[ESIZE])
  1308. +                     comerr(retoolong);
  1309. +             } while ((c = *sp++) != ']');
  1310. +             lastep[1] = cclcnt;
  1311. +             continue;
  1312. +         case '\\':
  1313. +             if ((c = *sp++) == '(') {
  1314. +                 if (numbra >= NBRA)
  1315. +                     comerr("too many \\(\\) pairs");
  1316. +                 *bracketp++ = numbra;
  1317. +                 *ep++ = CBRA;
  1318. +                 *ep++ = numbra++;
  1319. +                 continue;
  1320. +             }
  1321. +             if (c == ')') {
  1322. +                 if (bracketp <= bracket)
  1323. +                     comerr("unmatched \\)");
  1324. +                 *ep++ = CKET;
  1325. +                 *ep++ = *--bracketp;
  1326. +                 continue;
  1327. +             }
  1328. +             if (c >= '1' && c < ('1' + NBRA)) {
  1329. +                 *ep++ = CBACK;
  1330. +                 *ep++ = c - '1';
  1331. +                 continue;
  1332. +             }
  1333. +             *ep++ = CCHR;
  1334. +             *ep++ = c;
  1335. +             continue;
  1336. +         defchar:
  1337. +         default:
  1338. +             *ep++ = CCHR;
  1339. +             *ep++ = c;
  1340. +         }
  1341. +     }
  1342. + }
  1343. + /* 
  1344. +  * match the argument string against the compiled re
  1345. +  */
  1346. + int
  1347. + re_exec(p1)
  1348. +     register char    *p1;
  1349. + {
  1350. +     register char    *p2 = regex_expbuf;
  1351. +     register int    c;
  1352. +     int    rv;
  1353. +     for (c = 0; c < NBRA; c++) {
  1354. +         regex_braslist[c] = 0;
  1355. +         regex_braelist[c] = 0;
  1356. +     }
  1357. +     if (regex_circf)
  1358. +         return((advance(p1, p2)));
  1359. +     /*
  1360. +      * fast check for first character
  1361. +      */
  1362. +     if (*p2 == CCHR) {
  1363. +         c = p2[1];
  1364. +         do {
  1365. +             if (*p1 != c)
  1366. +                 continue;
  1367. +             if (rv = advance(p1, p2))
  1368. +                 return(rv);
  1369. +         } while (*p1++);
  1370. +         return(0);
  1371. +     }
  1372. +     /*
  1373. +      * regular algorithm
  1374. +      */
  1375. +     do
  1376. +         if (rv = advance(p1, p2))
  1377. +             return(rv);
  1378. +     while (*p1++);
  1379. +     return(0);
  1380. + }
  1381. + /* 
  1382. +  * try to match the next thing in the dfa
  1383. +  */
  1384. + static    int
  1385. + advance(lp, ep)
  1386. +     register char    *lp, *ep;
  1387. + {
  1388. +     register char    *curlp;
  1389. +     int    ct, i;
  1390. +     int    rv;
  1391. +     for (;;)
  1392. +         switch (*ep++) {
  1393. +         case CCHR:
  1394. +             if (*ep++ == *lp++)
  1395. +                 continue;
  1396. +             return(0);
  1397. +         case CDOT:
  1398. +             if (*lp++)
  1399. +                 continue;
  1400. +             return(0);
  1401. +         case CDOL:
  1402. +             if (*lp == '\0')
  1403. +                 continue;
  1404. +             return(0);
  1405. +         case CEOF:
  1406. +             return(1);
  1407. +         case CCL:
  1408. +             if (cclass(ep, *lp++, 1)) {
  1409. +                 ep += *ep;
  1410. +                 continue;
  1411. +             }
  1412. +             return(0);
  1413. +         case NCCL:
  1414. +             if (cclass(ep, *lp++, 0)) {
  1415. +                 ep += *ep;
  1416. +                 continue;
  1417. +             }
  1418. +             return(0);
  1419. +         case CBRA:
  1420. +             regex_braslist[*ep++] = lp;
  1421. +             continue;
  1422. +         case CKET:
  1423. +             regex_braelist[*ep++] = lp;
  1424. +             continue;
  1425. +         case CBACK:
  1426. +             if (regex_braelist[i = *ep++] == 0)
  1427. +                 return(-1);
  1428. +             if (backref(i, lp)) {
  1429. +                 lp += regex_braelist[i] - regex_braslist[i];
  1430. +                 continue;
  1431. +             }
  1432. +             return(0);
  1433. +         case CBACK|CSTAR:
  1434. +             if (regex_braelist[i = *ep++] == 0)
  1435. +                 return(-1);
  1436. +             curlp = lp;
  1437. +             ct = regex_braelist[i] - regex_braslist[i];
  1438. +             while (backref(i, lp))
  1439. +                 lp += ct;
  1440. +             while (lp >= curlp) {
  1441. +                 if (rv = advance(lp, ep))
  1442. +                     return(rv);
  1443. +                 lp -= ct;
  1444. +             }
  1445. +             continue;
  1446. +         case CDOT|CSTAR:
  1447. +             curlp = lp;
  1448. +             while (*lp++)
  1449. +                 ;
  1450. +             goto star;
  1451. +         case CCHR|CSTAR:
  1452. +             curlp = lp;
  1453. +             while (*lp++ == *ep)
  1454. +                 ;
  1455. +             ep++;
  1456. +             goto star;
  1457. +         case CCL|CSTAR:
  1458. +         case NCCL|CSTAR:
  1459. +             curlp = lp;
  1460. +             while (cclass(ep, *lp++, ep[-1] == (CCL|CSTAR)))
  1461. +                 ;
  1462. +             ep += *ep;
  1463. +             goto star;
  1464. +         star:
  1465. +             do {
  1466. +                 lp--;
  1467. +                 if (rv = advance(lp, ep))
  1468. +                     return(rv);
  1469. +             } while (lp > curlp);
  1470. +             return(0);
  1471. +         default:
  1472. +             return(-1);
  1473. +         }
  1474. + }
  1475. + static
  1476. + backref(i, lp)
  1477. +     register int    i;
  1478. +     register char    *lp;
  1479. + {
  1480. +     register char    *bp;
  1481. +     bp = regex_braslist[i];
  1482. +     while (*bp++ == *lp++)
  1483. +         if (bp >= regex_braelist[i])
  1484. +             return(1);
  1485. +     return(0);
  1486. + }
  1487. + static int
  1488. + cclass(set, c, af)
  1489. +     register char    *set, c;
  1490. +     int    af;
  1491. + {
  1492. +     register int    n;
  1493. +     if (c == 0)
  1494. +         return(0);
  1495. +     n = *set++;
  1496. +     while (--n)
  1497. +         if (*set++ == c)
  1498. +             return(af);
  1499. +     return(! af);
  1500. + }
  1501. -- 
  1502. Eric Schnoebelen        eric@cirr.com         schnoebe@convex.com
  1503.         Q: What is small and yellow and very dangerous?
  1504.         A: A canary with the super-user password!
  1505.