home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2862 / Patch next >
Text File  |  1991-02-27  |  18KB  |  585 lines

  1. *** ../../usenet-mkid/src/MANIFEST    Tue Feb 26 10:40:46 1991
  2. --- MANIFEST    Tue Feb 26 10:07:10 1991
  3. ***************
  4. *** 1,52 ****
  5.      File Name        Archive #    Description
  6.   -----------------------------------------------------------
  7.    MANIFEST                   1    This shipping list
  8. !  Makefile                   5    
  9. !  Status                     2    
  10.    TODO                       1    
  11. !  TUTORIAL                   8    
  12.    basename.c                 1    
  13.    bitcount.c                 1    
  14.    bitops.c                   1    
  15.    bitops.h                   1    
  16. !  bitsvec.c                  2    
  17.    bool.h                     1    
  18.    bsearch.c                  1    
  19.    bzero.c                    1    
  20. !  cannoname.c                3    
  21.    document.c                 1    
  22.    extern.h                   1    
  23.    fid.1                      1    
  24. !  fid.c                      2    
  25.    gets0.c                    1    
  26.    getsFF.c                   1    
  27. !  getscan.c                  6    
  28.    gid.el                     1    
  29. !  hash.c                     2    
  30. !  id.h                       2    
  31.    idx.c                      1    
  32. !  iid.1                      4    
  33. !  iid.help                   3    
  34. !  iid.y                      7    
  35. !  iiddef.h                   5    
  36. !  iidfun.c                   9    
  37.    init.c                     1    
  38. !  kshgetwd.c                 2    
  39. !  lid.1                      4    
  40. !  lid.c                     11    
  41. !  mkid.1                     4    
  42. !  mkid.c                    10    
  43.    numtst.c                   1    
  44. !  opensrc.c                  2    
  45.    patchlevel.h               1    
  46. !  paths.c                    3    
  47.    radix.h                    1    
  48. !  scan-asm.c                 5    
  49. !  scan-c.c                   6    
  50. !  scan-text.c                3    
  51. !  stoi.c                     2    
  52.    string.h                   1    
  53. !  symfunc.el                 3    
  54.    tty.c                      1    
  55.    uerror.c                   1    
  56.    unsymlink.c                2    
  57. --- 1,54 ----
  58.      File Name        Archive #    Description
  59.   -----------------------------------------------------------
  60.    MANIFEST                   1    This shipping list
  61. !  Makefile                   3    
  62. !  README                     1    
  63. !  Status                     1    
  64.    TODO                       1    
  65. !  TUTORIAL                   4    
  66.    basename.c                 1    
  67.    bitcount.c                 1    
  68.    bitops.c                   1    
  69.    bitops.h                   1    
  70. !  bitsvec.c                  1    
  71.    bool.h                     1    
  72.    bsearch.c                  1    
  73.    bzero.c                    1    
  74. !  cannoname.c                2    
  75.    document.c                 1    
  76.    extern.h                   1    
  77.    fid.1                      1    
  78. !  fid.c                      1    
  79.    gets0.c                    1    
  80.    getsFF.c                   1    
  81. !  getscan.c                  3    
  82.    gid.el                     1    
  83. !  hash.c                     1    
  84. !  id.h                       1    
  85. !  id.texinfo                 7    
  86.    idx.c                      1    
  87. !  iid.1                      2    
  88. !  iid.help                   2    
  89. !  iid.y                      4    
  90. !  iiddef.h                   3    
  91. !  iidfun.c                   5    
  92.    init.c                     1    
  93. !  kshgetwd.c                 1    
  94. !  lid.1                      3    
  95. !  lid.c                      6    
  96. !  mkid.1                     2    
  97. !  mkid.c                     5    
  98.    numtst.c                   1    
  99. !  opensrc.c                  1    
  100.    patchlevel.h               1    
  101. !  paths.c                    2    
  102.    radix.h                    1    
  103. !  scan-asm.c                 3    
  104. !  scan-c.c                   4    
  105. !  scan-text.c                2    
  106. !  stoi.c                     1    
  107.    string.h                   1    
  108. !  symfunc.el                 2    
  109.    tty.c                      1    
  110.    uerror.c                   1    
  111.    unsymlink.c                2    
  112. *** ../../usenet-mkid/src/Makefile    Tue Feb 26 10:41:33 1991
  113. --- Makefile    Tue Feb 26 10:08:09 1991
  114. ***************
  115. *** 30,35 ****
  116. --- 30,43 ----
  117.   #
  118.   # * If you have ranlib(1), define `RANLIB' as such.  If you don't have
  119.   #   it, set `RANLIB' to something harmless like `@:', or `echo'
  120. + #
  121. + # * If you want lists of file names compressed with csh {} notation by
  122. + #   default, set -DCRUNCH_DEFAULT=1. If you want files printed with no
  123. + #   "crunching", set -DCRUNCH_DEFAULT=0. (The -k and -g options allow
  124. + #   runtime control regardless of the builtin default).
  125. + #
  126. + # * If your system supports the alloca() function for allocating space
  127. + #   on the stack, defined -DUSE_ALLOCA
  128.   # --------------------------------------------------------------------
  129.   
  130.   DEFS    =    -Dvoid=int -DREGEX -DTERMIO    # typical System-V defs
  131. ***************
  132. *** 45,50 ****
  133. --- 53,64 ----
  134.   RANLIB    =    @:    # system doesn't have ranlib (Sys-V)
  135.   # RANLIB    =    ranlib    # system has ranlib (typically V7 & BSD)
  136.   
  137. + CRUNCH  =       -DCRUNCH_DEFAULT=1      # Original default - crunch file names
  138. + #CRUNCH =       -DCRUNCH_DEFAULT=0      # Don't crunch names by default
  139. + ALLOCA  =       -DUSE_ALLOCA            # alloca support exists on system
  140. + #ALLOCA =                               # system has no alloca() function
  141.   # --------------------------------------------------------------------
  142.   # Compilation / Loading options:
  143.   #   Choose options to generate a system as an installed product,
  144. ***************
  145. *** 70,76 ****
  146.   MANDIR =        /usr/catman/local_man/man1
  147.   
  148.   LIDLINKS =     gid aid eid pid
  149. ! CFLAGS =    $(CCFLG) -I. $(DEFS)
  150.   LDFLAGS =    $(LDFLG) libid.a $(LIBS)
  151.   
  152.   OFILES =    init.o getscan.o scan-c.o scan-asm.o bsearch.o hash.o \
  153. --- 84,90 ----
  154.   MANDIR =        /usr/catman/local_man/man1
  155.   
  156.   LIDLINKS =     gid aid eid pid
  157. ! CFLAGS =    $(CCFLG) -I. $(DEFS) $(CRUNCH) $(ALLOCA)
  158.   LDFLAGS =    $(LDFLG) libid.a $(LIBS)
  159.   
  160.   OFILES =    init.o getscan.o scan-c.o scan-asm.o bsearch.o hash.o \
  161. ***************
  162. *** 78,83 ****
  163. --- 92,100 ----
  164.           stoi.o uerror.o document.o bitcount.o wmatch.o bitsvec.o \
  165.           tty.o bzero.o scan-text.o cannoname.o kshgetwd.o unsymlink.o
  166.   
  167. + TEXJUNK=id.aux id.cp id.cps id.dvi id.fn id.fns id.ky id.kys id.log id.pg \
  168. +     id.pgs id.toc id.tp id.tps id.vr id.vrs id-info
  169.   # --------------------------------------------------------------------
  170.   
  171.   all:        $(TARGETS)
  172. ***************
  173. *** 153,159 ****
  174.           ln $(DESTINATION_DIR)/lid $(DESTINATION_DIR)/pid
  175.   
  176.   clean:
  177. !         rm -f $(TARGETS) *.o iid.c core a.out
  178.   
  179.   id.tar:
  180.           cd ..; tar cvbf 20 id/id.tar id/*.[ch1-8] id/makefile id/TODO id/TUTORIAL
  181. --- 170,176 ----
  182.           ln $(DESTINATION_DIR)/lid $(DESTINATION_DIR)/pid
  183.   
  184.   clean:
  185. !         rm -f $(TARGETS) *.o iid.c core a.out $(TEXJUNK)
  186.   
  187.   id.tar:
  188.           cd ..; tar cvbf 20 id/id.tar id/*.[ch1-8] id/makefile id/TODO id/TUTORIAL
  189. ***************
  190. *** 175,188 ****
  191.   debug:
  192.       make CCFLG='-g -DDEBUG' LDFLG='-g'
  193.   
  194. ! ID:
  195. !     rm -f ../TOOLS/ID ../EXEC/ID ../SRC/ID
  196. !     cd ../TOOLS ; find ../SRC -name '*.[ch]' -print | mkid -v -
  197. !     ln ../TOOLS/ID ../EXEC/ID
  198. !     ln ../TOOLS/ID ../SRC/ID
  199.   
  200. ! TAGS:
  201. !     rm -f ../TOOLS/TAGS ../EXEC/TAGS ../SRC/TAGS
  202. !     cd ../TOOLS ; find ../SRC -name '*.[ch]' -print | etags -twS
  203. !     ln ../TOOLS/TAGS ../EXEC/TAGS
  204. !     ln ../TOOLS/TAGS ../SRC/TAGS
  205. --- 192,233 ----
  206.   debug:
  207.       make CCFLG='-g -DDEBUG' LDFLG='-g'
  208.   
  209. ! ID::
  210. !     /bin/rm -f ID
  211. !     mkid *.[chy]
  212.   
  213. ! TAGS::
  214. !     /bin/rm -f TAGS
  215. !     etags -tw *.[chy]
  216. ! # TeX stuff - these actions count on several things being installed on
  217. ! # your system:
  218. ! #
  219. ! # tex - the document processor
  220. ! # texinfo.tex - the texinfo macro package used to format the document
  221. ! # texindex - the index sorting program used to generate the index
  222. ! # makeinfo - the program to turn texinfo files into online documentation
  223. ! #
  224. ! # A tex distribution tape can be obtained from the University of Washington.
  225. ! # send email to: elisabet@max.u.washington.edu for more info.
  226. ! #
  227. ! # The other texinfo tools are part of the Gnuemacs distribution and can
  228. ! # be obtained via FTP from prep.ai.mit.edu
  229. ! # Make the online info file by running makeinfo - texinfo-format-buffer from
  230. ! # within emacs probably will not work very well.
  231. ! id-info: id.texinfo
  232. !     makeinfo id.texinfo
  233. ! # If you are running TeX from a clean directory, need to run once to get
  234. ! # the initial .aux file with the cross reference info in it.
  235. ! id.aux: id.texinfo
  236. !     tex id.texinfo
  237. !     texindex id.??
  238. ! # Running TeX twice here is probably overkill, but it makes absolutely sure
  239. ! # the index agrees with the actual location of text.
  240. ! id.dvi: id.aux
  241. !     tex id.texinfo
  242. !     texindex id.??
  243. !     tex id.texinfo
  244. *** ../../usenet-mkid/src/Status    Tue Feb 26 10:41:11 1991
  245. --- Status    Tue Feb 26 10:07:12 1991
  246. ***************
  247. *** 1,30 ****
  248. ! This is the mkid package originally posted to the net around September of
  249. ! 1987 by Greg McGary (who then vanished from the net). Since then I have been
  250. ! extensively hacking it, and so have others. In an effort to have all of us
  251. ! benefit from the modifications and improvements we all have made, I have
  252. ! (probably foolishly :-) volunteered to "take over" mkid.
  253.   
  254. ! To get the ball rolling, I am posting this version to alt.sources, and I
  255. ! expect people to send me their patches. I will merge them all and eventually
  256. ! post an "official" version to comp.sources.unix.
  257.   
  258. ! I know there are probably portability problems with this version of the
  259. ! source, I have some stuff in here that references functions you only have if
  260. ! your system supports symbolic links, etc, so it will need to have some
  261. ! config parameters and ifdef code added for sure.
  262.   
  263. ! Anyway, keep those patches rolling in...
  264.   
  265. ! ======================================================================
  266. ! domain: tahorsley@csd.harris.com       USMail: Tom Horsley
  267. !   uucp: ...!uunet!hcx1!tahorsley               511 Kingbird Circle
  268. !                                                Delray Beach, FL  33444
  269. ! +==== Censorship is the only form of Obscenity ======================+
  270. ! |     (Wait, I forgot government tobacco subsidies...)               |
  271. ! +====================================================================+
  272.   
  273. ! P.S.
  274.   
  275. !    The TUTORIAL has not been changed since 1987, so a lot of stuff is not
  276. !    well documented. This situation also need to improve prior to the
  277. !    official release.
  278. --- 1,31 ----
  279. ! In the original alt.sources posting, this file started off:
  280.   
  281. !    This is the mkid package originally posted to the net around September of
  282. !    1987 by Greg McGary (who then vanished from the net). Since then I have been
  283. !    extensively hacking it, and so have others. In an effort to have all of us
  284. !    benefit from the modifications and improvements we all have made, I have
  285. !    (probably foolishly :-) volunteered to "take over" mkid.
  286.   
  287. ! Since then, Greg has revealed that he is still alive and on the net, and
  288. ! he apparently has lots of plans for mkid revisions (but not much time to
  289. ! do them -- a situation we are probably all familiar with).
  290.   
  291. ! Anyway, after I post this version to comp.sources.unix, I will probably
  292. ! let Greg take over as the official maintainer.
  293.   
  294. ! This version contains some cleanup work done since the alt.sources posting
  295. ! (but no major changes). It also comes with a brand new id.texinfo file
  296. ! containing the latest and greatest documentation for the tools (Note: I have
  297. ! no plans to upgrade the man pages, the texinfo doc is the only place where
  298. ! the latest and greatest options are documented right now).
  299.   
  300. ! This is the final posting to alt.sources. It contains the patches to upgrade
  301. ! the original alt.sources posting to what I now have. If a few days go past
  302. ! with no additional bugs cropping up, I will send it all off to
  303. ! comp.sources.unix.
  304.   
  305. ! You can reach me (Tom Horsley) at:
  306. !    tahorsley@csd.harris.com or ...!uunet!hcx1!tahorsley
  307. ! The email address I have for Greg McGary is:
  308. !    gm@blip.wsrcc.com or ...!uunet!wsrcc!blip!gm
  309. *** ../../usenet-mkid/src/cannoname.c    Tue Feb 26 10:41:20 1991
  310. --- cannoname.c    Tue Feb 26 10:07:55 1991
  311. ***************
  312. *** 106,112 ****
  313.      }
  314.      *cad++ = NULL ;
  315.   
  316. !    /* find multiple // and use last slash as root */
  317.      s = NULL ;
  318.      cap = &components[0] ;
  319.      cad = cap ;
  320. --- 106,115 ----
  321.      }
  322.      *cad++ = NULL ;
  323.   
  324. !    /* find multiple // and use last slash as root, except on apollo which
  325. !     * apparently actually uses // in real file names (don't ask me why).
  326. !     */
  327. ! #ifndef apollo
  328.      s = NULL ;
  329.      cap = &components[0] ;
  330.      cad = cap ;
  331. ***************
  332. *** 118,123 ****
  333. --- 121,127 ----
  334.         *cad++ = s;
  335.      }
  336.      *cad = NULL ;
  337. + #endif
  338.   
  339.      /* if this is absolute name get rid of any /.. at beginning */
  340.      if ((components[0] == &slash[0]) && (components[1] == &dotdot[0])) {
  341. *** ../../usenet-mkid/src/iidfun.c    Tue Feb 26 10:41:56 1991
  342. --- iidfun.c    Tue Feb 26 10:08:34 1991
  343. ***************
  344. *** 2,8 ****
  345. --- 2,29 ----
  346.    */
  347.   
  348.   #include "iiddef.h"
  349. + #ifdef USE_ALLOCA
  350.   
  351. + /* Apparently Sun's need the following to work correctly */
  352. + #ifdef sun
  353. + #include <alloca.h>
  354. + #endif /* sun */
  355. + /* Define TEMP_ALLOC to call alloca, and TEMP_FREE to do nothing */
  356. + #define TEMP_ALLOC(s) alloca(s)
  357. + #define TEMP_FREE(s)
  358. + #else
  359. + /* Not using alloca() (not everyone has it) - define TEMP_ALLOC to call
  360. +  * malloc() and TEMP_FREE to call free().
  361. +  */
  362. + #define TEMP_ALLOC(s) malloc(s)
  363. + #define TEMP_FREE(s)  free(s)
  364. + #endif /* USE_ALLOCA */
  365.   /* ArgListSize - count the size of an arg list so can alloca() enough
  366.    * space for the command.
  367.    */
  368. ***************
  369. *** 358,367 ****
  370.      char *     pp ;
  371.      set_type * sp ;
  372.   {
  373. !    char *         cmd = (char *)alloca(SetListSize(sp) + strlen(pp) + 2);
  374.      int            i ;
  375.      id_type *      idep ;
  376.      
  377.      strcpy(cmd, pp) ;
  378.      for (i = 0; i < NextFileNum; ++i) {
  379.         if (FileList[i]->mask_word < sp->set_size) {
  380. --- 379,389 ----
  381.      char *     pp ;
  382.      set_type * sp ;
  383.   {
  384. !    char *         cmd ;
  385.      int            i ;
  386.      id_type *      idep ;
  387.      
  388. +    cmd = (char *)TEMP_ALLOC(SetListSize(sp) + strlen(pp) + 2);
  389.      strcpy(cmd, pp) ;
  390.      for (i = 0; i < NextFileNum; ++i) {
  391.         if (FileList[i]->mask_word < sp->set_size) {
  392. ***************
  393. *** 372,377 ****
  394. --- 394,400 ----
  395.         }
  396.      }
  397.      system(cmd) ;
  398. +    TEMP_FREE(cmd) ;
  399.   }
  400.   
  401.   /* AddSet - add a new set to the universal list of sets. Assign
  402. ***************
  403. *** 409,415 ****
  404.      id_list_type * idlp ;
  405.   {
  406.      int            c ;
  407. !    char *         cmd = (char *)alloca(ArgListSize(idlp) + strlen(pp) + 2);
  408.      char *         dp ;
  409.      char           file [ MAXCMD ] ;
  410.      int            i ;
  411. --- 432,438 ----
  412.      id_list_type * idlp ;
  413.   {
  414.      int            c ;
  415. !    char *         cmd ;
  416.      char *         dp ;
  417.      char           file [ MAXCMD ] ;
  418.      int            i ;
  419. ***************
  420. *** 418,423 ****
  421. --- 441,447 ----
  422.      FILE *         prog ;
  423.      set_type *     sp ;
  424.      
  425. +    cmd = (char *)TEMP_ALLOC(ArgListSize(idlp) + strlen(pp) + 2);
  426.      FlushFiles() ;
  427.      strcpy(cmd, pp) ;
  428.      idep = idlp->id_list ;
  429. ***************
  430. *** 473,478 ****
  431. --- 497,503 ----
  432.         sp->set_data[i] = TheFiles[i] ;
  433.      }
  434.      AddSet(sp) ;
  435. +    TEMP_FREE(cmd);
  436.      return(sp) ;
  437.   }
  438.   
  439. ***************
  440. *** 640,649 ****
  441.      char *         pp ;
  442.      id_list_type * idlp ;
  443.   {
  444. !    char *         cmd = (char *)alloca(ArgListSize(idlp) + strlen(pp) + 2);
  445.      id_type *      idep ;
  446.      id_type *      next_id ;
  447.      
  448.      strcpy(cmd, pp) ;
  449.      idep = idlp->id_list ;
  450.      while (idep != NULL) {
  451. --- 665,675 ----
  452.      char *         pp ;
  453.      id_list_type * idlp ;
  454.   {
  455. !    char *         cmd ;
  456.      id_type *      idep ;
  457.      id_type *      next_id ;
  458.      
  459. +    cmd = (char *)TEMP_ALLOC(ArgListSize(idlp) + strlen(pp) + 2);
  460.      strcpy(cmd, pp) ;
  461.      idep = idlp->id_list ;
  462.      while (idep != NULL) {
  463. ***************
  464. *** 655,658 ****
  465. --- 681,685 ----
  466.      }
  467.      free(idlp) ;
  468.      system(cmd) ;
  469. +    TEMP_FREE(cmd);
  470.   }
  471. *** ../../usenet-mkid/src/lid.c    Tue Feb 26 10:42:02 1991
  472. --- lid.c    Tue Feb 26 10:08:40 1991
  473. ***************
  474. *** 47,52 ****
  475. --- 47,56 ----
  476.   #define    TOLOWER(c)    (isupper(c) ? tolower(c) : (c))
  477.   #endif
  478.   
  479. + #ifndef CRUNCH_DEFAULT
  480. + #define CRUNCH_DEFAULT TRUE
  481. + #endif
  482.   /*
  483.   *  Sorry about all the globals, but it's really cleaner this way.
  484.   */
  485. ***************
  486. *** 54,60 ****
  487.   bool        Merging;
  488.   bool        Radix;
  489.   bool            EchoOn = TRUE;
  490. ! bool            CrunchOn = TRUE;
  491.   bool        pathRegExp = FALSE;
  492.   bool        matchBase = FALSE;
  493.   char        IdDir[BUFSIZ];
  494. --- 58,64 ----
  495.   bool        Merging;
  496.   bool        Radix;
  497.   bool            EchoOn = TRUE;
  498. ! bool            CrunchOn = CRUNCH_DEFAULT;
  499.   bool        pathRegExp = FALSE;
  500.   bool        matchBase = FALSE;
  501.   char        IdDir[BUFSIZ];
  502. ***************
  503. *** 122,127 ****
  504. --- 126,132 ----
  505.           case 'a': Radix |= RADIX_ALL; break;
  506.           case 's': Solo = op; break;
  507.           case 'k': CrunchOn = FALSE; break;
  508. +         case 'g': CrunchOn = TRUE; break;
  509.           case 'n': EchoOn = FALSE; break;
  510.           case 'c': useIDpath = FALSE; usePWDpath = TRUE; break;
  511.           case 'b': matchBase = TRUE; break;
  512. ***************
  513. *** 870,877 ****
  514.           if (!BITTST(bitArray, i))
  515.               continue;
  516.           if (idArgs->ida_flags & IDA_BLANK) {
  517. !             printf("BOTCH: blank index!\n");
  518. !             abort();
  519.           }
  520.           if (!(idArgs->ida_flags & IDA_ADJUST)) {
  521.               absname = spanPath(IdDir, idArgs->ida_arg);
  522. --- 875,881 ----
  523.           if (!BITTST(bitArray, i))
  524.               continue;
  525.           if (idArgs->ida_flags & IDA_BLANK) {
  526. !             continue;
  527.           }
  528.           if (!(idArgs->ida_flags & IDA_ADJUST)) {
  529.               absname = spanPath(IdDir, idArgs->ida_arg);
  530. *** ../../usenet-mkid/src/mkid.c    Tue Feb 26 10:42:00 1991
  531. --- mkid.c    Tue Feb 26 10:08:35 1991
  532. ***************
  533. *** 11,16 ****
  534. --- 11,17 ----
  535.   #include    <bitops.h>
  536.   #include    <errno.h>
  537.   #include    <extern.h>
  538. + #include        "patchlevel.h"
  539.   
  540.   int idnHashCmp();
  541.   int idnQsortCmp();
  542. ***************
  543. *** 251,258 ****
  544.       if (HashFill == 0)
  545.           exit(0);
  546.   
  547. !     if (Verbose)
  548.           fprintf(stderr, "Compressing Hash Table...\n");
  549.       hashCompress(HashTable, HashSize);
  550.       if (Verbose)
  551.           fprintf(stderr, "Sorting Hash Table...\n");
  552. --- 252,261 ----
  553.       if (HashFill == 0)
  554.           exit(0);
  555.   
  556. !     if (Verbose) {
  557. !         fprintf(stderr, "mkid patchlevel %d:\n", PATCHLEVEL);
  558.           fprintf(stderr, "Compressing Hash Table...\n");
  559. +     }
  560.       hashCompress(HashTable, HashSize);
  561.       if (Verbose)
  562.           fprintf(stderr, "Sorting Hash Table...\n");
  563. *** ../../usenet-mkid/src/patchlevel.h    Tue Feb 26 10:41:04 1991
  564. --- patchlevel.h    Tue Feb 26 10:07:47 1991
  565. ***************
  566. *** 1 ****
  567. ! #define PATCHLEVEL 1
  568. --- 1 ----
  569. ! #define PATCHLEVEL 2
  570.