home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff295.lzh / GnuGrep / dfa.i < prev    next >
Text File  |  1989-12-27  |  3KB  |  88 lines

  1. #ifdef __STDC__
  2.  
  3. /* Prototypes for functions defined in dfa.c */
  4. static void *xcalloc(int n,
  5.                      int s);
  6. static void *xmalloc(int n);
  7. static void *xrealloc(void *p,
  8.                       int n);
  9. static int tstbit(int b,
  10.                   int *c);
  11. static void setbit(int b,
  12.                    int *c);
  13. static void clrbit(int b,
  14.                    int *c);
  15. static void copyset(int *src,
  16.                     int *dst);
  17. static void zeroset(int *s);
  18. static void notset(int *s);
  19. static int equal(_charset,_charset);
  20.  
  21. static int charset_index(_charset const);
  22. void regsyntax(int bits,
  23.                int fold);
  24. static _token lex(void);
  25. static void addtok(_token t);
  26. static void atom(void);
  27. static void closure(void);
  28. static void branch(void);
  29. static void regexp(void);
  30. void regparse(char *s,
  31.               int len,
  32.               struct regexp *r);
  33. static void copy(struct { struct { unsigned int index; unsigned int constraint;  }  *elems; int nelem;  }  *src,
  34.                  struct { struct { unsigned int index; unsigned int constraint;  }  *elems; int nelem;  }  *dst);
  35. static void insert(_position, _position_set *);
  36.  
  37. static void merge(struct { struct { unsigned int index; unsigned int constraint;  }  *elems; int nelem;  }  *s1,
  38.                   struct { struct { unsigned int index; unsigned int constraint;  }  *elems; int nelem;  }  *s2,
  39.                   struct { struct { unsigned int index; unsigned int constraint;  }  *elems; int nelem;  }  *m);
  40. static void delete(_position, _position_set *);
  41.  
  42. static int state_index(struct regexp *r,
  43.                        struct { struct { unsigned int index; unsigned int constraint;  }  *elems; int nelem;  }  *s,
  44.                        int newline,
  45.                        int letter);
  46. void epsclosure(struct { struct { unsigned int index; unsigned int constraint;  }  *elems; int nelem;  }  *s,
  47.                 struct regexp *r);
  48. void reganalyze(struct regexp *r,
  49.                 int searchflag);
  50. void regstate(int s,
  51.               struct regexp *r,
  52.               int *trans);
  53. static void build_state(int s,
  54.                         struct regexp *r);
  55. static void build_state_zero(struct regexp *r);
  56. char *regexecute(struct regexp *r,
  57.                  char *begin,
  58.                  char *end,
  59.                  int newline,
  60.                  int *count,
  61.                  int *backref);
  62. void reginit(struct regexp *r);
  63. /* void regcompile(char * const s,
  64.                 int len,
  65.                 struct regexp *r,
  66.                 int searchflag); */
  67. void regfree(struct regexp *r);
  68. static char *icatalloc(char *old,
  69.                        char *new);
  70. static char *icpyalloc(char *string);
  71. static char *istrstr(char *lookin,
  72.                      register char *lookfor);
  73. static void ifree(char *cp);
  74. static void freelist(register char **cpp);
  75. static char **enlist(register char **cpp,
  76.                      register char *new,
  77.                      int len);
  78. static char **comsubs(char *left,
  79.                       char *right);
  80. static char **addlists(char **old,
  81.                        char **new);
  82. static char **inboth(char **left,
  83.                      char **right);
  84. static void resetmust(register struct { char **in; char *left; char *right; char *is;  }  *mp);
  85. static void regmust(register struct regexp *r);
  86. #endif
  87.  
  88.