version 1.6, 2001/08/12 12:03:03 |
version 1.7, 2001/11/19 19:02:13 |
|
|
process(f) |
process(f) |
FILE *f; |
FILE *f; |
{ |
{ |
register int i, n; |
int i, n; |
char mac[5]; /* The current macro or nroff command */ |
char mac[5]; /* The current macro or nroff command */ |
int pl; |
int pl; |
|
|
|
|
char *line; |
char *line; |
char *mac; |
char *mac; |
{ |
{ |
register int i; |
int i; |
|
|
/* |
/* |
* Check to see if it matches top of stack. |
* Check to see if it matches top of stack. |
|
|
nomatch(mac) |
nomatch(mac) |
char *mac; |
char *mac; |
{ |
{ |
register int i, j; |
int i, j; |
|
|
/* |
/* |
* Look for a match further down on stack |
* Look for a match further down on stack |
|
|
addmac(mac) |
addmac(mac) |
char *mac; |
char *mac; |
{ |
{ |
register char **src, **dest, **loc; |
char **src, **dest, **loc; |
|
|
if (binsrch(mac) >= 0){ /* it's OK to redefine something */ |
if (binsrch(mac) >= 0){ /* it's OK to redefine something */ |
#ifdef DEBUG |
#ifdef DEBUG |
|
|
binsrch(mac) |
binsrch(mac) |
char *mac; |
char *mac; |
{ |
{ |
register char *p; /* pointer to current cmd in list */ |
char *p; /* pointer to current cmd in list */ |
register int d; /* difference if any */ |
int d; /* difference if any */ |
register int mid; /* mid point in binary search */ |
int mid; /* mid point in binary search */ |
register int top, bot; /* boundaries of bin search, inclusive */ |
int top, bot; /* boundaries of bin search, inclusive */ |
|
|
top = ncmds-1; |
top = ncmds-1; |
bot = 0; |
bot = 0; |