#ifdef __STDC__

/* Prototypes for functions defined in dfa.c */
static void *xcalloc(int n,
                     int s);
static void *xmalloc(int n);
static void *xrealloc(void *p,
                      int n);
static int tstbit(int b,
                  int *c);
static void setbit(int b,
                   int *c);
static void clrbit(int b,
                   int *c);
static void copyset(int *src,
                    int *dst);
static void zeroset(int *s);
static void notset(int *s);
static int equal(_charset,_charset);

static int charset_index(_charset const);
void regsyntax(int bits,
               int fold);
static _token lex(void);
static void addtok(_token t);
static void atom(void);
static void closure(void);
static void branch(void);
static void regexp(void);
void regparse(char *s,
              int len,
              struct regexp *r);
static void copy(struct { struct { unsigned int index; unsigned int constraint;  }  *elems; int nelem;  }  *src,
                 struct { struct { unsigned int index; unsigned int constraint;  }  *elems; int nelem;  }  *dst);
static void insert(_position, _position_set *);

static void merge(struct { struct { unsigned int index; unsigned int constraint;  }  *elems; int nelem;  }  *s1,
                  struct { struct { unsigned int index; unsigned int constraint;  }  *elems; int nelem;  }  *s2,
                  struct { struct { unsigned int index; unsigned int constraint;  }  *elems; int nelem;  }  *m);
static void delete(_position, _position_set *);

static int state_index(struct regexp *r,
                       struct { struct { unsigned int index; unsigned int constraint;  }  *elems; int nelem;  }  *s,
                       int newline,
                       int letter);
void epsclosure(struct { struct { unsigned int index; unsigned int constraint;  }  *elems; int nelem;  }  *s,
                struct regexp *r);
void reganalyze(struct regexp *r,
                int searchflag);
void regstate(int s,
              struct regexp *r,
              int *trans);
static void build_state(int s,
                        struct regexp *r);
static void build_state_zero(struct regexp *r);
char *regexecute(struct regexp *r,
                 char *begin,
                 char *end,
                 int newline,
                 int *count,
                 int *backref);
void reginit(struct regexp *r);
/* void regcompile(char * const s,
                int len,
                struct regexp *r,
                int searchflag); */
void regfree(struct regexp *r);
static char *icatalloc(char *old,
                       char *new);
static char *icpyalloc(char *string);
static char *istrstr(char *lookin,
                     register char *lookfor);
static void ifree(char *cp);
static void freelist(register char **cpp);
static char **enlist(register char **cpp,
                     register char *new,
                     int len);
static char **comsubs(char *left,
                      char *right);
static char **addlists(char **old,
                       char **new);
static char **inboth(char **left,
                     char **right);
static void resetmust(register struct { char **in; char *left; char *right; char *is;  }  *mp);
static void regmust(register struct regexp *r);
#endif

