home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 June
/
SIMTEL_0692.cdr
/
msdos
/
gnuish
/
find12.arc
/
patches
< prev
next >
Wrap
Text File
|
1990-09-23
|
25KB
|
905 lines
*** e:\tmp/RCSt1006483 Sun Sep 23 19:07:16 1990
--- fastfind.c Sun Sep 23 19:05:48 1990
***************
*** 25,30 ****
--- 25,31 ----
Author: James A. Woods (jaw@riacs.edu)
Modified by David MacKenzie (djm@ai.mit.edu)
+ MS-DOS mods: Thorsten Ohl (td12@ddagsi3.bitnet)
Public domain. */
#include <stdio.h>
***************
*** 36,42 ****
--- 37,45 ----
#define rindex strrchr
#endif
#include <sys/types.h>
+ #ifndef MSDOS
#include <sys/param.h>
+ #endif /* MSDOS */
#ifndef MAXPATHLEN
#define MAXPATHLEN 1024
***************
*** 49,54 ****
--- 52,67 ----
#define ESCCODE 30
+ #ifdef MSDOS
+
+ #include <stdlib.h>
+
+ #include <gnulib.h>
+ char *patprep (char *name);
+ void fastfind (char *pathpart);
+
+ #else /* not MSDOS */
+
extern int errno;
char *index ();
***************
*** 55,60 ****
--- 68,75 ----
char *patprep ();
void error ();
+ #endif /* not MSDOS */
+
void
fastfind (pathpart)
char *pathpart;
***************
*** 184,189 ****
--- 199,207 ----
int optind;
program_name = argv[0];
+ #ifdef MSDOS /* cosmetics */
+ strlwr (program_name);
+ #endif
if (argc == 1)
{
*** e:\tmp/RCSt1006483 Sun Sep 23 19:07:18 1990
--- filemode.c Sun Sep 23 19:05:48 1990
***************
*** 14,19 ****
--- 14,31 ----
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+ /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ This port is also distributed under the terms of the
+ GNU General Public License as published by the
+ Free Software Foundation.
+
+ Please note that this file is not identical to the
+ original GNU release, you should have received this
+ code as patch to the official release.
+
+ $Header: e:/gnu/find/RCS/filemode.c 1.2.0.3 90/09/23 16:09:36 tho Exp $
+ */
#include <sys/types.h>
#include <sys/stat.h>
***************
*** 23,32 ****
--- 35,52 ----
#define S_IEXEC S_IXUSR
#endif
+ #ifdef MSDOS
+ extern void filemodestring (struct stat *statp, char *str);
+ extern void mode_string (unsigned short mode, char *str);
+ static char ftypelet (unsigned short bits);
+ static void rwx (unsigned short bits, char *chars);
+ static void setst (unsigned short bits, char *chars);
+ #else /* not MSDOS */
void mode_string ();
static char ftypelet ();
static void rwx ();
static void setst ();
+ #endif /* not MSDOS */
/* filemodestring - fill in string STR with an ls-style ASCII
representation of the st_mode field of file stats block STATP.
*** e:\tmp/RCSt1006483 Sun Sep 23 19:07:20 1990
--- find.c Sun Sep 23 19:05:50 1990
***************
*** 18,23 ****
--- 18,35 ----
/* GNU find was written by Eric Decker (cire@cisco.com),
with enhancements by David MacKenzie (djm@ai.mit.edu). */
+ /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ This port is also distributed under the terms of the
+ GNU General Public License as published by the
+ Free Software Foundation.
+
+ Please note that this file is not identical to the
+ original GNU release, you should have received this
+ code as patch to the official release.
+
+ $Header: e:/gnu/find/RCS/find.c 1.2.0.3 90/09/23 16:09:38 tho Exp $
+ */
+
/* Usage: find path... [expression]
Predicates:
***************
*** 139,145 ****
--- 151,161 ----
char *argv[];
{
int i;
+ #ifdef MSDOS
+ PARSE_FCT parse_function;
+ #else
PFB parse_function; /* Pointer to who is to do the parsing. */
+ #endif
struct pred_struct *cur_pred;
char *predicate_name; /* Name of predicate being parsed. */
***************
*** 283,288 ****
--- 299,308 ----
if (!strcmp (pathname, "/"))
pathname_len = 2; /* Won't add a slash to this. */
+ #ifdef MSDOS
+ else if (!strcmp (pathname + 1, ":/"))
+ pathname_len = 4; /* Won't add a slash to this either. */
+ #endif /* MSDOS */
else
pathname_len = strlen (pathname) + 2; /* For '/' and '\0'. */
cur_path_size = 0;
*** e:\tmp/RCSt1006483 Sun Sep 23 19:07:22 1990
--- listfile.c Sun Sep 23 19:05:52 1990
***************
*** 15,35 ****
--- 15,66 ----
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ This port is also distributed under the terms of the
+ GNU General Public License as published by the
+ Free Software Foundation.
+
+ Please note that this file is not identical to the
+ original GNU release, you should have received this
+ code as patch to the official release.
+
+ $Header: e:/gnu/find/RCS/listfile.c 1.2.0.3 90/09/23 16:09:41 tho Exp $
+ */
+
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <pwd.h>
+ #ifndef MSDOS
struct passwd *getpwuid ();
#include <grp.h>
struct group *getgrgid ();
#include <time.h>
+ #endif /* not MSDOS */
#ifdef USG
+ #ifdef MSDOS
+ #define minor(n) (n)
+ #define major(n) (n)
+ #else /* not MSDOS */
#include <sys/sysmacros.h>
+ #endif /* not MSDOS */
#include <string.h>
#else
#include <strings.h>
#endif
+ #ifdef MSDOS
+ #include <time.h>
+
+ extern void list_file (char *name, struct stat *statp);
+ extern char *xmalloc (unsigned n);
+ extern void mode_string (unsigned short mode, char *str);
+ extern char *copystring (char *string);
+ extern void print_name_with_quoting (char *p);
+ extern char *getuser (int uid);
+ extern char *getgroup (int gid);
+ #endif /* MSDOS */
+
extern int errno;
long time ();
***************
*** 69,74 ****
--- 100,116 ----
}
timebuf[16] = 0;
+ #ifdef MSDOS /* poor MS-DOS has no inodes, links, etc. . */
+
+ printf ("%s ", modebuf);
+
+ if ((statp->st_mode & S_IFMT) == S_IFCHR)
+ printf ("%3u, %3u ", major (statp->st_rdev), minor (statp->st_rdev));
+ else
+ printf ("%8lu ", statp->st_size);
+
+ #else /* not MSDOS */
+
printf ("%6u ", statp->st_ino);
/* The space between the mode and the number of links is the POSIX
***************
*** 84,89 ****
--- 126,133 ----
printf ("%3u, %3u ", major (statp->st_rdev), minor (statp->st_rdev));
else
printf ("%8lu ", statp->st_size);
+
+ #endif /* MSDOS */
printf ("%s ", timebuf + 4);
*** e:\tmp/RCSt1006483 Sun Sep 23 19:07:24 1990
--- modechan.c Sun Sep 23 19:05:54 1990
***************
*** 17,22 ****
--- 17,34 ----
/* Written by David MacKenzie <djm@ai.mit.edu> */
+ /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ This port is also distributed under the terms of the
+ GNU General Public License as published by the
+ Free Software Foundation.
+
+ Please note that this file is not identical to the
+ original GNU release, you should have received this
+ code as patch to the official release.
+
+ $Header: e:/gnu/find/RCS/modechan.c 1.2.0.3 90/09/23 16:09:43 tho Exp $
+ */
+
/* The ASCII mode string is compiled into a linked list of `struct
modechange', which can then be applied to each file to be changed.
We do this instead of re-parsing the ASCII string for each file
***************
*** 37,42 ****
--- 49,60 ----
#define NULL 0
#endif
#endif
+
+ #ifdef MSDOS
+ #include <stdio.h>
+ #include <io.h>
+ static int oatoi (char *s);
+ #endif /* MSDOS */
/* Return newly allocated memory to hold one element of type TYPE. */
#define talloc(type) ((type *) malloc (sizeof (type)))
*** e:\tmp/RCSt1006483 Sun Sep 23 19:07:26 1990
--- parser.c Sun Sep 23 19:05:56 1990
***************
*** 15,25 ****
--- 15,39 ----
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ This port is also distributed under the terms of the
+ GNU General Public License as published by the
+ Free Software Foundation.
+
+ Please note that this file is not identical to the
+ original GNU release, you should have received this
+ code as patch to the official release.
+
+ $Header: e:/gnu/find/RCS/parser.c 1.2.0.3 90/09/23 16:09:45 tho Exp $
+ */
+
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <pwd.h>
+ #ifndef MSDOS
#include <grp.h>
+ #endif /* not MSDOS */
#include <time.h>
#ifndef USG
#include <strings.h>
***************
*** 35,40 ****
--- 49,86 ----
#define lstat stat
#endif
+ #ifdef MSDOS
+
+ static boolean parse_atime (PARSE_ARGS);
+ static boolean parse_ctime (PARSE_ARGS);
+ static boolean parse_depth (PARSE_ARGS);
+ static boolean parse_exec (PARSE_ARGS);
+ static boolean parse_fulldays (PARSE_ARGS);
+ static boolean parse_fstype (PARSE_ARGS);
+ static boolean parse_group (PARSE_ARGS);
+ static boolean parse_inum (PARSE_ARGS);
+ static boolean parse_links (PARSE_ARGS);
+ static boolean parse_ls (PARSE_ARGS);
+ static boolean parse_mtime (PARSE_ARGS);
+ static boolean parse_name (PARSE_ARGS);
+ static boolean parse_negate (PARSE_ARGS);
+ static boolean parse_newer (PARSE_ARGS);
+ static boolean parse_nogroup (PARSE_ARGS);
+ static boolean parse_nouser (PARSE_ARGS);
+ static boolean parse_ok (PARSE_ARGS);
+ static boolean parse_or (PARSE_ARGS);
+ static boolean parse_perm (PARSE_ARGS);
+ static boolean parse_permmask (PARSE_ARGS);
+ static boolean parse_prune (PARSE_ARGS);
+ static boolean parse_regex (PARSE_ARGS);
+ static boolean parse_size (PARSE_ARGS);
+ static boolean parse_type (PARSE_ARGS);
+ static boolean parse_user (PARSE_ARGS);
+ static boolean parse_version (PARSE_ARGS);
+ static boolean parse_xdev (PARSE_ARGS);
+
+ #else /* not MSDOS */
+
/* no parse_and */
boolean parse_atime ();
boolean parse_close ();
***************
*** 99,104 ****
--- 145,152 ----
/* no pred_version */
/* no pred_xdev */
+ #endif /* not MSDOS */
+
long atol ();
struct group *getgrnam ();
struct passwd *getpwnam ();
***************
*** 120,126 ****
--- 168,178 ----
struct parser_table_t
{
char *parser_name;
+ #ifdef MSDOS
+ PARSE_FCT parser_func;
+ #else
PFB parser_func;
+ #endif
};
struct parser_table_t parse_table[] =
***************
*** 172,178 ****
--- 224,235 ----
SEARCH_NAME.
Return NULL if SEARCH_NAME is not a valid predicate name. */
+
+ #ifdef MSDOS
+ PARSE_FCT
+ #else
PFB
+ #endif
find_parser (search_name)
char *search_name;
{
***************
*** 562,568 ****
--- 619,629 ----
xmalloc (sizeof (struct re_pattern_buffer));
our_pred->args.regex = re;
re->allocated = 100;
+ #ifdef MSDOS
+ re->buffer = xmalloc ((size_t) re->allocated);
+ #else /* not MSDOS */
re->buffer = xmalloc (re->allocated);
+ #endif /* not MSDOS */
re->fastmap = NULL;
re->translate = NULL;
error_message = re_compile_pattern (argv[*arg_ptr], strlen (argv[*arg_ptr]),
***************
*** 635,643 ****
--- 696,706 ----
return (false);
switch (argv[*arg_ptr][0])
{
+ #ifdef S_IFBLK
case 'b': /* block special */
type_cell = S_IFBLK;
break;
+ #endif
case 'c': /* character special */
type_cell = S_IFCHR;
break;
***************
*** 843,849 ****
--- 906,916 ----
insert_time (argv, arg_ptr, pred)
char *argv[];
int *arg_ptr;
+ #ifdef MSDOS
+ PRED_FCT pred;
+ #else
PFB pred;
+ #endif
{
struct pred_struct *our_pred;
unsigned long num_days;
***************
*** 951,957 ****
--- 1018,1028 ----
insert_num (argv, arg_ptr, pred)
char *argv[];
int *arg_ptr;
+ #ifdef MSDOS
+ PRED_FCT pred;
+ #else
PFB pred;
+ #endif
{
struct pred_struct *our_pred;
unsigned long num;
*** e:\tmp/RCSt1006483 Sun Sep 23 19:07:30 1990
--- pred.c Sun Sep 23 19:06:00 1990
***************
*** 15,27 ****
--- 15,41 ----
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ This port is also distributed under the terms of the
+ GNU General Public License as published by the
+ Free Software Foundation.
+
+ Please note that this file is not identical to the
+ original GNU release, you should have received this
+ code as patch to the official release.
+
+ $Header: e:/gnu/find/RCS/pred.c 1.2.0.3 90/09/23 16:09:50 tho Exp $
+ */
+
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <pwd.h>
+ #ifndef MSDOS
struct passwd *getpwuid ();
#include <grp.h>
struct group *getgrgid ();
+ #endif /* not MSDOS */
#ifndef USG
#include <strings.h>
#else
***************
*** 31,36 ****
--- 45,65 ----
#endif
#include "defs.h"
+ #ifdef MSDOS
+
+ #include <time.h>
+ #include <process.h>
+
+ extern void error (int status, int errnum, char *message, ...);
+ extern char *basename (char *fname);
+ extern char *filesystem_type (struct stat *statp);
+ extern void list_file (char *name, struct stat *statp);
+ extern int glob_match (char *pattern, char *text, int dot_special);
+
+ static char launch (struct pred_struct *pred_ptr);
+
+ #else /* not MSDOS */
+
int fork ();
int wait ();
***************
*** 71,80 ****
--- 100,115 ----
char *filesystem_type ();
void list_file ();
+ #endif /* not MSDOS */
+
#ifdef DEBUG
struct pred_assoc
{
+ #ifdef MSDOS
+ PRED_FCT pred_func;
+ #else
PFB pred_func;
+ #endif
char *pred_name;
};
***************
*** 600,605 ****
--- 635,647 ----
zero, and the exit arg (status high) is 0.
Otherwise return false, possibly printing an error message. */
+ #ifdef MSDOS
+
+ status = spawnvp (P_WAIT, pred_ptr->args.exec_vec.vec[0],\
+ pred_ptr->args.exec_vec.vec);
+
+ #else /* not MSDOS */
+
child_pid = fork ();
if (child_pid == -1)
error (1, errno, "cannot fork");
***************
*** 631,636 ****
--- 673,681 ----
exit_status = 1;
return (false);
}
+
+ #endif /* not MSDOS */
+
if (status & 0xff != 0)
{
error (0, 0, "child terminated abnormally; status %d %d",
***************
*** 647,653 ****
--- 692,702 ----
char *
find_pred_name (pred_func)
+ #ifdef MSDOS
+ PRED_FCT pred_func;
+ #else
PFB pred_func;
+ #endif
{
int i;
*** e:\tmp/RCSt1006483 Sun Sep 23 19:07:32 1990
--- savedir.c Sun Sep 23 19:06:00 1990
***************
*** 17,23 ****
--- 17,42 ----
/* Written by David MacKenzie <djm@ai.mit.edu>. */
+ /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ This port is also distributed under the terms of the
+ GNU General Public License as published by the
+ Free Software Foundation.
+
+ Please note that this file is not identical to the
+ original GNU release, you should have received this
+ code as patch to the official release.
+
+ $Header: e:/gnu/find/RCS/savedir.c 1.2.0.3 90/09/23 16:09:55 tho Exp $
+ */
+
#include <sys/types.h>
+
+ #ifdef MSDOS
+ #include <stdio.h>
+ extern char *savedir (char *dir, unsigned int name_size);
+ extern char *stpcpy (char *dest, char *source);
+ #endif /* MSDOS */
+
#ifdef DIRENT
#include <dirent.h>
#define direct dirent
***************
*** 69,74 ****
--- 88,100 ----
dirp = opendir (dir);
if (dirp == NULL)
return NULL;
+
+ #ifdef MSDOS /* We have to stat() it ourselves ... */
+ name_size = 0L;
+ for (dp = readdir (dirp); dp != NULL; dp = readdir (dirp))
+ name_size += strlen (dp->d_name) + 1;
+ seekdir (dirp, 0L);
+ #endif /* MSDOS */
name_space = (char *) malloc (name_size);
if (name_space == NULL)
*** e:\tmp/RCSt1006483 Sun Sep 23 19:07:32 1990
--- tree.c Sun Sep 23 19:06:02 1990
***************
*** 15,25 ****
--- 15,42 ----
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ This port is also distributed under the terms of the
+ GNU General Public License as published by the
+ Free Software Foundation.
+
+ Please note that this file is not identical to the
+ original GNU release, you should have received this
+ code as patch to the official release.
+
+ $Header: e:/gnu/find/RCS/tree.c 1.2.0.3 90/09/23 16:09:57 tho Exp $
+ */
+
#include <stdio.h>
#include <sys/types.h>
#include "defs.h"
+ #ifdef MSDOS
+ struct pred_struct *scan_rest (struct pred_struct **input,\
+ struct pred_struct *head, short prev_prec);
+ #else /* not MSDOS */
struct pred_struct *scan_rest ();
+ #endif /* not MSDOS */
/* Return a pointer to a tree that represents the
*** e:\tmp/RCSt1006483 Sun Sep 23 19:07:34 1990
--- util.c Sun Sep 23 19:06:02 1990
***************
*** 15,20 ****
--- 15,32 ----
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ This port is also distributed under the terms of the
+ GNU General Public License as published by the
+ Free Software Foundation.
+
+ Please note that this file is not identical to the
+ original GNU release, you should have received this
+ code as patch to the official release.
+
+ $Header: e:/gnu/find/RCS/util.c 1.2.0.3 90/09/23 16:10:02 tho Exp $
+ */
+
#include <stdio.h>
#include <sys/types.h>
#ifndef USG
***************
*** 25,30 ****
--- 37,46 ----
#define rindex strrchr
#endif
#include "defs.h"
+
+ #ifdef MSDOS
+ extern char *basename (char *fname);
+ #endif /* MSDOS */
char *find_pred_name ();
boolean pred_and ();
*** e:\tmp/RCSt1006483 Sun Sep 23 19:07:36 1990
--- version.c Sun Sep 23 19:06:04 1990
***************
*** 15,18 ****
--- 15,33 ----
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ This port is also distributed under the terms of the
+ GNU General Public License as published by the
+ Free Software Foundation.
+
+ Please note that this file is not identical to the
+ original GNU release, you should have received this
+ code as patch to the official release. */
+
+ #ifdef MSDOS
+ char *version_string =
+ "GNU find version 1.2 (compiled " __DATE__ " " __TIME__ " for MS-DOS)\n";
+ #else
char *version_string = "GNU find version 1.2\n";
+ #endif
+
*** e:\tmp/RCSt1006483 Sun Sep 23 19:07:36 1990
--- defs.h Sun Sep 23 19:06:06 1990
***************
*** 15,20 ****
--- 15,32 ----
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ This port is also distributed under the terms of the
+ GNU General Public License as published by the
+ Free Software Foundation.
+
+ Please note that this file is not identical to the
+ original GNU release, you should have received this
+ code as patch to the official release.
+
+ $Header: e:/gnu/find/RCS/defs.h 1.2.0.3 90/09/23 16:10:04 tho Exp $
+ */
+
#include "regex.h"
typedef char boolean;
***************
*** 21,26 ****
--- 33,112 ----
#define true 1
#define false 0
+ #ifdef MSDOS
+
+ #define PARSE_ARGS \
+ char **argv, int *arg_ptr
+
+ #define PRED_ARGS \
+ char *pathname, struct stat *stat_buf, struct pred_struct *pred_ptr
+
+ /* Pointer to function returning boolean. */
+ typedef boolean (*PRED_FCT) (PRED_ARGS);
+ typedef boolean (*PARSE_FCT) (PARSE_ARGS);
+
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <time.h>
+
+ extern struct pred_struct *get_new_pred (void);
+ extern struct pred_struct *get_new_pred_chk_op (void);
+ extern struct pred_struct *insert_victim (char (*pred_func)());
+ extern char *xmalloc (unsigned int n);
+ extern void usage (char *msg);
+ extern void error (int status, int errnum, char *message, ...);
+
+ extern PARSE_FCT find_parser (char *search_name);
+ extern char no_side_effects (struct pred_struct *pred);
+ extern boolean parse_close (PARSE_ARGS);
+ extern boolean parse_open (PARSE_ARGS);
+ extern boolean parse_print (PARSE_ARGS);
+
+ extern boolean pred_and (PRED_ARGS);
+ extern boolean pred_atime (PRED_ARGS);
+ extern boolean pred_close (PRED_ARGS);
+ extern boolean pred_ctime (PRED_ARGS);
+ extern boolean pred_exec (PRED_ARGS);
+ extern boolean pred_fstype (PRED_ARGS);
+ extern boolean pred_group (PRED_ARGS);
+ extern boolean pred_inum (PRED_ARGS);
+ extern boolean pred_links (PRED_ARGS);
+ extern boolean pred_ls (PRED_ARGS);
+ extern boolean pred_mtime (PRED_ARGS);
+ extern boolean pred_name (PRED_ARGS);
+ extern boolean pred_negate (PRED_ARGS);
+ extern boolean pred_newer (PRED_ARGS);
+ extern boolean pred_nogroup (PRED_ARGS);
+ extern boolean pred_nouser (PRED_ARGS);
+ extern boolean pred_ok (PRED_ARGS);
+ extern boolean pred_open (PRED_ARGS);
+ extern boolean pred_or (PRED_ARGS);
+ extern boolean pred_perm (PRED_ARGS);
+ extern boolean pred_permmask (PRED_ARGS);
+ extern boolean pred_print (PRED_ARGS);
+ extern boolean pred_prune (PRED_ARGS);
+ extern boolean pred_regex (PRED_ARGS);
+ extern boolean pred_size (PRED_ARGS);
+ extern boolean pred_type (PRED_ARGS);
+ extern boolean pred_user (PRED_ARGS);
+
+ extern boolean insert_exec_ok (boolean (*func) (), PARSE_ARGS);
+ extern boolean get_num_days (char *str, unsigned long *num_days,
+ enum comparison_type *comp_type);
+ extern boolean insert_time (PARSE_ARGS, PRED_FCT pred);
+ extern boolean get_num (char *str, unsigned long *num, short *comp_type);
+ extern boolean insert_num (PARSE_ARGS, PRED_FCT pred);
+
+ extern void read_mtab (void);
+
+ struct pred_struct *get_expr (struct pred_struct **input, short prev_prec);
+ extern void process_path (char *pathname, char root);
+
+ extern void main (int argc, char **argv);
+ extern char *savedir (char *dir, unsigned int name_size);
+
+ #else /* not MSDOS */
+
/* Pointer to function returning boolean. */
typedef boolean (*PFB)();
***************
*** 43,48 ****
--- 129,136 ----
void usage ();
void process_path ();
+ #endif /* not MSDOS */
+
#ifdef DEBUG
void print_tree ();
void print_list ();
***************
*** 98,104 ****
--- 186,196 ----
struct pred_struct
{
/* Pointer to the function that implements this predicate. */
+ #ifdef MSDOS
+ PRED_FCT pred_func;
+ #else
PFB pred_func;
+ #endif
#ifdef DEBUG
char *p_name;
#endif
***************
*** 148,154 ****
--- 240,248 ----
/* The number of bytes in a block for -size. */
#define BLKSIZE 512
+ #ifndef MSDOS /* errno is declared `volatile'! */
extern int errno;
+ #endif
extern char *program_name;
extern struct pred_struct *predicates;
*** e:\tmp/RCSt1006483 Sun Sep 23 19:07:40 1990
--- lib/bigram.c Sun Sep 23 19:06:44 1990
***************
*** 6,16 ****
--- 6,25 ----
Author: James A. Woods (jaw@riacs.edu)
Modified by David MacKenzie (djm@ai.mit.edu)
+ MS-DOS mods: Thorsten Ohl (td12@ddagsi3.bitnet)
Public domain. */
#include <stdio.h>
#include <sys/types.h>
+
+ #ifdef MSDOS
+ #include <stdlib.h>
+ #include <string.h>
+ int prefix_length (char *s1, char *s2);
+ void main (void);
+ #else /* not MSDOS */
#include <sys/param.h>
+ #endif /* not MSDOS */
#ifndef MAXPATHLEN
#define MAXPATHLEN 1024
*** e:\tmp/RCSt1006483 Sun Sep 23 19:07:40 1990
--- lib/code.c Sun Sep 23 19:06:52 1990
***************
*** 22,32 ****
--- 22,42 ----
Author: James A. Woods (jaw@riacs.edu)
Modified by David MacKenzie (djm@ai.mit.edu)
+ MS-DOS mods: Thorsten Ohl (td12@ddagsi3.bitnet)
Public domain. */
#include <stdio.h>
#include <sys/types.h>
+
+ #ifdef MSDOS
+ #include <stdlib.h>
+ #include <string.h>
+ void main (int argc, char **argv);
+ int prefix_length (char *s1, char *s2);
+ int strindex (char *string, char *pattern);
+ #else /* not MSDOS */
#include <sys/param.h>
+ #endif /* not MSDOS */
#ifndef MAXPATHLEN
#define MAXPATHLEN 1024