diff options
author | dgp <dgp@users.sourceforge.net> | 2015-10-19 19:32:04 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2015-10-19 19:32:04 (GMT) |
commit | 8ed7672ab71b54afa94e164e73fdc274b0b39771 (patch) | |
tree | 4da041e80ad7a2639abcff0694fe8ed6d2e77d3b /generic/regcomp.c | |
parent | b8c0c06fdf9f099f27f114fc9c92b7786dce13a5 (diff) | |
download | tcl-8ed7672ab71b54afa94e164e73fdc274b0b39771.zip tcl-8ed7672ab71b54afa94e164e73fdc274b0b39771.tar.gz tcl-8ed7672ab71b54afa94e164e73fdc274b0b39771.tar.bz2 |
Adaptation of re-oNsquared.patch from Tom Lane @ postgres.
Diffstat (limited to 'generic/regcomp.c')
-rw-r--r-- | generic/regcomp.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/generic/regcomp.c b/generic/regcomp.c index 27bb736..b01311b 100644 --- a/generic/regcomp.c +++ b/generic/regcomp.c @@ -119,15 +119,22 @@ 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 void createarc(struct nfa *, int, pcolor, struct state *, struct state *); static struct arc *allocarc(struct nfa *, struct state *); static void freearc(struct nfa *, struct arc *); +static void changearctarget(struct arc *, struct state *); static int hasnonemptyout(struct state *); static int nonemptyouts(struct state *); static int nonemptyins(struct state *); static struct arc *findarc(struct state *, int, pcolor); static void cparc(struct nfa *, struct arc *, struct state *, struct state *); +static void sortins(struct nfa *, struct state *); +static int sortins_cmp(const void *, const void *); +static void sortouts(struct nfa *, struct state *); +static int sortouts_cmp(const void *, const void *); static void moveins(struct nfa *, struct state *, struct state *); static void copyins(struct nfa *, struct state *, struct state *, int); +static void mergeins(struct nfa *, struct state *, struct arc **, int); static void moveouts(struct nfa *, struct state *, struct state *); static void copyouts(struct nfa *, struct state *, struct state *, int); static void cloneouts(struct nfa *, struct state *, struct state *, struct state *, int); @@ -161,7 +168,8 @@ static void markreachable(struct nfa *, struct state *, struct state *, struct s 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 carcsort(struct carc *, size_t); +static int carc_cmp(const void *, const void *); static void freecnfa(struct cnfa *); static void dumpnfa(struct nfa *, FILE *); #ifdef REG_DEBUG |