summaryrefslogtreecommitdiffstats
path: root/generic/regcomp.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2005-11-02 14:51:04 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2005-11-02 14:51:04 (GMT)
commit4f31953cdce3f382551e258f2ff7c157d7c4908f (patch)
tree26e138a11c8ea34a812efae189c0b32260bed314 /generic/regcomp.c
parent41aa65744a309bd290f9d3a764be958446340687 (diff)
downloadtcl-4f31953cdce3f382551e258f2ff7c157d7c4908f.zip
tcl-4f31953cdce3f382551e258f2ff7c157d7c4908f.tar.gz
tcl-4f31953cdce3f382551e258f2ff7c157d7c4908f.tar.bz2
ANSIfy; generic/*.c now all done except for test code
Diffstat (limited to 'generic/regcomp.c')
-rw-r--r--generic/regcomp.c266
1 files changed, 133 insertions, 133 deletions
diff --git a/generic/regcomp.c b/generic/regcomp.c
index 29be00f..b94cb8f 100644
--- a/generic/regcomp.c
+++ b/generic/regcomp.c
@@ -38,155 +38,155 @@
/* =====^!^===== begin forwards =====^!^===== */
/* automatically gathered by fwd; do not hand-edit */
/* === regcomp.c === */
-int compile _ANSI_ARGS_((regex_t *, CONST chr *, size_t, int));
-static VOID moresubs _ANSI_ARGS_((struct vars *, int));
-static int freev _ANSI_ARGS_((struct vars *, int));
-static VOID makesearch _ANSI_ARGS_((struct vars *, struct nfa *));
-static struct subre *parse _ANSI_ARGS_((struct vars *, int, int, struct state *, struct state *));
-static struct subre *parsebranch _ANSI_ARGS_((struct vars *, int, int, struct state *, struct state *, int));
-static VOID parseqatom _ANSI_ARGS_((struct vars *, int, int, struct state *, struct state *, struct subre *));
-static VOID nonword _ANSI_ARGS_((struct vars *, int, struct state *, struct state *));
-static VOID word _ANSI_ARGS_((struct vars *, int, struct state *, struct state *));
-static int scannum _ANSI_ARGS_((struct vars *));
-static VOID repeat _ANSI_ARGS_((struct vars *, struct state *, struct state *, int, int));
-static VOID bracket _ANSI_ARGS_((struct vars *, struct state *, struct state *));
-static VOID cbracket _ANSI_ARGS_((struct vars *, struct state *, struct state *));
-static VOID brackpart _ANSI_ARGS_((struct vars *, struct state *, struct state *));
-static chr *scanplain _ANSI_ARGS_((struct vars *));
-static VOID leaders _ANSI_ARGS_((struct vars *, struct cvec *));
-static VOID onechr _ANSI_ARGS_((struct vars *, pchr, struct state *, struct state *));
-static VOID dovec _ANSI_ARGS_((struct vars *, struct cvec *, struct state *, struct state *));
-static celt nextleader _ANSI_ARGS_((struct vars *, pchr, pchr));
-static VOID wordchrs _ANSI_ARGS_((struct vars *));
-static struct subre *subre _ANSI_ARGS_((struct vars *, int, int, struct state *, struct state *));
-static VOID freesubre _ANSI_ARGS_((struct vars *, struct subre *));
-static VOID freesrnode _ANSI_ARGS_((struct vars *, struct subre *));
-static VOID optst _ANSI_ARGS_((struct vars *, struct subre *));
-static int numst _ANSI_ARGS_((struct subre *, int));
-static VOID markst _ANSI_ARGS_((struct subre *));
-static VOID cleanst _ANSI_ARGS_((struct vars *));
-static long nfatree _ANSI_ARGS_((struct vars *, struct subre *, FILE *));
-static long nfanode _ANSI_ARGS_((struct vars *, struct subre *, FILE *));
-static int newlacon _ANSI_ARGS_((struct vars *, struct state *, struct state *, int));
-static VOID freelacons _ANSI_ARGS_((struct subre *, int));
-static VOID rfree _ANSI_ARGS_((regex_t *));
-static VOID dump _ANSI_ARGS_((regex_t *, FILE *));
-static VOID dumpst _ANSI_ARGS_((struct subre *, FILE *, int));
-static VOID stdump _ANSI_ARGS_((struct subre *, FILE *, int));
-static char *stid _ANSI_ARGS_((struct subre *, char *, size_t));
+int compile(regex_t *, CONST chr *, size_t, int);
+static VOID moresubs(struct vars *, int);
+static int freev(struct vars *, int);
+static VOID makesearch(struct vars *, struct nfa *);
+static struct subre *parse(struct vars *, int, int, struct state *, struct state *);
+static struct subre *parsebranch(struct vars *, int, int, struct state *, struct state *, int);
+static VOID parseqatom(struct vars *, int, int, struct state *, struct state *, struct subre *);
+static VOID nonword(struct vars *, int, struct state *, struct state *);
+static VOID word(struct vars *, int, struct state *, struct state *);
+static int scannum(struct vars *);
+static VOID repeat(struct vars *, struct state *, struct state *, int, int);
+static VOID bracket(struct vars *, struct state *, struct state *);
+static VOID cbracket(struct vars *, struct state *, struct state *);
+static VOID brackpart(struct vars *, struct state *, struct state *);
+static chr *scanplain(struct vars *);
+static VOID leaders(struct vars *, struct cvec *);
+static VOID onechr(struct vars *, pchr, struct state *, struct state *);
+static VOID dovec(struct vars *, struct cvec *, struct state *, struct state *);
+static celt nextleader(struct vars *, pchr, pchr);
+static VOID wordchrs(struct vars *);
+static struct subre *subre(struct vars *, int, int, struct state *, struct state *);
+static VOID freesubre(struct vars *, struct subre *);
+static VOID freesrnode(struct vars *, struct subre *);
+static VOID optst(struct vars *, struct subre *);
+static int numst(struct subre *, int);
+static VOID markst(struct subre *);
+static VOID cleanst(struct vars *);
+static long nfatree(struct vars *, struct subre *, FILE *);
+static long nfanode(struct vars *, struct subre *, FILE *);
+static int newlacon(struct vars *, struct state *, struct state *, int);
+static VOID freelacons(struct subre *, int);
+static VOID rfree(regex_t *);
+static VOID dump(regex_t *, FILE *);
+static VOID dumpst(struct subre *, FILE *, int);
+static VOID stdump(struct subre *, FILE *, int);
+static char *stid(struct subre *, char *, size_t);
/* === regc_lex.c === */
-static VOID lexstart _ANSI_ARGS_((struct vars *));
-static VOID prefixes _ANSI_ARGS_((struct vars *));
-static VOID lexnest _ANSI_ARGS_((struct vars *, chr *, chr *));
-static VOID lexword _ANSI_ARGS_((struct vars *));
-static int next _ANSI_ARGS_((struct vars *));
-static int lexescape _ANSI_ARGS_((struct vars *));
-static chr lexdigits _ANSI_ARGS_((struct vars *, int, int, int));
-static int brenext _ANSI_ARGS_((struct vars *, pchr));
-static VOID skip _ANSI_ARGS_((struct vars *));
-static chr newline _ANSI_ARGS_((NOPARMS));
+static VOID lexstart(struct vars *);
+static VOID prefixes(struct vars *);
+static VOID lexnest(struct vars *, chr *, chr *);
+static VOID lexword(struct vars *);
+static int next(struct vars *);
+static int lexescape(struct vars *);
+static chr lexdigits(struct vars *, int, int, int);
+static int brenext(struct vars *, pchr);
+static VOID skip(struct vars *);
+static chr newline(NOPARMS);
#ifdef REG_DEBUG
-static chr *ch _ANSI_ARGS_((NOPARMS));
+static chr *ch(NOPARMS);
#endif
-static chr chrnamed _ANSI_ARGS_((struct vars *, chr *, chr *, pchr));
+static chr chrnamed(struct vars *, chr *, chr *, pchr);
/* === regc_color.c === */
-static VOID initcm _ANSI_ARGS_((struct vars *, struct colormap *));
-static VOID freecm _ANSI_ARGS_((struct colormap *));
-static VOID cmtreefree _ANSI_ARGS_((struct colormap *, union tree *, int));
-static color setcolor _ANSI_ARGS_((struct colormap *, pchr, pcolor));
-static color maxcolor _ANSI_ARGS_((struct colormap *));
-static color newcolor _ANSI_ARGS_((struct colormap *));
-static VOID freecolor _ANSI_ARGS_((struct colormap *, pcolor));
-static color pseudocolor _ANSI_ARGS_((struct colormap *));
-static color subcolor _ANSI_ARGS_((struct colormap *, pchr c));
-static color newsub _ANSI_ARGS_((struct colormap *, pcolor));
-static VOID subrange _ANSI_ARGS_((struct vars *, pchr, pchr, struct state *, struct state *));
-static VOID subblock _ANSI_ARGS_((struct vars *, pchr, struct state *, struct state *));
-static VOID okcolors _ANSI_ARGS_((struct nfa *, struct colormap *));
-static VOID colorchain _ANSI_ARGS_((struct colormap *, struct arc *));
-static VOID uncolorchain _ANSI_ARGS_((struct colormap *, struct arc *));
-static int singleton _ANSI_ARGS_((struct colormap *, pchr c));
-static VOID rainbow _ANSI_ARGS_((struct nfa *, struct colormap *, int, pcolor, struct state *, struct state *));
-static VOID colorcomplement _ANSI_ARGS_((struct nfa *, struct colormap *, int, struct state *, struct state *, struct state *));
+static VOID initcm(struct vars *, struct colormap *);
+static VOID freecm(struct colormap *);
+static VOID cmtreefree(struct colormap *, union tree *, int);
+static color setcolor(struct colormap *, pchr, pcolor);
+static color maxcolor(struct colormap *);
+static color newcolor(struct colormap *);
+static VOID freecolor(struct colormap *, pcolor);
+static color pseudocolor(struct colormap *);
+static color subcolor(struct colormap *, pchr c);
+static color newsub(struct colormap *, pcolor);
+static VOID subrange(struct vars *, pchr, pchr, struct state *, struct state *);
+static VOID subblock(struct vars *, pchr, struct state *, struct state *);
+static VOID okcolors(struct nfa *, struct colormap *);
+static VOID colorchain(struct colormap *, struct arc *);
+static VOID uncolorchain(struct colormap *, struct arc *);
+static int singleton(struct colormap *, pchr c);
+static VOID rainbow(struct nfa *, struct colormap *, int, pcolor, struct state *, struct state *);
+static VOID colorcomplement(struct nfa *, struct colormap *, int, struct state *, struct state *, struct state *);
#ifdef REG_DEBUG
-static VOID dumpcolors _ANSI_ARGS_((struct colormap *, FILE *));
-static VOID fillcheck _ANSI_ARGS_((struct colormap *, union tree *, int, FILE *));
-static VOID dumpchr _ANSI_ARGS_((pchr, FILE *));
+static VOID dumpcolors(struct colormap *, FILE *);
+static VOID fillcheck(struct colormap *, union tree *, int, FILE *);
+static VOID dumpchr(pchr, FILE *);
#endif
/* === regc_nfa.c === */
-static struct nfa *newnfa _ANSI_ARGS_((struct vars *, struct colormap *, struct nfa *));
-static VOID freenfa _ANSI_ARGS_((struct nfa *));
-static struct state *newstate _ANSI_ARGS_((struct nfa *));
-static struct state *newfstate _ANSI_ARGS_((struct nfa *, int flag));
-static VOID dropstate _ANSI_ARGS_((struct nfa *, struct state *));
-static VOID freestate _ANSI_ARGS_((struct nfa *, struct state *));
-static VOID destroystate _ANSI_ARGS_((struct nfa *, struct state *));
-static VOID newarc _ANSI_ARGS_((struct nfa *, int, pcolor, struct state *, struct state *));
-static struct arc *allocarc _ANSI_ARGS_((struct nfa *, struct state *));
-static VOID freearc _ANSI_ARGS_((struct nfa *, struct arc *));
-static struct arc *findarc _ANSI_ARGS_((struct state *, int, pcolor));
-static VOID cparc _ANSI_ARGS_((struct nfa *, struct arc *, struct state *, struct state *));
-static VOID moveins _ANSI_ARGS_((struct nfa *, struct state *, struct state *));
-static VOID copyins _ANSI_ARGS_((struct nfa *, struct state *, struct state *));
-static VOID moveouts _ANSI_ARGS_((struct nfa *, struct state *, struct state *));
-static VOID copyouts _ANSI_ARGS_((struct nfa *, struct state *, struct state *));
-static VOID cloneouts _ANSI_ARGS_((struct nfa *, struct state *, struct state *, struct state *, int));
-static VOID delsub _ANSI_ARGS_((struct nfa *, struct state *, struct state *));
-static VOID deltraverse _ANSI_ARGS_((struct nfa *, struct state *, struct state *));
-static VOID dupnfa _ANSI_ARGS_((struct nfa *, struct state *, struct state *, struct state *, struct state *));
-static VOID duptraverse _ANSI_ARGS_((struct nfa *, struct state *, struct state *));
-static VOID cleartraverse _ANSI_ARGS_((struct nfa *, struct state *));
-static VOID specialcolors _ANSI_ARGS_((struct nfa *));
-static long optimize _ANSI_ARGS_((struct nfa *, FILE *));
-static VOID pullback _ANSI_ARGS_((struct nfa *, FILE *));
-static int pull _ANSI_ARGS_((struct nfa *, struct arc *));
-static VOID pushfwd _ANSI_ARGS_((struct nfa *, FILE *));
-static int push _ANSI_ARGS_((struct nfa *, struct arc *));
+static struct nfa *newnfa(struct vars *, struct colormap *, struct nfa *);
+static VOID freenfa(struct nfa *);
+static struct state *newstate(struct nfa *);
+static struct state *newfstate(struct nfa *, int flag);
+static VOID dropstate(struct nfa *, struct state *);
+static VOID freestate(struct nfa *, struct state *);
+static VOID destroystate(struct nfa *, struct state *);
+static VOID newarc(struct nfa *, int, pcolor, struct state *, struct state *);
+static struct arc *allocarc(struct nfa *, struct state *);
+static VOID freearc(struct nfa *, struct arc *);
+static struct arc *findarc(struct state *, int, pcolor);
+static VOID cparc(struct nfa *, struct arc *, struct state *, struct state *);
+static VOID moveins(struct nfa *, struct state *, struct state *);
+static VOID copyins(struct nfa *, struct state *, struct state *);
+static VOID moveouts(struct nfa *, struct state *, struct state *);
+static VOID copyouts(struct nfa *, struct state *, struct state *);
+static VOID cloneouts(struct nfa *, struct state *, struct state *, struct state *, int);
+static VOID delsub(struct nfa *, struct state *, struct state *);
+static VOID deltraverse(struct nfa *, struct state *, struct state *);
+static VOID dupnfa(struct nfa *, struct state *, struct state *, struct state *, struct state *);
+static VOID duptraverse(struct nfa *, struct state *, struct state *);
+static VOID cleartraverse(struct nfa *, struct state *);
+static VOID specialcolors(struct nfa *);
+static long optimize(struct nfa *, FILE *);
+static VOID pullback(struct nfa *, FILE *);
+static int pull(struct nfa *, struct arc *);
+static VOID pushfwd(struct nfa *, FILE *);
+static int push(struct nfa *, struct arc *);
#define INCOMPATIBLE 1 /* destroys arc */
#define SATISFIED 2 /* constraint satisfied */
#define COMPATIBLE 3 /* compatible but not satisfied yet */
-static int combine _ANSI_ARGS_((struct arc *, struct arc *));
-static VOID fixempties _ANSI_ARGS_((struct nfa *, FILE *));
-static int unempty _ANSI_ARGS_((struct nfa *, struct arc *));
-static VOID cleanup _ANSI_ARGS_((struct nfa *));
-static VOID markreachable _ANSI_ARGS_((struct nfa *, struct state *, struct state *, struct state *));
-static VOID markcanreach _ANSI_ARGS_((struct nfa *, struct state *, struct state *, struct state *));
-static long analyze _ANSI_ARGS_((struct nfa *));
-static VOID compact _ANSI_ARGS_((struct nfa *, struct cnfa *));
-static VOID carcsort _ANSI_ARGS_((struct carc *, struct carc *));
-static VOID freecnfa _ANSI_ARGS_((struct cnfa *));
-static VOID dumpnfa _ANSI_ARGS_((struct nfa *, FILE *));
+static int combine(struct arc *, struct arc *);
+static VOID fixempties(struct nfa *, FILE *);
+static int unempty(struct nfa *, struct arc *);
+static VOID cleanup(struct nfa *);
+static VOID markreachable(struct nfa *, struct state *, struct state *, struct state *);
+static VOID markcanreach(struct nfa *, struct state *, struct state *, struct state *);
+static long analyze(struct nfa *);
+static VOID compact(struct nfa *, struct cnfa *);
+static VOID carcsort(struct carc *, struct carc *);
+static VOID freecnfa(struct cnfa *);
+static VOID dumpnfa(struct nfa *, FILE *);
#ifdef REG_DEBUG
-static VOID dumpstate _ANSI_ARGS_((struct state *, FILE *));
-static VOID dumparcs _ANSI_ARGS_((struct state *, FILE *));
-static int dumprarcs _ANSI_ARGS_((struct arc *, struct state *, FILE *, int));
-static VOID dumparc _ANSI_ARGS_((struct arc *, struct state *, FILE *));
+static VOID dumpstate(struct state *, FILE *);
+static VOID dumparcs(struct state *, FILE *);
+static int dumprarcs(struct arc *, struct state *, FILE *, int);
+static VOID dumparc(struct arc *, struct state *, FILE *);
#endif
-static VOID dumpcnfa _ANSI_ARGS_((struct cnfa *, FILE *));
+static VOID dumpcnfa(struct cnfa *, FILE *);
#ifdef REG_DEBUG
-static VOID dumpcstate _ANSI_ARGS_((int, struct carc *, struct cnfa *, FILE *));
+static VOID dumpcstate(int, struct carc *, struct cnfa *, FILE *);
#endif
/* === regc_cvec.c === */
-static struct cvec *newcvec _ANSI_ARGS_((int, int, int));
-static struct cvec *clearcvec _ANSI_ARGS_((struct cvec *));
-static VOID addchr _ANSI_ARGS_((struct cvec *, pchr));
-static VOID addrange _ANSI_ARGS_((struct cvec *, pchr, pchr));
-static VOID addmcce _ANSI_ARGS_((struct cvec *, chr *, chr *));
-static int haschr _ANSI_ARGS_((struct cvec *, pchr));
-static struct cvec *getcvec _ANSI_ARGS_((struct vars *, int, int, int));
-static VOID freecvec _ANSI_ARGS_((struct cvec *));
+static struct cvec *newcvec(int, int, int);
+static struct cvec *clearcvec(struct cvec *);
+static VOID addchr(struct cvec *, pchr);
+static VOID addrange(struct cvec *, pchr, pchr);
+static VOID addmcce(struct cvec *, chr *, chr *);
+static int haschr(struct cvec *, pchr);
+static struct cvec *getcvec(struct vars *, int, int, int);
+static VOID freecvec(struct cvec *);
/* === regc_locale.c === */
-static int nmcces _ANSI_ARGS_((struct vars *));
-static int nleaders _ANSI_ARGS_((struct vars *));
-static struct cvec *allmcces _ANSI_ARGS_((struct vars *, struct cvec *));
-static celt element _ANSI_ARGS_((struct vars *, chr *, chr *));
-static struct cvec *range _ANSI_ARGS_((struct vars *, celt, celt, int));
-static int before _ANSI_ARGS_((celt, celt));
-static struct cvec *eclass _ANSI_ARGS_((struct vars *, celt, int));
-static struct cvec *cclass _ANSI_ARGS_((struct vars *, chr *, chr *, int));
-static struct cvec *allcases _ANSI_ARGS_((struct vars *, pchr));
-static int cmp _ANSI_ARGS_((CONST chr *, CONST chr *, size_t));
-static int casecmp _ANSI_ARGS_((CONST chr *, CONST chr *, size_t));
+static int nmcces(struct vars *);
+static int nleaders(struct vars *);
+static struct cvec *allmcces(struct vars *, struct cvec *);
+static celt element(struct vars *, chr *, chr *);
+static struct cvec *range(struct vars *, celt, celt, int);
+static int before(celt, celt);
+static struct cvec *eclass(struct vars *, celt, int);
+static struct cvec *cclass(struct vars *, chr *, chr *, int);
+static struct cvec *allcases(struct vars *, pchr);
+static int cmp(CONST chr *, CONST chr *, size_t);
+static int casecmp(CONST chr *, CONST chr *, size_t);
/* automatically gathered by fwd; do not hand-edit */
/* =====^!^===== end forwards =====^!^===== */