version 1.4, 2001/06/17 07:30:42 |
version 1.5, 2001/11/19 19:02:14 |
|
|
|
|
/* declarations for functions that have forward references */ |
/* declarations for functions that have forward references */ |
|
|
void mkentry PROTO((register int*, int, int, int, int)); |
void mkentry PROTO((int*, int, int, int, int)); |
void mkprot PROTO((int[], int, int)); |
void mkprot PROTO((int[], int, int)); |
void mktemplate PROTO((int[], int, int)); |
void mktemplate PROTO((int[], int, int)); |
void mv2front PROTO((int)); |
void mv2front PROTO((int)); |
|
|
void cmptmps() |
void cmptmps() |
{ |
{ |
int tmpstorage[CSIZE + 1]; |
int tmpstorage[CSIZE + 1]; |
register int *tmp = tmpstorage, i, j; |
int *tmp = tmpstorage, i, j; |
int totaltrans, trans; |
int totaltrans, trans; |
|
|
peakpairs = numtemps * numecs + tblend; |
peakpairs = numtemps * numecs + tblend; |
|
|
|
|
void expand_nxt_chk() |
void expand_nxt_chk() |
{ |
{ |
register int old_max = current_max_xpairs; |
int old_max = current_max_xpairs; |
|
|
current_max_xpairs += MAX_XPAIRS_INCREMENT; |
current_max_xpairs += MAX_XPAIRS_INCREMENT; |
|
|
|
|
/* Firstfree is the position of the first possible occurrence of two |
/* Firstfree is the position of the first possible occurrence of two |
* consecutive unused records in the chk and nxt arrays. |
* consecutive unused records in the chk and nxt arrays. |
*/ |
*/ |
register int i; |
int i; |
register int *state_ptr, *chk_ptr; |
int *state_ptr, *chk_ptr; |
register int *ptr_to_last_entry_in_state; |
int *ptr_to_last_entry_in_state; |
|
|
/* If there are too many out-transitions, put the state at the end of |
/* If there are too many out-transitions, put the state at the end of |
* nxt and chk. |
* nxt and chk. |
|
|
*/ |
*/ |
void inittbl() |
void inittbl() |
{ |
{ |
register int i; |
int i; |
|
|
zero_out( (char *) chk, (size_t) (current_max_xpairs * sizeof( int )) ); |
zero_out( (char *) chk, (size_t) (current_max_xpairs * sizeof( int )) ); |
|
|
|
|
*/ |
*/ |
|
|
void mkentry( state, numchars, statenum, deflink, totaltrans ) |
void mkentry( state, numchars, statenum, deflink, totaltrans ) |
register int *state; |
int *state; |
int numchars, statenum, deflink, totaltrans; |
int numchars, statenum, deflink, totaltrans; |
{ |
{ |
register int minec, maxec, i, baseaddr; |
int minec, maxec, i, baseaddr; |
int tblbase, tbllast; |
int tblbase, tbllast; |
|
|
if ( totaltrans == 0 ) |
if ( totaltrans == 0 ) |
|
|
void place_state( state, statenum, transnum ) |
void place_state( state, statenum, transnum ) |
int *state, statenum, transnum; |
int *state, statenum, transnum; |
{ |
{ |
register int i; |
int i; |
register int *state_ptr; |
int *state_ptr; |
int position = find_table_space( state, transnum ); |
int position = find_table_space( state, transnum ); |
|
|
/* "base" is the table of start positions. */ |
/* "base" is the table of start positions. */ |
|
|
int tbldiff( state, pr, ext ) |
int tbldiff( state, pr, ext ) |
int state[], pr, ext[]; |
int state[], pr, ext[]; |
{ |
{ |
register int i, *sp = state, *ep = ext, *protp; |
int i, *sp = state, *ep = ext, *protp; |
register int numdiff = 0; |
int numdiff = 0; |
|
|
protp = &protsave[numecs * (pr - 1)]; |
protp = &protsave[numecs * (pr - 1)]; |
|
|