version 1.39, 2008/08/16 12:23:50 |
version 1.40, 2008/08/21 20:59:14 |
|
|
static size_t strsize = STRSPMAX; |
static size_t strsize = STRSPMAX; |
static size_t bufsize = BUFSIZE; |
static size_t bufsize = BUFSIZE; |
|
|
char *buf; /* push-back buffer */ |
unsigned char *buf; /* push-back buffer */ |
char *bufbase; /* the base for current ilevel */ |
unsigned char *bufbase; /* the base for current ilevel */ |
char *bbase[MAXINP]; /* the base for each ilevel */ |
unsigned char *bbase[MAXINP]; /* the base for each ilevel */ |
char *bp; /* first available character */ |
unsigned char *bp; /* first available character */ |
char *endpbb; /* end of push-back buffer */ |
unsigned char *endpbb; /* end of push-back buffer */ |
|
|
|
|
/* |
/* |
|
|
strspace = xalloc(strsize+1, NULL); |
strspace = xalloc(strsize+1, NULL); |
ep = strspace; |
ep = strspace; |
endest = strspace+strsize; |
endest = strspace+strsize; |
buf = (char *)xalloc(bufsize, NULL); |
buf = (unsigned char *)xalloc(bufsize, NULL); |
bufbase = buf; |
bufbase = buf; |
bp = buf; |
bp = buf; |
endpbb = buf + bufsize; |
endpbb = buf + bufsize; |
|
|
void |
void |
enlarge_bufspace() |
enlarge_bufspace() |
{ |
{ |
char *newbuf; |
unsigned char *newbuf; |
int i; |
int i; |
|
|
bufsize += bufsize/2; |
bufsize += bufsize/2; |
|
|
void |
void |
dump_buffer(FILE *f, size_t m) |
dump_buffer(FILE *f, size_t m) |
{ |
{ |
char *s; |
unsigned char *s; |
|
|
for (s = bp; s-buf > m;) |
for (s = bp; s-buf > m;) |
fputc(*--s, f); |
fputc(*--s, f); |