diff --git a/usr.bin/m4/extr.h b/usr.bin/m4/extr.h deleted file mode 100644 index 7d0ba157eee8..000000000000 --- a/usr.bin/m4/extr.h +++ /dev/null @@ -1,151 +0,0 @@ -/* Header : extr.h - Author : Ozan Yigit - Updated: %G% -*/ -#ifndef putback - -extern ndptr hashtab[]; /* hash table for macros etc. */ -extern char buf[]; /* push-back buffer */ -extern char *bp; /* first available character */ -extern char *bb; /* current beginning of bp */ -extern char *endpbb; /* end of push-back buffer */ -extern stae mstack[]; /* stack of m4 machine */ -extern char *ep; /* first free char in strspace */ -extern char *endest; /* end of string space */ -extern int sp; /* current m4 stack pointer */ -extern int fp; /* m4 call frame pointer */ -extern char *bbstack[]; -extern FILE *infile[]; /* input file stack (0=stdin) */ -extern FILE *outfile[]; /* diversion array(0=bitbucket)*/ -extern FILE *active; /* active output file pointer */ -extern char *m4temp; /* filename for diversions */ -extern int UNIQUE; /* where to change m4temp */ -extern int ilevel; /* input file stack pointer */ -extern int oindex; /* diversion index.. */ -extern char *null; /* as it says.. just a null.. */ -extern char *m4wraps; /* m4wrap string default.. */ -extern char lquote; /* left quote character (`) */ -extern char rquote; /* right quote character (') */ -extern char vquote; /* verbatim quote character ^V */ -extern char scommt; /* start character for comment */ -extern char ecommt; /* end character for comment */ - -/* inlined versions of chrsave() and putback() */ - -extern char pbmsg[]; /* error message for putback */ -extern char csmsg[]; /* error message for chrsave */ - -#define putback(c) do { if (bp >= endpbb) error(pbmsg); *bp++ = c; } while (0) -#define chrsave(c) do { if (ep >= endest) error(csmsg); *ep++ = c; } while (0) - - -#ifdef __STDC__ -#include - -/* functions from misc.c */ - -extern char * strsave(char *); -extern int indx(char *, char *); -extern void pbstr(char *); -extern void pbqtd(char *); -extern void pbnum(int); -extern void pbrad(long int, int, int); -extern void getdiv(int); -extern void killdiv(); -extern void error(char *); -extern void onintr(int); -extern void usage(); - -/* functions from look.c */ - -extern ndptr lookup(char *); -extern ndptr addent(char *); -extern void remhash(char *, int); -extern void addkywd(char *, int); - -/* functions from int2str.c */ - -extern char* int2str(/* char*, int, long */); - -/* functions from serv.c */ - -extern void expand(char **, int); -extern void dodefine(char *, char *); -extern void dopushdef(char *, char *); -extern void dodefn(char *); -extern void dodump(char **, int); -extern void doifelse(char **, int); -extern int doincl(char *); -extern void dochq(char **, int); -extern void dochc(char **, int); -extern void dodiv(int); -extern void doundiv(char **, int); -extern void dosub(char **, int); -extern void map(char *, char *, char *, char *); -#ifdef EXTENDED -extern int dopaste(char *); -extern void m4trim(char **, int); -extern void dodefqt(char **, int); -extern void doqutr(char **, int); -#endif - -/* functions from expr.c */ - -extern long expr(char *); - -#else - -/* functions from misc.c */ - -extern char * malloc(); -extern char * strsave(); -extern int indx(); -extern void pbstr(); -extern void pbqtd(); -extern void pbnum(); -extern void pbrad(); -extern void getdiv(); -extern void killdiv(); -extern void error(); -extern int onintr(); -extern void usage(); - -/* functions from look.c */ - -extern ndptr lookup(); -extern ndptr addent(); -extern void remhash(); -extern void addkywd(); - -/* functions from int2str.c */ - -extern char* int2str(/* char*, int, long */); - -/* functions from serv.c */ - -extern void expand(); -extern void dodefine(); -extern void dopushdef(); -extern void dodefn(); -extern void dodump(); -extern void doifelse(); -extern int doincl(); -extern void dochq(); -extern void dochc(); -extern void dodiv(); -extern void doundiv(); -extern void dosub(); -extern void map(); -#ifdef EXTENDED -extern int dopaste(); -extern void m4trim(); -extern void dodefqt(); -extern void doqutr(); -#endif - -/* functions from expr.c */ - -extern long expr(); - -#endif -#endif diff --git a/usr.bin/m4/int2str.c b/usr.bin/m4/int2str.c deleted file mode 100644 index 5ecc85b9ad99..000000000000 --- a/usr.bin/m4/int2str.c +++ /dev/null @@ -1,58 +0,0 @@ -/* File : int2str.c - Author : Richard A. O'Keefe - Updated: 6 February 1993 - Defines: int2str() - - int2str(dst, radix, val) - converts the (long) integer "val" to character form and moves it to - the destination string "dst" followed by a terminating NUL. The - result is normally a pointer to this NUL character, but if the radix - is dud the result will be NullS and nothing will be changed. - - If radix is -2..-36, val is taken to be SIGNED. - If radix is 2.. 36, val is taken to be UNSIGNED. - That is, val is signed if and only if radix is. You will normally - use radix -10 only through itoa and ltoa, for radix 2, 8, or 16 - unsigned is what you generally want. -*/ - -static char dig_vec[] = - "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - - -char *int2str(dst, radix, val) - register char *dst; - register int radix; - register long val; - { - char buffer[65]; /* Ready for 64-bit machines */ - register char *p; - - if (radix < 2 || radix > 36) { /* Not 2..36 */ - if (radix > -2 || radix < -36) return (char *)0; - if (val < 0) { - *dst++ = '-'; - val = -val; - } - radix = -radix; - } - /* The slightly contorted code which follows is due to the - fact that few machines directly support unsigned long / and %. - Certainly the VAX C compiler generates a subroutine call. In - the interests of efficiency (hollow laugh) I let this happen - for the first digit only; after that "val" will be in range so - that signed integer division will do. Sorry 'bout that. - CHECK THE CODE PRODUCED BY YOUR C COMPILER. The first % and / - should be unsigned, the second % and / signed, but C compilers - tend to be extraordinarily sensitive to minor details of style. - This works on a VAX, that's all I claim for it. - */ - p = &buffer[sizeof buffer]; - *--p = '\0'; - *--p = dig_vec[(unsigned long)val%(unsigned long)radix]; - val = (unsigned long)val/(unsigned long)radix; - while (val != 0) *--p = dig_vec[val%radix], val /= radix; - while (*dst++ = *p++) ; - return dst-1; - } - diff --git a/usr.bin/m4/ourlims.h b/usr.bin/m4/ourlims.h deleted file mode 100644 index 8bc0b56c0a31..000000000000 --- a/usr.bin/m4/ourlims.h +++ /dev/null @@ -1,16 +0,0 @@ -/* File : ourlims.h - Author : Richard A. O'Keefe - Defines: UCHAR_MAX, CHAR_BIT, LONG_BIT -*/ -/* If is available, use that. - Otherwise, use 8-bit byte as the default. - If the number of characters is a power of 2, you might be able - to use (unsigned char)(~0), but why get fancy? -*/ -#ifdef __STDC__ -#include -#else -#define UCHAR_MAX 255 -#define CHAR_BIT 8 -#endif -#define LONG_BIT 32