diff options
author | Peter Geoghegan <pg@bowt.ie> | 2022-09-19 15:10:24 -0700 |
---|---|---|
committer | Peter Geoghegan <pg@bowt.ie> | 2022-09-19 15:10:24 -0700 |
commit | bc2187ed63c56bb9cd99f6613f3e2ba56afb22fe (patch) | |
tree | 40963e36426b80b7288c028c1af82a3c078e6a50 /src/backend/regex/regexec.c | |
parent | 55b4966365fa76bda275c409f3aefad43243f12c (diff) | |
download | postgresql-bc2187ed63c56bb9cd99f6613f3e2ba56afb22fe.tar.gz postgresql-bc2187ed63c56bb9cd99f6613f3e2ba56afb22fe.zip |
Consistently use named parameters in regex code.
Make regex code consistently use named parameters in function
declarations. Also make sure that parameter names from each function's
declaration match corresponding definition parameter names.
This makes Henry Spencer's regex code follow Postgres coding standards.
Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com
Diffstat (limited to 'src/backend/regex/regexec.c')
-rw-r--r-- | src/backend/regex/regexec.c | 65 |
1 files changed, 37 insertions, 28 deletions
diff --git a/src/backend/regex/regexec.c b/src/backend/regex/regexec.c index 92715443606..29c364f3db1 100644 --- a/src/backend/regex/regexec.c +++ b/src/backend/regex/regexec.c @@ -137,36 +137,45 @@ struct vars * forward declarations */ /* === regexec.c === */ -static struct dfa *getsubdfa(struct vars *, struct subre *); -static struct dfa *getladfa(struct vars *, int); -static int find(struct vars *, struct cnfa *, struct colormap *); -static int cfind(struct vars *, struct cnfa *, struct colormap *); -static int cfindloop(struct vars *, struct cnfa *, struct colormap *, struct dfa *, struct dfa *, chr **); -static void zapallsubs(regmatch_t *, size_t); -static void zaptreesubs(struct vars *, struct subre *); -static void subset(struct vars *, struct subre *, chr *, chr *); -static int cdissect(struct vars *, struct subre *, chr *, chr *); -static int ccondissect(struct vars *, struct subre *, chr *, chr *); -static int crevcondissect(struct vars *, struct subre *, chr *, chr *); -static int cbrdissect(struct vars *, struct subre *, chr *, chr *); -static int caltdissect(struct vars *, struct subre *, chr *, chr *); -static int citerdissect(struct vars *, struct subre *, chr *, chr *); -static int creviterdissect(struct vars *, struct subre *, chr *, chr *); +static struct dfa *getsubdfa(struct vars *v, struct subre *t); +static struct dfa *getladfa(struct vars *v, int n); +static int find(struct vars *v, struct cnfa *cnfa, struct colormap *cm); +static int cfind(struct vars *v, struct cnfa *cnfa, struct colormap *cm); +static int cfindloop(struct vars *v, struct cnfa *cnfa, struct colormap *cm, + struct dfa *d, struct dfa *s, chr **coldp); +static void zapallsubs(regmatch_t *p, size_t n); +static void zaptreesubs(struct vars *v, struct subre *t); +static void subset(struct vars *v, struct subre *sub, chr *begin, chr *end); +static int cdissect(struct vars *v, struct subre *t, chr *begin, chr *end); +static int ccondissect(struct vars *v, struct subre *t, chr *begin, chr *end); +static int crevcondissect(struct vars *v, struct subre *t, chr *begin, chr *end); +static int cbrdissect(struct vars *v, struct subre *t, chr *begin, chr *end); +static int caltdissect(struct vars *v, struct subre *t, chr *begin, chr *end); +static int citerdissect(struct vars *v, struct subre *t, chr *begin, chr *end); +static int creviterdissect(struct vars *v, struct subre *t, chr *begin, chr *end); /* === rege_dfa.c === */ -static chr *longest(struct vars *, struct dfa *, chr *, chr *, int *); -static chr *shortest(struct vars *, struct dfa *, chr *, chr *, chr *, chr **, int *); -static int matchuntil(struct vars *, struct dfa *, chr *, struct sset **, chr **); -static chr *dfa_backref(struct vars *, struct dfa *, chr *, chr *, chr *, bool); -static chr *lastcold(struct vars *, struct dfa *); -static struct dfa *newdfa(struct vars *, struct cnfa *, struct colormap *, struct smalldfa *); -static void freedfa(struct dfa *); -static unsigned hash(unsigned *, int); -static struct sset *initialize(struct vars *, struct dfa *, chr *); -static struct sset *miss(struct vars *, struct dfa *, struct sset *, color, chr *, chr *); -static int lacon(struct vars *, struct cnfa *, chr *, color); -static struct sset *getvacant(struct vars *, struct dfa *, chr *, chr *); -static struct sset *pickss(struct vars *, struct dfa *, chr *, chr *); +static chr *longest(struct vars *v, struct dfa *d, + chr *start, chr *stop, int *hitstopp); +static chr *shortest(struct vars *v, struct dfa *d, chr *start, chr *min, + chr *max, chr **coldp, int *hitstopp); +static int matchuntil(struct vars *v, struct dfa *d, chr *probe, + struct sset **lastcss, chr **lastcp); +static chr *dfa_backref(struct vars *v, struct dfa *d, chr *start, + chr *min, chr *max, bool shortest); +static chr *lastcold(struct vars *v, struct dfa *d); +static struct dfa *newdfa(struct vars *v, struct cnfa *cnfa, + struct colormap *cm, struct smalldfa *sml); +static void freedfa(struct dfa *d); +static unsigned hash(unsigned *uv, int n); +static struct sset *initialize(struct vars *v, struct dfa *d, chr *start); +static struct sset *miss(struct vars *v, struct dfa *d, struct sset *css, + color co, chr *cp, chr *start); +static int lacon(struct vars *v, struct cnfa *pcnfa, chr *cp, color co); +static struct sset *getvacant(struct vars *v, struct dfa *d, chr *cp, + chr *start); +static struct sset *pickss(struct vars *v, struct dfa *d, chr *cp, + chr *start); /* |