/* Appends n characters in str to buf. */
-struct Buf *buf_strnappend (buf, str, n)
- struct Buf *buf;
- const char *str;
- int n;
+struct Buf *buf_strnappend (struct Buf *buf, const char *str, int n)
{
buf_append (buf, str, n + 1);
}
/* Appends characters in str to buf. */
-struct Buf *buf_strappend (buf, str)
- struct Buf *buf;
- const char *str;
+struct Buf *buf_strappend (struct Buf *buf, const char *str)
{
return buf_strnappend (buf, str, strlen (str));
}
/* appends "#define str def\n" */
-struct Buf *buf_strdefine (buf, str, def)
- struct Buf *buf;
- const char *str;
- const char *def;
+struct Buf *buf_strdefine (struct Buf *buf, const char *str, const char *def)
{
buf_strappend (buf, "#define ");
buf_strappend (buf, " ");
}
/* create buf with 0 elements, each of size elem_size. */
-void buf_init (buf, elem_size)
- struct Buf *buf;
- size_t elem_size;
+void buf_init (struct Buf *buf, size_t elem_size)
{
buf->elts = (void *) 0;
buf->nelts = 0;
}
/* frees memory */
-void buf_destroy (buf)
- struct Buf *buf;
+void buf_destroy (struct Buf *buf)
{
if (buf && buf->elts)
flex_free (buf->elts);
* We grow by mod(512) boundaries.
*/
-struct Buf *buf_append (buf, ptr, n_elem)
- struct Buf *buf;
- const void *ptr;
- int n_elem;
+struct Buf *buf_append (struct Buf *buf, const void *ptr, int n_elem)
{
int n_alloc = 0;
/* ccladd - add a single character to a ccl */
-void ccladd (cclp, ch)
- int cclp;
- int ch;
+void ccladd (int cclp, int ch)
{
int ind, len, newpos, i;
/* cclinit - return an empty ccl */
-int cclinit ()
+int cclinit (void)
{
if (++lastccl >= current_maxccls) {
current_maxccls += MAX_CCLS_INCREMENT;
/* cclnegate - negate the given ccl */
-void cclnegate (cclp)
- int cclp;
+void cclnegate (int cclp)
{
cclng[cclp] = 1;
ccl_has_nl[cclp] = !ccl_has_nl[cclp];
* has a non-zero value in the cset array.
*/
-void list_character_set (file, cset)
- FILE *file;
- int cset[];
+void list_character_set (FILE *file, int cset[])
{
int i;
* indexed by equivalence class.
*/
-void check_for_backing_up (ds, state)
- int ds;
- int state[];
+void check_for_backing_up (int ds, int state[])
{
if ((reject && !dfaacc[ds].dfaacc_set) || (!reject && !dfaacc[ds].dfaacc_state)) { /* state is non-accepting */
++num_backing_up;
* accset[1 .. nacc] is the list of accepting numbers for the DFA state.
*/
-void check_trailing_context (nfa_states, num_states, accset, nacc)
- int *nfa_states, num_states;
- int *accset;
- int nacc;
+void check_trailing_context (int *nfa_states, int num_states, int *accset, int nacc)
{
int i, j;
* and writes a report to the given file.
*/
-void dump_associated_rules (file, ds)
- FILE *file;
- int ds;
+void dump_associated_rules (FILE *file, int ds)
{
int i, j;
int num_associated_rules = 0;
* is done to the given file.
*/
-void dump_transitions (file, state)
- FILE *file;
- int state[];
+void dump_transitions (FILE *file, int state[])
{
int i, ec;
int out_char_set[CSIZE];
* hashval is the hash value for the dfa corresponding to the state set.
*/
-int *epsclosure (t, ns_addr, accset, nacc_addr, hv_addr)
- int *t, *ns_addr, accset[], *nacc_addr, *hv_addr;
+int *epsclosure (int *t, int *ns_addr, int accset[], int *nacc_addr, int *hv_addr)
{
int stkpos, ns, tsp;
int numstates = *ns_addr, nacc, hashval, transsym, nfaccnum;
/* increase_max_dfas - increase the maximum number of DFAs */
-void increase_max_dfas ()
+void increase_max_dfas (void)
{
current_max_dfas += MAX_DFAS_INCREMENT;
* dfa starts out in state #1.
*/
-void ntod ()
+void ntod (void)
{
int *accset, ds, nacc, newds;
int sym, hashval, numstates, dsize;
* On return, the dfa state number is in newds.
*/
-int snstods (sns, numstates, accset, nacc, hashval, newds_addr)
- int sns[], numstates, accset[], nacc, hashval, *newds_addr;
+int snstods (int sns[], int numstates, int accset[], int nacc, int hashval, int *newds_addr)
{
int didsort = 0;
int i, j;
* int transsym, int nset[current_max_dfa_size] );
*/
-int symfollowset (ds, dsize, transsym, nset)
- int ds[], dsize, transsym, nset[];
+int symfollowset (int ds[], int dsize, int transsym, int nset[])
{
int ns, tsp, sym, i, j, lenccl, ch, numstates, ccllist;
* int symlist[numecs], int duplist[numecs] );
*/
-void sympartition (ds, numstates, symlist, duplist)
- int ds[], numstates;
- int symlist[], duplist[];
+void sympartition (int ds[], int numstates, int symlist[], int duplist[])
{
int tch, i, j, k, ns, dupfwd[CSIZE + 1], lenccl, cclp, ich;
/* ccl2ecl - convert character classes to set of equivalence classes */
-void ccl2ecl ()
+void ccl2ecl (void)
{
int i, ich, newlen, cclp, ccls, cclmec;
* Returned is the number of classes.
*/
-int cre8ecs (fwd, bck, num)
- int fwd[], bck[], num;
+int cre8ecs (int fwd[], int bck[], int num)
{
int i, j, numcl;
* NUL_mapping is the value which NUL (0) should be mapped to.
*/
-void mkeccl (ccls, lenccl, fwd, bck, llsiz, NUL_mapping)
- Char ccls[];
- int lenccl, fwd[], bck[], llsiz, NUL_mapping;
+void mkeccl (Char ccls[], int lenccl, int fwd[], int bck[], int llsiz, int NUL_mapping)
{
int cclp, oldec, newec;
int cclm, i, j;
/* mkechar - create equivalence class for single character */
-void mkechar (tch, fwd, bck)
- int tch, fwd[], bck[];
+void mkechar (int tch, int fwd[], int bck[])
{
/* If until now the character has been a proper subset of
* an equivalence class, break it away to create a new ec
* current indentation level, adding a final newline.
*/
-void indent_put2s (fmt, arg)
- const char *fmt, *arg;
+void indent_put2s (const char *fmt, const char *arg)
{
do_indent ();
out_str (fmt, arg);
* newline.
*/
-void indent_puts (str)
- const char *str;
+void indent_puts (const char *str)
{
do_indent ();
outn (str);
int flex_main PROTO ((int argc, char *argv[]));
int main PROTO ((int argc, char *argv[]));
-int flex_main (argc, argv)
- int argc;
- char *argv[];
+int flex_main (int argc, char *argv[])
{
int i, exit_status, child_status;
}
/* Wrapper around flex_main, so flex_main can be built as a library. */
-int main (argc, argv)
- int argc;
- char *argv[];
+int main (int argc, char *argv[])
{
#if ENABLE_NLS
#if HAVE_LOCALE_H
/* check_options - check user-specified options */
-void check_options ()
+void check_options (void)
{
int i;
const char * m4 = NULL;
* This routine does not return.
*/
-void flexend (exit_status)
- int exit_status;
-
+void flexend (int exit_status)
{
static int called_before = -1; /* prevent infinite recursion. */
int tblsiz;
/* flexinit - initialize flex */
-void flexinit (argc, argv)
- int argc;
- char **argv;
+void flexinit (int argc, char **argv)
{
int i, sawcmpflag, rv, optind;
char *arg;
/* readin - read in the rules section of the input file(s) */
-void readin ()
+void readin (void)
{
static char yy_stdinit[] = "FILE *yyin = stdin, *yyout = stdout;";
static char yy_nostdinit[] =
/* set_up_initial_allocations - allocate memory for internal tables */
-void set_up_initial_allocations ()
+void set_up_initial_allocations (void)
{
maximum_mns = (long_align ? MAXIMUM_MNS_LONG : MAXIMUM_MNS);
current_mns = INITIAL_MNS;
/* extracts basename from path, optionally stripping the extension "\.*"
* (same concept as /bin/sh `basename`, but different handling of extension). */
-static char *basename2 (path, strip_ext)
- char *path;
- int strip_ext; /* boolean */
+static char *basename2 (char *path, int /* boolean */ strip_ext)
{
char *b, *e = 0;
return b;
}
-void usage ()
+void usage (void)
{
FILE *f = stdout;
}
/* Append "#define defname value\n" to the running buffer. */
-void action_define (defname, value)
- const char *defname;
- int value;
+void action_define (const char *defname, int value)
{
char buf[MAXLINE];
char *cpy;
#endif
/* Append "new_text" to the running buffer. */
-void add_action (new_text)
- const char *new_text;
+void add_action (const char *new_text)
{
int len = strlen (new_text);
/* allocate_array - allocate memory for an integer array of the given size */
-void *allocate_array (size, element_size)
- int size;
- size_t element_size;
+void *allocate_array (int size, size_t element_size)
{
void *mem;
size_t num_bytes = element_size * size;
/* all_lower - true if a string is all lower-case */
-int all_lower (str)
- char *str;
+int all_lower (char *str)
{
while (*str) {
if (!isascii ((Char) * str) || !islower ((Char) * str))
/* all_upper - true if a string is all upper-case */
-int all_upper (str)
- char *str;
+int all_upper (char *str)
{
while (*str) {
if (!isascii ((Char) * str) || !isupper ((Char) * str))
* and exits.
*/
-void check_char (c)
- int c;
+void check_char (int c)
{
if (c >= CSIZE)
lerr (_("bad character '%s' detected in check_char()"),
/* clower - replace upper-case letter to lower-case */
-Char clower (c)
- int c;
+Char clower (int c)
{
return (Char) ((isascii (c) && isupper (c)) ? tolower (c) : c);
}
/* copy_string - returns a dynamically allocated copy of a string */
-char *copy_string (str)
- const char *str;
+char *copy_string (const char *str)
{
const char *c1;
char *c2;
* returns a dynamically allocated copy of a (potentially) unsigned string
*/
-Char *copy_unsigned_string (str)
- Char *str;
+Char *copy_unsigned_string (Char *str)
{
Char *c;
Char *copy;
/* dataend - finish up a block of data declarations */
-void dataend ()
+void dataend (void)
{
/* short circuit any output */
if (gentables) {
/* dataflush - flush generated data statements */
-void dataflush ()
+void dataflush (void)
{
/* short circuit any output */
if (!gentables)
/* flexerror - report an error message and terminate */
-void flexerror (msg)
- const char *msg;
+void flexerror (const char *msg)
{
fprintf (stderr, "%s: %s\n", program_name, msg);
flexend (1);
/* flexfatal - report a fatal error message and terminate */
-void flexfatal (msg)
- const char *msg;
+void flexfatal (const char *msg)
{
fprintf (stderr, _("%s: fatal internal error, %s\n"),
program_name, msg);
/* htoi - convert a hexadecimal digit string to an integer value */
-int htoi (str)
- Char str[];
+int htoi (Char str[])
{
unsigned int result;
/* lerr - report an error message */
-void lerr (const char *msg, ...) {
+void lerr (const char *msg, ...)
+{
char errmsg[MAXLINE];
va_list args;
/* line_directive_out - spit out a "#line" statement */
-void line_directive_out (output_file, do_infile)
- FILE *output_file;
- int do_infile;
+void line_directive_out (FILE *output_file, int do_infile)
{
char directive[MAXLINE], filename[MAXLINE];
char *s1, *s2, *s3;
* representing where the user's section 1 definitions end
* and the prolog begins
*/
-void mark_defs1 ()
+void mark_defs1 (void)
{
defs1_offset = 0;
action_array[action_index++] = '\0';
/* mark_prolog - mark the current position in the action array as
* representing the end of the action prolog
*/
-void mark_prolog ()
+void mark_prolog (void)
{
action_array[action_index++] = '\0';
action_offset = action_index;
*
* Generates a data statement initializing the current 2-D array to "value".
*/
-void mk2data (value)
- int value;
+void mk2data (int value)
{
/* short circuit any output */
if (!gentables)
* Generates a data statement initializing the current array element to
* "value".
*/
-void mkdata (value)
- int value;
+void mkdata (int value)
{
/* short circuit any output */
if (!gentables)
/* myctoi - return the integer represented by a string of digits */
-int myctoi (array)
- const char *array;
+int myctoi (const char *array)
{
int val = 0;
/* myesc - return character corresponding to escape sequence */
-Char myesc (array)
- Char array[];
+Char myesc (Char array[])
{
Char c, esc_char;
/* otoi - convert an octal digit string to an integer value */
-int otoi (str)
- Char str[];
+int otoi (Char str[])
{
unsigned int result;
* generated scanner, keeping track of the line count.
*/
-void out (str)
- const char *str;
+void out (const char *str)
{
fputs (str, stdout);
}
-void out_dec (fmt, n)
- const char *fmt;
- int n;
+void out_dec (const char *fmt, int n)
{
fprintf (stdout, fmt, n);
}
-void out_dec2 (fmt, n1, n2)
- const char *fmt;
- int n1, n2;
+void out_dec2 (const char *fmt, int n1, int n2)
{
fprintf (stdout, fmt, n1, n2);
}
-void out_hex (fmt, x)
- const char *fmt;
- unsigned int x;
+void out_hex (const char *fmt, unsigned int x)
{
fprintf (stdout, fmt, x);
}
-void out_str (fmt, str)
- const char *fmt, str[];
+void out_str (const char *fmt, const char str[])
{
fprintf (stdout,fmt, str);
}
-void out_str3 (fmt, s1, s2, s3)
- const char *fmt, s1[], s2[], s3[];
+void out_str3 (const char *fmt, const char s1[], const char s2[], const char s3[])
{
fprintf (stdout,fmt, s1, s2, s3);
}
-void out_str_dec (fmt, str, n)
- const char *fmt, str[];
- int n;
+void out_str_dec (const char *fmt, const char str[], int n)
{
fprintf (stdout,fmt, str, n);
}
-void outc (c)
- int c;
+void outc (int c)
{
fputc (c, stdout);
}
-void outn (str)
- const char *str;
+void outn (const char *str)
{
fputs (str,stdout);
fputc('\n',stdout);
* The returned string is in static storage.
*/
-char *readable_form (c)
- int c;
+char *readable_form (int c)
{
static char rform[20];
/* reallocate_array - increase the size of a dynamic array */
-void *reallocate_array (array, size, element_size)
- void *array;
- int size;
- size_t element_size;
+void *reallocate_array (void *array, int size, size_t element_size)
{
void *new_array;
size_t num_bytes = element_size * size;
* Copies skelfile or skel array to stdout until a line beginning with
* "%%" or EOF is found.
*/
-void skelout ()
+void skelout (void)
{
char buf_storage[MAXLINE];
char *buf = buf_storage;
/* The following is only needed when building flex's parser using certain
* broken versions of bison.
*/
-void *yy_flex_xmalloc (size)
- int size;
+void *yy_flex_xmalloc (int size)
{
void *result = flex_alloc ((size_t) size);
* Sets region_ptr[0] through region_ptr[size_in_bytes - 1] to zero.
*/
-void zero_out (region_ptr, size_in_bytes)
- char *region_ptr;
- size_t size_in_bytes;
+void zero_out (char *region_ptr, size_t size_in_bytes)
{
char *rp, *rp_end;
/* Remove all '\n' and '\r' characters, if any, from the end of str.
* str can be any null-terminated string, or NULL.
* returns str. */
-char *chomp (str)
- char *str;
+char *chomp (char *str)
{
char *p = str;
* accepting_number becomes mach's accepting number.
*/
-void add_accept (mach, accepting_number)
- int mach, accepting_number;
+void add_accept (int mach, int accepting_number)
{
/* Hang the accepting number off an epsilon state. if it is associated
* with a state that has a non-epsilon out-transition, then the state
* num - the number of copies of singl to be present in newsng
*/
-int copysingl (singl, num)
- int singl, num;
+int copysingl (int singl, int num)
{
int copy, i;
/* dumpnfa - debugging routine to write out an nfa */
-void dumpnfa (state1)
- int state1;
-
+void dumpnfa (int state1)
{
int sym, tsp1, tsp2, anum, ns;
* states accessible by the arrays firstst and lastst
*/
-int dupmachine (mach)
- int mach;
+int dupmachine (int mach)
{
int i, init, state_offset;
int state = 0;
* context has variable length.
*/
-void finish_rule (mach, variable_trail_rule, headcnt, trailcnt,
- pcont_act)
- int mach, variable_trail_rule, headcnt, trailcnt, pcont_act;
+void finish_rule (int mach, int variable_trail_rule, int headcnt, int trailcnt,
+ int pcont_act)
{
char action_text[MAXLINE];
* FIRST is set to new by the operation. last is unmolested.
*/
-int link_machines (first, last)
- int first, last;
+int link_machines (int first, int last)
{
if (first == NIL)
return last;
* The "beginning" states are the epsilon closure of the first state
*/
-void mark_beginning_as_normal (mach)
- int mach;
+void mark_beginning_as_normal (int mach)
{
switch (state_type[mach]) {
case STATE_NORMAL:
* more mkbranch's. Compare with mkor()
*/
-int mkbranch (first, second)
- int first, second;
+int mkbranch (int first, int second)
{
int eps;
* new - a new state which matches the closure of "state"
*/
-int mkclos (state)
- int state;
+int mkclos (int state)
{
return mkopt (mkposcl (state));
}
* 2. mach is destroyed by the call
*/
-int mkopt (mach)
- int mach;
+int mkopt (int mach)
{
int eps;
* the number of epsilon states needed
*/
-int mkor (first, second)
- int first, second;
+int mkor (int first, int second)
{
int eps, orend;
* new - a machine matching the positive closure of "state"
*/
-int mkposcl (state)
- int state;
+int mkposcl (int state)
{
int eps;
* if "ub" is INFINITE_REPEAT then "new" matches "lb" or more occurrences of "mach"
*/
-int mkrep (mach, lb, ub)
- int mach, lb, ub;
+int mkrep (int mach, int lb, int ub)
{
int base_mach, tail, copy, i;
* that it admittedly is)
*/
-int mkstate (sym)
- int sym;
+int mkstate (int sym)
{
if (++lastnfa >= current_mns) {
if ((current_mns += MNS_INCREMENT) >= maximum_mns)
* stateto - the state to which the transition is to be made
*/
-void mkxtion (statefrom, stateto)
- int statefrom, stateto;
+void mkxtion (int statefrom, int stateto)
{
if (trans1[statefrom] == NO_TRANSITION)
trans1[statefrom] = stateto;
/* new_rule - initialize for a new rule */
-void new_rule ()
+void new_rule (void)
{
if (++num_rules >= current_max_rules) {
++num_reallocs;
* conditions
*/
-void build_eof_action()
+void build_eof_action(void)
{
int i;
char action_text[MAXLINE];
/* format_synerr - write out formatted syntax error */
-void format_synerr( msg, arg )
-const char *msg, arg[];
+void format_synerr( const char *msg, const char arg[] )
{
char errmsg[MAXLINE];
/* synerr - report a syntax error */
-void synerr( str )
-const char *str;
+void synerr( const char *str )
{
syntaxerror = true;
pinpoint_message( str );
/* format_warn - write out formatted warning */
-void format_warn( msg, arg )
-const char *msg, arg[];
+void format_warn( const char *msg, const char arg[] )
{
char warn_msg[MAXLINE];
/* warn - report a warning, unless -w was given */
-void warn( str )
-const char *str;
+void warn( const char *str )
{
line_warning( str, linenum );
}
* pinpointing its location
*/
-void format_pinpoint_message( msg, arg )
-const char *msg, arg[];
+void format_pinpoint_message( const char *msg, const char arg[] )
{
char errmsg[MAXLINE];
/* pinpoint_message - write out a message, pinpointing its location */
-void pinpoint_message( str )
-const char *str;
+void pinpoint_message( const char *str )
{
line_pinpoint( str, linenum );
}
/* line_warning - report a warning at a given line, unless -w was given */
-void line_warning( str, line )
-const char *str;
-int line;
+void line_warning( const char *str, int line )
{
char warning[MAXLINE];
/* line_pinpoint - write out a message, pinpointing it at the given line */
-void line_pinpoint( str, line )
-const char *str;
-int line;
+void line_pinpoint( const char *str, int line )
{
fprintf( stderr, "%s:%d: %s\n", infilename, line, str );
}
* currently, messages are ignore
*/
-void yyerror( msg )
-const char *msg;
+void yyerror( const char *msg )
{
(void)msg;
}
%%
-int yywrap()
+int yywrap(void)
{
if ( --num_input_files > 0 )
{
/* set_input_file - open the given file (if NULL, stdin) for scanning */
-void set_input_file( file )
-char *file;
+void set_input_file( char *file )
{
if ( file && strcmp( file, "-" ) )
{
/* Wrapper routines for accessing the scanner's malloc routines. */
-void *flex_alloc( size )
-size_t size;
+void *flex_alloc( size_t size )
{
return (void *) malloc( size );
}
-void *flex_realloc( ptr, size )
-void *ptr;
-size_t size;
+void *flex_realloc( void *ptr, size_t size )
{
return (void *) realloc( ptr, size );
}
-void flex_free( ptr )
-void *ptr;
+void flex_free( void *ptr )
{
if ( ptr )
free( ptr );
#else
static int STRCASECMP PROTO ((const char *, const char *));
-static int STRCASECMP (a, b)
- const char *a;
- const char *b;
+static int STRCASECMP (const char *a, const char *b)
{
while (tolower ((unsigned char)*a++) == tolower ((unsigned char)*b++)) ;
return b - a;
static int find_opt
PROTO ((struct _scanopt_t *, int, char *, int, int *, int *opt_offset));
-static const char *NAME (s, i)
- struct _scanopt_t *s;
- int i;
+static const char *NAME (struct _scanopt_t *s, int i)
{
return s->options[i].opt_fmt +
((s->aux[i].flags & IS_LONG) ? 2 : 1);
}
-static int PRINTLEN (s, i)
- struct _scanopt_t *s;
- int i;
+static int PRINTLEN (struct _scanopt_t *s, int i)
{
return s->aux[i].printlen;
}
-static int RVAL (s, i)
- struct _scanopt_t *s;
- int i;
+static int RVAL (struct _scanopt_t *s, int i)
{
return s->options[i].r_val;
}
-static int FLAGS (s, i)
- struct _scanopt_t *s;
- int i;
+static int FLAGS (struct _scanopt_t *s, int i)
{
return s->aux[i].flags;
}
-static const char *DESC (s, i)
- struct _scanopt_t *s;
- int i;
+static const char *DESC (struct _scanopt_t *s, int i)
{
return s->options[i].desc ? s->options[i].desc : "";
}
#ifndef NO_SCANOPT_USAGE
static int get_cols PROTO ((void));
-static int get_cols ()
+static int get_cols (void)
{
char *env;
int cols = 80; /* default */
(s)->subscript= 0; \
}while(0)
-scanopt_t *scanopt_init (options, argc, argv, flags)
- const optspec_t *options;
- int argc;
- char **argv;
- int flags;
+scanopt_t *scanopt_init (const optspec_t *options, int argc, char **argv, int flags)
{
int i;
struct _scanopt_t *s;
[indent][option, alias1, alias2...][indent][description line1
description line2...]
*/
-int scanopt_usage (scanner, fp, usage)
- scanopt_t *scanner;
- FILE *fp;
- const char *usage;
+int scanopt_usage (scanopt_t *scanner, FILE *fp, const char *usage)
{
struct _scanopt_t *s;
int i, columns, indent = 2;
#endif /* no scanopt_usage */
-static int scanopt_err (s, is_short, err)
- struct _scanopt_t *s;
- int is_short;
- int err;
+static int scanopt_err (struct _scanopt_t *s, int is_short, int err)
{
const char *optname = "";
char optchar[2];
* optname will point to str + 2
*
*/
-static int matchlongopt (str, optname, optlen, arg, arglen)
- char *str;
- char **optname;
- int *optlen;
- char **arg;
- int *arglen;
+static int matchlongopt (char *str, char **optname, int *optlen, char **arg, int *arglen)
{
char *p;
* Short options must be exact.
* Return boolean true if found and no error.
* Error stored in err_code or zero if no error. */
-static int find_opt (s, lookup_long, optstart, len, err_code, opt_offset)
- struct _scanopt_t *s;
- int lookup_long;
- char *optstart;
- int len;
- int *err_code;
- int *opt_offset;
+static int find_opt (struct _scanopt_t *s, int lookup_long, char *optstart, int
+ len, int *err_code, int *opt_offset)
{
int nmatch = 0, lastr_val = 0, i;
}
\f
-int scanopt (svoid, arg, optindex)
- scanopt_t *svoid;
- char **arg;
- int *optindex;
+int scanopt (scanopt_t *svoid, char **arg, int *optindex)
{
char *optname = NULL, *optarg = NULL, *pstart;
int namelen = 0, arglen = 0;
}
-int scanopt_destroy (svoid)
- scanopt_t *svoid;
+int scanopt_destroy (scanopt_t *svoid)
{
struct _scanopt_t *s;
* -1 is returned if the symbol already exists, and the change not made.
*/
-static int addsym (sym, str_def, int_def, table, table_size)
- char sym[];
- char *str_def;
- int int_def;
- hash_table table;
- int table_size;
+static int addsym (char sym[], char *str_def, int int_def, hash_table table, int table_size)
{
int hash_val = hashfunct (sym, table_size);
struct hash_entry *sym_entry = table[hash_val];
/* cclinstal - save the text of a character class */
-void cclinstal (ccltxt, cclnum)
- Char ccltxt[];
- int cclnum;
+void cclinstal (Char ccltxt[], int cclnum)
{
/* We don't bother checking the return status because we are not
* called unless the symbol is new.
* Returns 0 if there's no CCL associated with the text.
*/
-int ccllookup (ccltxt)
- Char ccltxt[];
+int ccllookup (Char ccltxt[])
{
return findsym ((char *) ccltxt, ccltab, CCL_HASH_SIZE)->int_val;
}
/* findsym - find symbol in symbol table */
-static struct hash_entry *findsym (sym, table, table_size)
- const char *sym;
- hash_table table;
- int table_size;
+static struct hash_entry *findsym (const char *sym, hash_table table, int table_size)
{
static struct hash_entry empty_entry = {
(struct hash_entry *) 0, (struct hash_entry *) 0,
/* hashfunct - compute the hash value for "str" and hash size "hash_size" */
-static int hashfunct (str, hash_size)
- const char *str;
- int hash_size;
+static int hashfunct (const char *str, int hash_size)
{
int hashval;
int locstr;
/* ndinstal - install a name definition */
-void ndinstal (name, definition)
- const char *name;
- Char definition[];
+void ndinstal (const char *name, Char definition[])
{
if (addsym (copy_string (name),
* Returns a nil pointer if the name definition does not exist.
*/
-Char *ndlookup (nd)
- const char *nd;
+Char *ndlookup (const char *nd)
{
return (Char *) findsym (nd, ndtbl, NAME_TABLE_HASH_SIZE)->str_val;
}
/* scextend - increase the maximum number of start conditions */
-void scextend ()
+void scextend (void)
{
current_max_scs += MAX_SCS_INCREMENT;
* The start condition is "exclusive" if xcluflg is true.
*/
-void scinstal (str, xcluflg)
- const char *str;
- int xcluflg;
+void scinstal (const char *str, int xcluflg)
{
if (++lastsc >= current_max_scs)
* Returns 0 if no such start condition.
*/
-int sclookup (str)
- const char *str;
+int sclookup (const char *str)
{
return findsym (str, sctbl, START_COND_HASH_SIZE)->int_val;
}
* cost only one difference.
*/
-void bldtbl (state, statenum, totaltrans, comstate, comfreq)
- int state[], statenum, totaltrans, comstate, comfreq;
+void bldtbl (int state[], int statenum, int totaltrans, int comstate, int comfreq)
{
int extptr, extrct[2][CSIZE + 1];
int mindiff, minprot, i, d;
* classes.
*/
-void cmptmps ()
+void cmptmps (void)
{
int tmpstorage[CSIZE + 1];
int *tmp = tmpstorage, i, j;
/* expand_nxt_chk - expand the next check arrays */
-void expand_nxt_chk ()
+void expand_nxt_chk (void)
{
int old_max = current_max_xpairs;
* and an action number will be added in [-1].
*/
-int find_table_space (state, numtrans)
- int *state, numtrans;
+int find_table_space (int *state, int numtrans)
{
/* Firstfree is the position of the first possible occurrence of two
* consecutive unused records in the chk and nxt arrays.
* Initializes "firstfree" to be one beyond the end of the table. Initializes
* all "chk" entries to be zero.
*/
-void inittbl ()
+void inittbl (void)
{
int i;
/* mkdeftbl - make the default, "jam" table entries */
-void mkdeftbl ()
+void mkdeftbl (void)
{
int i;
* state array.
*/
-void mkentry (state, numchars, statenum, deflink, totaltrans)
- int *state;
- int numchars, statenum, deflink, totaltrans;
+void mkentry (int *state, int numchars, int statenum, int deflink,
+ int totaltrans)
{
int minec, maxec, i, baseaddr;
int tblbase, tbllast;
* has only one out-transition
*/
-void mk1tbl (state, sym, onenxt, onedef)
- int state, sym, onenxt, onedef;
+void mk1tbl (int state, int sym, int onenxt, int onedef)
{
if (firstfree < sym)
firstfree = sym;
/* mkprot - create new proto entry */
-void mkprot (state, statenum, comstate)
- int state[], statenum, comstate;
+void mkprot (int state[], int statenum, int comstate)
{
int i, slot, tblbase;
* to it
*/
-void mktemplate (state, statenum, comstate)
- int state[], statenum, comstate;
+void mktemplate (int state[], int statenum, int comstate)
{
int i, numdiff, tmpbase, tmp[CSIZE + 1];
Char transset[CSIZE + 1];
/* mv2front - move proto queue element to front of queue */
-void mv2front (qelm)
- int qelm;
+void mv2front (int qelm)
{
if (firstprot != qelm) {
if (qelm == lastprot)
* Transnum is the number of out-transitions for the state.
*/
-void place_state (state, statenum, transnum)
- int *state, statenum, transnum;
+void place_state (int *state, int statenum, int transnum)
{
int i;
int *state_ptr;
* no room, we process the sucker right now.
*/
-void stack1 (statenum, sym, nextstate, deflink)
- int statenum, sym, nextstate, deflink;
+void stack1 (int statenum, int sym, int nextstate, int deflink)
{
if (onesp >= ONE_STACK_SIZE - 1)
mk1tbl (statenum, sym, nextstate, deflink);
* number is "numecs" minus the number of "SAME_TRANS" entries in "ext".
*/
-int tbldiff (state, pr, ext)
- int state[], pr, ext[];
+int tbldiff (int state[], int pr, int ext[])
{
int i, *sp = state, *ep = ext, *protp;
int numdiff = 0;