home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / gnuish / find12.arc / patches < prev    next >
Text File  |  1990-09-23  |  25KB  |  905 lines

  1. *** e:\tmp/RCSt1006483    Sun Sep 23 19:07:16 1990
  2. --- fastfind.c    Sun Sep 23 19:05:48 1990
  3. ***************
  4. *** 25,30 ****
  5. --- 25,31 ----
  6.   
  7.      Author: James A. Woods (jaw@riacs.edu)
  8.      Modified by David MacKenzie (djm@ai.mit.edu)
  9. +    MS-DOS mods: Thorsten Ohl (td12@ddagsi3.bitnet)
  10.      Public domain. */
  11.   
  12.   #include <stdio.h>
  13. ***************
  14. *** 36,42 ****
  15. --- 37,45 ----
  16.   #define rindex strrchr
  17.   #endif
  18.   #include <sys/types.h>
  19. + #ifndef MSDOS
  20.   #include <sys/param.h>
  21. + #endif /* MSDOS */
  22.   
  23.   #ifndef MAXPATHLEN
  24.   #define MAXPATHLEN 1024
  25. ***************
  26. *** 49,54 ****
  27. --- 52,67 ----
  28.   
  29.   #define    ESCCODE    30
  30.   
  31. + #ifdef MSDOS
  32. + #include <stdlib.h>
  33. + #include <gnulib.h>
  34. + char *patprep (char *name);
  35. + void fastfind (char *pathpart);
  36. + #else /* not MSDOS */
  37.   extern int errno;
  38.   
  39.   char *index ();
  40. ***************
  41. *** 55,60 ****
  42. --- 68,75 ----
  43.   char *patprep ();
  44.   void error ();
  45.   
  46. + #endif /* not MSDOS */
  47.   void
  48.   fastfind (pathpart)
  49.        char *pathpart;
  50. ***************
  51. *** 184,189 ****
  52. --- 199,207 ----
  53.     int optind;
  54.   
  55.     program_name = argv[0];
  56. + #ifdef MSDOS            /* cosmetics  */
  57. +   strlwr (program_name);
  58. + #endif
  59.   
  60.     if (argc == 1)
  61.       {
  62. *** e:\tmp/RCSt1006483    Sun Sep 23 19:07:18 1990
  63. --- filemode.c    Sun Sep 23 19:05:48 1990
  64. ***************
  65. *** 14,19 ****
  66. --- 14,31 ----
  67.      You should have received a copy of the GNU General Public License
  68.      along with this program; if not, write to the Free Software
  69.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  70. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  71. +    This port is also distributed under the terms of the
  72. +    GNU General Public License as published by the
  73. +    Free Software Foundation.
  74. +    Please note that this file is not identical to the
  75. +    original GNU release, you should have received this
  76. +    code as patch to the official release.
  77. +    $Header: e:/gnu/find/RCS/filemode.c 1.2.0.3 90/09/23 16:09:36 tho Exp $
  78. +  */
  79.   
  80.   #include <sys/types.h>
  81.   #include <sys/stat.h>
  82. ***************
  83. *** 23,32 ****
  84. --- 35,52 ----
  85.   #define S_IEXEC S_IXUSR
  86.   #endif
  87.   
  88. + #ifdef MSDOS
  89. + extern    void filemodestring (struct stat *statp, char *str);
  90. + extern    void mode_string (unsigned short mode, char *str);
  91. + static    char ftypelet (unsigned short bits);
  92. + static    void rwx (unsigned short bits, char *chars);
  93. + static    void setst (unsigned short bits, char *chars);
  94. + #else /* not MSDOS */
  95.   void mode_string ();
  96.   static char ftypelet ();
  97.   static void rwx ();
  98.   static void setst ();
  99. + #endif /* not MSDOS */
  100.   
  101.   /* filemodestring - fill in string STR with an ls-style ASCII
  102.      representation of the st_mode field of file stats block STATP.
  103. *** e:\tmp/RCSt1006483    Sun Sep 23 19:07:20 1990
  104. --- find.c    Sun Sep 23 19:05:50 1990
  105. ***************
  106. *** 18,23 ****
  107. --- 18,35 ----
  108.   /* GNU find was written by Eric Decker (cire@cisco.com),
  109.      with enhancements by David MacKenzie (djm@ai.mit.edu). */
  110.   
  111. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  112. +    This port is also distributed under the terms of the
  113. +    GNU General Public License as published by the
  114. +    Free Software Foundation.
  115. +    Please note that this file is not identical to the
  116. +    original GNU release, you should have received this
  117. +    code as patch to the official release.
  118. +    $Header: e:/gnu/find/RCS/find.c 1.2.0.3 90/09/23 16:09:38 tho Exp $
  119. +  */
  120.   /* Usage: find path... [expression]
  121.   
  122.      Predicates:
  123. ***************
  124. *** 139,145 ****
  125. --- 151,161 ----
  126.        char *argv[];
  127.   {
  128.     int i;
  129. + #ifdef MSDOS
  130. +   PARSE_FCT parse_function;
  131. + #else
  132.     PFB parse_function;        /* Pointer to who is to do the parsing. */
  133. + #endif
  134.     struct pred_struct *cur_pred;
  135.     char *predicate_name;        /* Name of predicate being parsed. */
  136.   
  137. ***************
  138. *** 283,288 ****
  139. --- 299,308 ----
  140.   
  141.         if (!strcmp (pathname, "/"))
  142.           pathname_len = 2;    /* Won't add a slash to this. */
  143. + #ifdef MSDOS
  144. +       else if (!strcmp (pathname + 1, ":/"))
  145. +         pathname_len = 4;    /* Won't add a slash to this either. */
  146. + #endif /* MSDOS */
  147.         else
  148.           pathname_len = strlen (pathname) + 2; /* For '/' and '\0'. */
  149.         cur_path_size = 0;
  150. *** e:\tmp/RCSt1006483    Sun Sep 23 19:07:22 1990
  151. --- listfile.c    Sun Sep 23 19:05:52 1990
  152. ***************
  153. *** 15,35 ****
  154. --- 15,66 ----
  155.      along with this program; if not, write to the Free Software
  156.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  157.   
  158. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  159. +    This port is also distributed under the terms of the
  160. +    GNU General Public License as published by the
  161. +    Free Software Foundation.
  162. +    Please note that this file is not identical to the
  163. +    original GNU release, you should have received this
  164. +    code as patch to the official release.
  165. +    $Header: e:/gnu/find/RCS/listfile.c 1.2.0.3 90/09/23 16:09:41 tho Exp $
  166. +  */
  167.   #include <stdio.h>
  168.   #include <sys/types.h>
  169.   #include <sys/stat.h>
  170.   #include <pwd.h>
  171. + #ifndef MSDOS
  172.   struct passwd *getpwuid ();
  173.   #include <grp.h>
  174.   struct group *getgrgid ();
  175.   #include <time.h>
  176. + #endif /* not MSDOS */
  177.   #ifdef USG
  178. + #ifdef MSDOS
  179. + #define minor(n) (n)
  180. + #define major(n) (n)
  181. + #else /* not MSDOS */
  182.   #include <sys/sysmacros.h>
  183. + #endif /* not MSDOS */
  184.   #include <string.h>
  185.   #else
  186.   #include <strings.h>
  187.   #endif
  188.   
  189. + #ifdef MSDOS
  190. + #include <time.h>
  191. + extern void list_file (char *name, struct stat *statp);
  192. + extern char *xmalloc (unsigned n);
  193. + extern void mode_string (unsigned short mode, char *str);
  194. + extern char *copystring (char *string);
  195. + extern void print_name_with_quoting (char *p);
  196. + extern char *getuser (int uid);
  197. + extern char *getgroup (int gid);
  198. + #endif /* MSDOS */
  199.   extern int errno;
  200.   
  201.   long time ();
  202. ***************
  203. *** 69,74 ****
  204. --- 100,116 ----
  205.       }
  206.     timebuf[16] = 0;
  207.   
  208. + #ifdef MSDOS            /* poor MS-DOS has no inodes, links, etc. . */
  209. +   printf ("%s ", modebuf);
  210. +   if ((statp->st_mode & S_IFMT) == S_IFCHR)
  211. +     printf ("%3u, %3u ", major (statp->st_rdev), minor (statp->st_rdev));
  212. +   else
  213. +     printf ("%8lu ", statp->st_size);
  214. + #else /* not MSDOS */
  215.     printf ("%6u ", statp->st_ino);
  216.   
  217.     /* The space between the mode and the number of links is the POSIX
  218. ***************
  219. *** 84,89 ****
  220. --- 126,133 ----
  221.       printf ("%3u, %3u ", major (statp->st_rdev), minor (statp->st_rdev));
  222.     else
  223.       printf ("%8lu ", statp->st_size);
  224. + #endif /* MSDOS */
  225.   
  226.     printf ("%s ", timebuf + 4);
  227.   
  228. *** e:\tmp/RCSt1006483    Sun Sep 23 19:07:24 1990
  229. --- modechan.c    Sun Sep 23 19:05:54 1990
  230. ***************
  231. *** 17,22 ****
  232. --- 17,34 ----
  233.   
  234.   /* Written by David MacKenzie <djm@ai.mit.edu> */
  235.   
  236. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  237. +    This port is also distributed under the terms of the
  238. +    GNU General Public License as published by the
  239. +    Free Software Foundation.
  240. +    Please note that this file is not identical to the
  241. +    original GNU release, you should have received this
  242. +    code as patch to the official release.
  243. +    $Header: e:/gnu/find/RCS/modechan.c 1.2.0.3 90/09/23 16:09:43 tho Exp $
  244. +  */
  245.   /* The ASCII mode string is compiled into a linked list of `struct
  246.      modechange', which can then be applied to each file to be changed.
  247.      We do this instead of re-parsing the ASCII string for each file
  248. ***************
  249. *** 37,42 ****
  250. --- 49,60 ----
  251.   #define NULL 0
  252.   #endif
  253.   #endif
  254. + #ifdef MSDOS
  255. + #include <stdio.h>
  256. + #include <io.h>
  257. + static    int oatoi (char *s);
  258. + #endif /* MSDOS */
  259.   
  260.   /* Return newly allocated memory to hold one element of type TYPE. */
  261.   #define talloc(type) ((type *) malloc (sizeof (type)))
  262. *** e:\tmp/RCSt1006483    Sun Sep 23 19:07:26 1990
  263. --- parser.c    Sun Sep 23 19:05:56 1990
  264. ***************
  265. *** 15,25 ****
  266. --- 15,39 ----
  267.      along with this program; if not, write to the Free Software
  268.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  269.   
  270. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  271. +    This port is also distributed under the terms of the
  272. +    GNU General Public License as published by the
  273. +    Free Software Foundation.
  274. +    Please note that this file is not identical to the
  275. +    original GNU release, you should have received this
  276. +    code as patch to the official release.
  277. +    $Header: e:/gnu/find/RCS/parser.c 1.2.0.3 90/09/23 16:09:45 tho Exp $
  278. +  */
  279.   #include <stdio.h>
  280.   #include <sys/types.h>
  281.   #include <sys/stat.h>
  282.   #include <pwd.h>
  283. + #ifndef MSDOS
  284.   #include <grp.h>
  285. + #endif /* not MSDOS */
  286.   #include <time.h>
  287.   #ifndef USG
  288.   #include <strings.h>
  289. ***************
  290. *** 35,40 ****
  291. --- 49,86 ----
  292.   #define lstat stat
  293.   #endif
  294.   
  295. + #ifdef MSDOS
  296. + static boolean parse_atime (PARSE_ARGS);
  297. + static boolean parse_ctime (PARSE_ARGS);
  298. + static boolean parse_depth (PARSE_ARGS);
  299. + static boolean parse_exec (PARSE_ARGS);
  300. + static boolean parse_fulldays (PARSE_ARGS);
  301. + static boolean parse_fstype (PARSE_ARGS);
  302. + static boolean parse_group (PARSE_ARGS);
  303. + static boolean parse_inum (PARSE_ARGS);
  304. + static boolean parse_links (PARSE_ARGS);
  305. + static boolean parse_ls (PARSE_ARGS);
  306. + static boolean parse_mtime (PARSE_ARGS);
  307. + static boolean parse_name (PARSE_ARGS);
  308. + static boolean parse_negate (PARSE_ARGS);
  309. + static boolean parse_newer (PARSE_ARGS);
  310. + static boolean parse_nogroup (PARSE_ARGS);
  311. + static boolean parse_nouser (PARSE_ARGS);
  312. + static boolean parse_ok (PARSE_ARGS);
  313. + static boolean parse_or (PARSE_ARGS);
  314. + static boolean parse_perm (PARSE_ARGS);
  315. + static boolean parse_permmask (PARSE_ARGS);
  316. + static boolean parse_prune (PARSE_ARGS);
  317. + static boolean parse_regex (PARSE_ARGS);
  318. + static boolean parse_size (PARSE_ARGS);
  319. + static boolean parse_type (PARSE_ARGS);
  320. + static boolean parse_user (PARSE_ARGS);
  321. + static boolean parse_version (PARSE_ARGS);
  322. + static boolean parse_xdev (PARSE_ARGS);
  323. + #else /* not MSDOS */
  324.   /* no parse_and */
  325.   boolean parse_atime ();
  326.   boolean parse_close ();
  327. ***************
  328. *** 99,104 ****
  329. --- 145,152 ----
  330.   /* no pred_version */
  331.   /* no pred_xdev */
  332.   
  333. + #endif /* not MSDOS */
  334.   long atol ();
  335.   struct group *getgrnam ();
  336.   struct passwd *getpwnam ();
  337. ***************
  338. *** 120,126 ****
  339. --- 168,178 ----
  340.   struct parser_table_t
  341.   {
  342.     char *parser_name;
  343. + #ifdef MSDOS
  344. +   PARSE_FCT parser_func;
  345. + #else
  346.     PFB parser_func;
  347. + #endif
  348.   };
  349.   
  350.   struct parser_table_t parse_table[] =
  351. ***************
  352. *** 172,178 ****
  353. --- 224,235 ----
  354.      SEARCH_NAME.
  355.      Return NULL if SEARCH_NAME is not a valid predicate name. */
  356.   
  357. + #ifdef MSDOS
  358. + PARSE_FCT
  359. + #else
  360.   PFB
  361. + #endif
  362.   find_parser (search_name)
  363.        char *search_name;
  364.   {
  365. ***************
  366. *** 562,568 ****
  367. --- 619,629 ----
  368.       xmalloc (sizeof (struct re_pattern_buffer));
  369.     our_pred->args.regex = re;
  370.     re->allocated = 100;
  371. + #ifdef MSDOS
  372. +   re->buffer = xmalloc ((size_t) re->allocated);
  373. + #else /* not MSDOS */
  374.     re->buffer = xmalloc (re->allocated);
  375. + #endif /* not MSDOS */
  376.     re->fastmap = NULL;
  377.     re->translate = NULL;
  378.     error_message = re_compile_pattern (argv[*arg_ptr], strlen (argv[*arg_ptr]),
  379. ***************
  380. *** 635,643 ****
  381. --- 696,706 ----
  382.       return (false);
  383.     switch (argv[*arg_ptr][0])
  384.       {
  385. + #ifdef S_IFBLK
  386.       case 'b':            /* block special */
  387.         type_cell = S_IFBLK;
  388.         break;
  389. + #endif
  390.       case 'c':            /* character special */
  391.         type_cell = S_IFCHR;
  392.         break;
  393. ***************
  394. *** 843,849 ****
  395. --- 906,916 ----
  396.   insert_time (argv, arg_ptr, pred)
  397.        char *argv[];
  398.        int *arg_ptr;
  399. + #ifdef MSDOS
  400. +      PRED_FCT pred;
  401. + #else
  402.        PFB pred;
  403. + #endif
  404.   {
  405.     struct pred_struct *our_pred;
  406.     unsigned long num_days;
  407. ***************
  408. *** 951,957 ****
  409. --- 1018,1028 ----
  410.   insert_num (argv, arg_ptr, pred)
  411.        char *argv[];
  412.        int *arg_ptr;
  413. + #ifdef MSDOS
  414. +      PRED_FCT pred;
  415. + #else
  416.        PFB pred;
  417. + #endif
  418.   {
  419.     struct pred_struct *our_pred;
  420.     unsigned long num;
  421. *** e:\tmp/RCSt1006483    Sun Sep 23 19:07:30 1990
  422. --- pred.c    Sun Sep 23 19:06:00 1990
  423. ***************
  424. *** 15,27 ****
  425. --- 15,41 ----
  426.      along with this program; if not, write to the Free Software
  427.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  428.   
  429. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  430. +    This port is also distributed under the terms of the
  431. +    GNU General Public License as published by the
  432. +    Free Software Foundation.
  433. +    Please note that this file is not identical to the
  434. +    original GNU release, you should have received this
  435. +    code as patch to the official release.
  436. +    $Header: e:/gnu/find/RCS/pred.c 1.2.0.3 90/09/23 16:09:50 tho Exp $
  437. +  */
  438.   #include <stdio.h>
  439.   #include <sys/types.h>
  440.   #include <sys/stat.h>
  441.   #include <pwd.h>
  442. + #ifndef MSDOS
  443.   struct passwd *getpwuid ();
  444.   #include <grp.h>
  445.   struct group *getgrgid ();
  446. + #endif /* not MSDOS */
  447.   #ifndef USG
  448.   #include <strings.h>
  449.   #else
  450. ***************
  451. *** 31,36 ****
  452. --- 45,65 ----
  453.   #endif
  454.   #include "defs.h"
  455.   
  456. + #ifdef MSDOS
  457. + #include <time.h>
  458. + #include <process.h>
  459. + extern void error (int status, int errnum, char *message, ...);
  460. + extern char *basename (char *fname);
  461. + extern char *filesystem_type (struct stat *statp);
  462. + extern void list_file (char *name, struct stat *statp);
  463. + extern int glob_match (char *pattern, char *text, int dot_special);
  464. + static char launch (struct pred_struct *pred_ptr);
  465. + #else /* not MSDOS */
  466.   int fork ();
  467.   int wait ();
  468.   
  469. ***************
  470. *** 71,80 ****
  471. --- 100,115 ----
  472.   char *filesystem_type ();
  473.   void list_file ();
  474.   
  475. + #endif /* not MSDOS */
  476.   #ifdef    DEBUG
  477.   struct pred_assoc
  478.   {
  479. + #ifdef MSDOS
  480. +   PRED_FCT pred_func;
  481. + #else
  482.     PFB pred_func;
  483. + #endif
  484.     char *pred_name;
  485.   };
  486.   
  487. ***************
  488. *** 600,605 ****
  489. --- 635,647 ----
  490.         zero, and the exit arg (status high) is 0.
  491.         Otherwise return false, possibly printing an error message. */
  492.   
  493. + #ifdef MSDOS
  494. +   status = spawnvp (P_WAIT, pred_ptr->args.exec_vec.vec[0],\
  495. +             pred_ptr->args.exec_vec.vec);
  496. + #else /* not MSDOS */
  497.     child_pid = fork ();
  498.     if (child_pid == -1)
  499.       error (1, errno, "cannot fork");
  500. ***************
  501. *** 631,636 ****
  502. --- 673,681 ----
  503.         exit_status = 1;
  504.         return (false);
  505.       }
  506. + #endif /* not MSDOS */
  507.     if (status & 0xff != 0)
  508.       {
  509.         error (0, 0, "child terminated abnormally; status %d %d",
  510. ***************
  511. *** 647,653 ****
  512. --- 692,702 ----
  513.   
  514.   char *
  515.   find_pred_name (pred_func)
  516. + #ifdef MSDOS
  517. +      PRED_FCT pred_func;
  518. + #else
  519.        PFB pred_func;
  520. + #endif
  521.   {
  522.     int i;
  523.   
  524. *** e:\tmp/RCSt1006483    Sun Sep 23 19:07:32 1990
  525. --- savedir.c    Sun Sep 23 19:06:00 1990
  526. ***************
  527. *** 17,23 ****
  528. --- 17,42 ----
  529.   
  530.   /* Written by David MacKenzie <djm@ai.mit.edu>. */
  531.   
  532. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  533. +    This port is also distributed under the terms of the
  534. +    GNU General Public License as published by the
  535. +    Free Software Foundation.
  536. +    Please note that this file is not identical to the
  537. +    original GNU release, you should have received this
  538. +    code as patch to the official release.
  539. +    $Header: e:/gnu/find/RCS/savedir.c 1.2.0.3 90/09/23 16:09:55 tho Exp $
  540. +  */
  541.   #include <sys/types.h>
  542. + #ifdef MSDOS
  543. + #include <stdio.h>
  544. + extern char *savedir (char *dir, unsigned int name_size);
  545. + extern char *stpcpy (char *dest, char *source);
  546. + #endif /* MSDOS */
  547.   #ifdef DIRENT
  548.   #include <dirent.h>
  549.   #define direct dirent
  550. ***************
  551. *** 69,74 ****
  552. --- 88,100 ----
  553.     dirp = opendir (dir);
  554.     if (dirp == NULL)
  555.       return NULL;
  556. + #ifdef MSDOS            /* We have to stat() it ourselves ... */
  557. +   name_size = 0L;
  558. +   for (dp = readdir (dirp); dp != NULL; dp = readdir (dirp))
  559. +     name_size += strlen (dp->d_name) + 1;
  560. +   seekdir (dirp, 0L);
  561. + #endif /* MSDOS */
  562.   
  563.     name_space = (char *) malloc (name_size);
  564.     if (name_space == NULL)
  565. *** e:\tmp/RCSt1006483    Sun Sep 23 19:07:32 1990
  566. --- tree.c    Sun Sep 23 19:06:02 1990
  567. ***************
  568. *** 15,25 ****
  569. --- 15,42 ----
  570.      along with this program; if not, write to the Free Software
  571.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  572.   
  573. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  574. +    This port is also distributed under the terms of the
  575. +    GNU General Public License as published by the
  576. +    Free Software Foundation.
  577. +    Please note that this file is not identical to the
  578. +    original GNU release, you should have received this
  579. +    code as patch to the official release.
  580. +    $Header: e:/gnu/find/RCS/tree.c 1.2.0.3 90/09/23 16:09:57 tho Exp $
  581. +  */
  582.   #include <stdio.h>
  583.   #include <sys/types.h>
  584.   #include "defs.h"
  585.   
  586. + #ifdef MSDOS
  587. + struct pred_struct *scan_rest (struct pred_struct **input,\
  588. +                    struct pred_struct *head, short prev_prec);
  589. + #else /* not MSDOS */
  590.   struct pred_struct *scan_rest ();
  591. + #endif /* not MSDOS */
  592.   
  593.   
  594.   /* Return a pointer to a tree that represents the
  595. *** e:\tmp/RCSt1006483    Sun Sep 23 19:07:34 1990
  596. --- util.c    Sun Sep 23 19:06:02 1990
  597. ***************
  598. *** 15,20 ****
  599. --- 15,32 ----
  600.      along with this program; if not, write to the Free Software
  601.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  602.   
  603. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  604. +    This port is also distributed under the terms of the
  605. +    GNU General Public License as published by the
  606. +    Free Software Foundation.
  607. +    Please note that this file is not identical to the
  608. +    original GNU release, you should have received this
  609. +    code as patch to the official release.
  610. +    $Header: e:/gnu/find/RCS/util.c 1.2.0.3 90/09/23 16:10:02 tho Exp $
  611. +  */
  612.   #include <stdio.h>
  613.   #include <sys/types.h>
  614.   #ifndef USG
  615. ***************
  616. *** 25,30 ****
  617. --- 37,46 ----
  618.   #define rindex strrchr
  619.   #endif
  620.   #include "defs.h"
  621. + #ifdef MSDOS
  622. + extern char *basename (char *fname);
  623. + #endif /* MSDOS */
  624.   
  625.   char *find_pred_name ();
  626.   boolean pred_and ();
  627. *** e:\tmp/RCSt1006483    Sun Sep 23 19:07:36 1990
  628. --- version.c    Sun Sep 23 19:06:04 1990
  629. ***************
  630. *** 15,18 ****
  631. --- 15,33 ----
  632.      along with this program; if not, write to the Free Software
  633.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  634.   
  635. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  636. +    This port is also distributed under the terms of the
  637. +    GNU General Public License as published by the
  638. +    Free Software Foundation.
  639. +    Please note that this file is not identical to the
  640. +    original GNU release, you should have received this
  641. +    code as patch to the official release.  */
  642. + #ifdef MSDOS
  643. + char *version_string =
  644. +   "GNU find version 1.2  (compiled " __DATE__ " " __TIME__ " for MS-DOS)\n";
  645. + #else
  646.   char *version_string = "GNU find version 1.2\n";
  647. + #endif
  648. *** e:\tmp/RCSt1006483    Sun Sep 23 19:07:36 1990
  649. --- defs.h    Sun Sep 23 19:06:06 1990
  650. ***************
  651. *** 15,20 ****
  652. --- 15,32 ----
  653.      along with this program; if not, write to the Free Software
  654.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  655.   
  656. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  657. +    This port is also distributed under the terms of the
  658. +    GNU General Public License as published by the
  659. +    Free Software Foundation.
  660. +    Please note that this file is not identical to the
  661. +    original GNU release, you should have received this
  662. +    code as patch to the official release.
  663. +    $Header: e:/gnu/find/RCS/defs.h 1.2.0.3 90/09/23 16:10:04 tho Exp $
  664. +  */
  665.   #include "regex.h"
  666.   
  667.   typedef char boolean;
  668. ***************
  669. *** 21,26 ****
  670. --- 33,112 ----
  671.   #define        true    1
  672.   #define        false    0
  673.   
  674. + #ifdef MSDOS
  675. + #define PARSE_ARGS \
  676. +   char **argv, int *arg_ptr
  677. + #define PRED_ARGS \
  678. +   char *pathname, struct stat *stat_buf, struct pred_struct *pred_ptr
  679. + /* Pointer to function returning boolean. */
  680. + typedef boolean (*PRED_FCT) (PRED_ARGS);
  681. + typedef boolean (*PARSE_FCT) (PARSE_ARGS);
  682. + #include <stdio.h>
  683. + #include <stdlib.h>
  684. + #include <time.h>
  685. + extern struct pred_struct *get_new_pred (void);
  686. + extern struct pred_struct *get_new_pred_chk_op (void);
  687. + extern struct pred_struct *insert_victim (char (*pred_func)());
  688. + extern char *xmalloc (unsigned int n);
  689. + extern void usage (char *msg);
  690. + extern void error (int status, int errnum, char *message, ...);
  691. + extern PARSE_FCT find_parser (char *search_name);
  692. + extern char no_side_effects (struct pred_struct *pred);
  693. + extern boolean parse_close (PARSE_ARGS);
  694. + extern boolean parse_open (PARSE_ARGS);
  695. + extern boolean parse_print (PARSE_ARGS);
  696. + extern boolean pred_and (PRED_ARGS);
  697. + extern boolean pred_atime (PRED_ARGS);
  698. + extern boolean pred_close (PRED_ARGS);
  699. + extern boolean pred_ctime (PRED_ARGS);
  700. + extern boolean pred_exec (PRED_ARGS);
  701. + extern boolean pred_fstype (PRED_ARGS);
  702. + extern boolean pred_group (PRED_ARGS);
  703. + extern boolean pred_inum (PRED_ARGS);
  704. + extern boolean pred_links (PRED_ARGS);
  705. + extern boolean pred_ls (PRED_ARGS);
  706. + extern boolean pred_mtime (PRED_ARGS);
  707. + extern boolean pred_name (PRED_ARGS);
  708. + extern boolean pred_negate (PRED_ARGS);
  709. + extern boolean pred_newer (PRED_ARGS);
  710. + extern boolean pred_nogroup (PRED_ARGS);
  711. + extern boolean pred_nouser (PRED_ARGS);
  712. + extern boolean pred_ok (PRED_ARGS);
  713. + extern boolean pred_open (PRED_ARGS);
  714. + extern boolean pred_or (PRED_ARGS);
  715. + extern boolean pred_perm (PRED_ARGS);
  716. + extern boolean pred_permmask (PRED_ARGS);
  717. + extern boolean pred_print (PRED_ARGS);
  718. + extern boolean pred_prune (PRED_ARGS);
  719. + extern boolean pred_regex (PRED_ARGS);
  720. + extern boolean pred_size (PRED_ARGS);
  721. + extern boolean pred_type (PRED_ARGS);
  722. + extern boolean pred_user (PRED_ARGS);
  723. + extern boolean insert_exec_ok (boolean (*func) (), PARSE_ARGS);
  724. + extern boolean get_num_days (char *str, unsigned long *num_days,
  725. +                  enum comparison_type *comp_type);
  726. + extern boolean insert_time (PARSE_ARGS, PRED_FCT pred);
  727. + extern boolean get_num (char *str, unsigned long *num, short *comp_type);
  728. + extern boolean insert_num (PARSE_ARGS, PRED_FCT pred);
  729. + extern void read_mtab (void);
  730. + struct pred_struct *get_expr (struct pred_struct **input, short prev_prec);
  731. + extern void process_path (char *pathname, char root);
  732. + extern void main (int argc, char **argv);
  733. + extern char *savedir (char *dir, unsigned int name_size);
  734. + #else /* not MSDOS */
  735.   /* Pointer to function returning boolean. */
  736.   typedef boolean (*PFB)();
  737.   
  738. ***************
  739. *** 43,48 ****
  740. --- 129,136 ----
  741.   void usage ();
  742.   void process_path ();
  743.   
  744. + #endif /* not MSDOS */
  745.   #ifdef    DEBUG
  746.   void print_tree ();
  747.   void print_list ();
  748. ***************
  749. *** 98,104 ****
  750. --- 186,196 ----
  751.   struct pred_struct
  752.   {
  753.     /* Pointer to the function that implements this predicate.  */
  754. + #ifdef MSDOS
  755. +   PRED_FCT pred_func;
  756. + #else
  757.     PFB pred_func;
  758. + #endif
  759.   #ifdef    DEBUG
  760.     char *p_name;
  761.   #endif
  762. ***************
  763. *** 148,154 ****
  764. --- 240,248 ----
  765.   /* The number of bytes in a block for -size. */
  766.   #define        BLKSIZE        512
  767.   
  768. + #ifndef MSDOS            /* errno is declared `volatile'! */
  769.   extern int errno;
  770. + #endif
  771.   
  772.   extern char *program_name;
  773.   extern struct pred_struct *predicates;
  774. *** e:\tmp/RCSt1006483    Sun Sep 23 19:07:40 1990
  775. --- lib/bigram.c    Sun Sep 23 19:06:44 1990
  776. ***************
  777. *** 6,16 ****
  778. --- 6,25 ----
  779.   
  780.      Author: James A. Woods (jaw@riacs.edu)
  781.      Modified by David MacKenzie (djm@ai.mit.edu)
  782. +    MS-DOS mods: Thorsten Ohl (td12@ddagsi3.bitnet)
  783.      Public domain. */
  784.   
  785.   #include <stdio.h>
  786.   #include <sys/types.h>
  787. + #ifdef MSDOS
  788. + #include <stdlib.h>
  789. + #include <string.h>
  790. + int prefix_length (char *s1, char *s2);
  791. + void main (void);
  792. + #else /* not MSDOS */
  793.   #include <sys/param.h>
  794. + #endif /* not MSDOS */
  795.   
  796.   #ifndef MAXPATHLEN
  797.   #define MAXPATHLEN 1024
  798. *** e:\tmp/RCSt1006483    Sun Sep 23 19:07:40 1990
  799. --- lib/code.c    Sun Sep 23 19:06:52 1990
  800. ***************
  801. *** 22,32 ****
  802. --- 22,42 ----
  803.   
  804.      Author: James A. Woods (jaw@riacs.edu)
  805.      Modified by David MacKenzie (djm@ai.mit.edu)
  806. +    MS-DOS mods: Thorsten Ohl (td12@ddagsi3.bitnet)
  807.      Public domain. */
  808.   
  809.   #include <stdio.h>
  810.   #include <sys/types.h>
  811. + #ifdef MSDOS
  812. + #include <stdlib.h>
  813. + #include <string.h>
  814. + void main (int argc, char **argv);
  815. + int prefix_length (char *s1, char *s2);
  816. + int strindex (char *string, char *pattern);
  817. + #else /* not MSDOS */
  818.   #include <sys/param.h>
  819. + #endif /* not MSDOS */
  820.   
  821.   #ifndef MAXPATHLEN
  822.   #define MAXPATHLEN 1024
  823.