diff options
author | Bruce Momjian <bruce@momjian.us> | 1998-02-26 04:46:47 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1998-02-26 04:46:47 +0000 |
commit | a32450a5855eed4bfd756ef292ee45d3c754665b (patch) | |
tree | 26735c3406d9f46d0f39accbe6ff1fb5cc5beedc /src/backend/regex | |
parent | 757bf69a2e259c76baed94fa06e792664ab5ed67 (diff) | |
download | postgresql-a32450a5855eed4bfd756ef292ee45d3c754665b.tar.gz postgresql-a32450a5855eed4bfd756ef292ee45d3c754665b.zip |
pgindent run before 6.3 release, with Thomas' requested changes.
Diffstat (limited to 'src/backend/regex')
-rw-r--r-- | src/backend/regex/engine.c | 114 | ||||
-rw-r--r-- | src/backend/regex/regcomp.c | 222 | ||||
-rw-r--r-- | src/backend/regex/regerror.c | 6 |
3 files changed, 171 insertions, 171 deletions
diff --git a/src/backend/regex/engine.c b/src/backend/regex/engine.c index 6679ba384ae..4801361f90f 100644 --- a/src/backend/regex/engine.c +++ b/src/backend/regex/engine.c @@ -161,12 +161,12 @@ size_t nmatch; regmatch_t pmatch[]; int eflags; { - char *endp; - int i; + char *endp; + int i; struct match mv; struct match *m = &mv; - char *dp; - const sopno gf = g->firststate + 1; /* +1 for OEND */ + char *dp; + const sopno gf = g->firststate + 1; /* +1 for OEND */ const sopno gl = g->laststate; char *start; char *stop; @@ -344,19 +344,19 @@ char *stop; sopno startst; sopno stopst; { - int i; - sopno ss; /* start sop of current subRE */ - sopno es; /* end sop of current subRE */ - char *sp; /* start of string matched by it */ - char *stp; /* string matched by it cannot pass here */ - char *rest; /* start of rest of string */ - char *tail; /* string unmatched by rest of RE */ - sopno ssub; /* start sop of subsubRE */ - sopno esub; /* end sop of subsubRE */ - char *ssp; /* start of string matched by subsubRE */ - char *sep; /* end of string matched by subsubRE */ - char *oldssp; /* previous ssp */ - char *dp; + int i; + sopno ss; /* start sop of current subRE */ + sopno es; /* end sop of current subRE */ + char *sp; /* start of string matched by it */ + char *stp; /* string matched by it cannot pass here */ + char *rest; /* start of rest of string */ + char *tail; /* string unmatched by rest of RE */ + sopno ssub; /* start sop of subsubRE */ + sopno esub; /* end sop of subsubRE */ + char *ssp; /* start of string matched by subsubRE */ + char *sep; /* end of string matched by subsubRE */ + char *oldssp; /* previous ssp */ + char *dp; AT("diss", start, stop, startst, stopst); sp = start; @@ -545,18 +545,18 @@ sopno startst; sopno stopst; sopno lev; /* PLUS nesting level */ { - int i; - sopno ss; /* start sop of current subRE */ - char *sp; /* start of string matched by it */ - sopno ssub; /* start sop of subsubRE */ - sopno esub; /* end sop of subsubRE */ - char *ssp; /* start of string matched by subsubRE */ - char *dp; - size_t len; - int hard; - sop s; - regoff_t offsave; - cset *cs; + int i; + sopno ss; /* start sop of current subRE */ + char *sp; /* start of string matched by it */ + sopno ssub; /* start sop of subsubRE */ + sopno esub; /* end sop of subsubRE */ + char *ssp; /* start of string matched by subsubRE */ + char *dp; + size_t len; + int hard; + sop s; + regoff_t offsave; + cset *cs; AT("back", start, stop, startst, stopst); sp = start; @@ -758,15 +758,15 @@ char *stop; sopno startst; sopno stopst; { - states st = m->st; - states fresh = m->fresh; - states tmp = m->tmp; - char *p = start; - int c = (start == m->beginp) ? OUT : *(start - 1); - int lastc; /* previous c */ - int flagch; - int i; - char *coldp; /* last p after which no match was + states st = m->st; + states fresh = m->fresh; + states tmp = m->tmp; + char *p = start; + int c = (start == m->beginp) ? OUT : *(start - 1); + int lastc; /* previous c */ + int flagch; + int i; + char *coldp; /* last p after which no match was * underway */ CLEAR(st); @@ -857,15 +857,15 @@ char *stop; sopno startst; sopno stopst; { - states st = m->st; - states empty = m->empty; - states tmp = m->tmp; - char *p = start; - int c = (start == m->beginp) ? OUT : *(start - 1); - int lastc; /* previous c */ - int flagch; - int i; - char *matchp; /* last p at which a match ended */ + states st = m->st; + states empty = m->empty; + states tmp = m->tmp; + char *p = start; + int c = (start == m->beginp) ? OUT : *(start - 1); + int lastc; /* previous c */ + int flagch; + int i; + char *matchp; /* last p at which a match ended */ AT("slow", start, stop, startst, stopst); CLEAR(st); @@ -957,16 +957,16 @@ step(g, start, stop, bef, ch, aft) struct re_guts *g; sopno start; /* start state within strip */ sopno stop; /* state after stop state within strip */ -states bef; /* states reachable before */ +states bef; /* states reachable before */ int ch; /* character or NONCHAR code */ -states aft; /* states already known reachable after */ +states aft; /* states already known reachable after */ { - cset *cs; - sop s; - sopno pc; - onestate here; /* note, macros know this name */ - sopno look; - int i; + cset *cs; + sop s; + sopno pc; + onestate here; /* note, macros know this name */ + sopno look; + int i; for (pc = start, INIT(here, pc); pc != stop; pc++, INC(here)) { @@ -1088,8 +1088,8 @@ int ch; FILE *d; { struct re_guts *g = m->g; - int i; - int first = 1; + int i; + int first = 1; if (!(m->eflags & REG_TRACE)) return; diff --git a/src/backend/regex/regcomp.c b/src/backend/regex/regcomp.c index 74ac3acc43a..e31f8654049 100644 --- a/src/backend/regex/regcomp.c +++ b/src/backend/regex/regcomp.c @@ -188,8 +188,8 @@ int cflags; struct parse pa; struct re_guts *g; struct parse *p = &pa; - int i; - size_t len; + int i; + size_t len; #ifdef REDEBUG #define GOODFLAGS(f) (f) @@ -294,11 +294,11 @@ p_ere(p, stop) struct parse *p; int stop; /* character this ERE should end at */ { - char c; - sopno prevback = 0; - sopno prevfwd = 0; - sopno conc; - int first = 1; /* is this the first alternative? */ + char c; + sopno prevback = 0; + sopno prevfwd = 0; + sopno conc; + int first = 1; /* is this the first alternative? */ for (;;) { @@ -342,11 +342,11 @@ static void p_ere_exp(p) struct parse *p; { - char c; - sopno pos; - int count; - int count2; - sopno subno; + char c; + sopno pos; + int count; + int count2; + sopno subno; int wascaret = 0; assert(MORE()); /* caller should have ensured this */ @@ -523,12 +523,12 @@ struct parse *p; static void p_bre(p, end1, end2) struct parse *p; -int end1; /* first terminating character */ -int end2; /* second terminating character */ +int end1; /* first terminating character */ +int end2; /* second terminating character */ { - sopno start = HERE(); - int first = 1; /* first subexpression? */ - int wasdollar = 0; + sopno start = HERE(); + int first = 1; /* first subexpression? */ + int wasdollar = 0; if (EAT('^')) { @@ -561,12 +561,12 @@ p_simp_re(p, starordinary) struct parse *p; int starordinary; /* is a leading * an ordinary character? */ { - int c; - int count; - int count2; - sopno pos; - int i; - sopno subno; + int c; + int count; + int count2; + sopno pos; + int i; + sopno subno; #define BACKSL (1<<CHAR_BIT) @@ -695,8 +695,8 @@ static int /* the value */ p_count(p) struct parse *p; { - int count = 0; - int ndigits = 0; + int count = 0; + int ndigits = 0; while (MORE() && isdigit(PEEK()) && count <= DUPMAX) { @@ -719,8 +719,8 @@ static void p_bracket(p) struct parse *p; { - cset *cs = allocset(p); - int invert = 0; + cset *cs = allocset(p); + int invert = 0; /* Dept of Truly Sickening Special-Case Kludges */ if (p->next + 5 < p->end && strncmp(p->next, "[:<:]]", 6) == 0) @@ -753,8 +753,8 @@ struct parse *p; if (p->g->cflags & REG_ICASE) { - int i; - int ci; + int i; + int ci; for (i = p->g->csetsize - 1; i >= 0; i--) if (CHIN(cs, i) && isalpha(i)) @@ -768,7 +768,7 @@ struct parse *p; } if (invert) { - int i; + int i; for (i = p->g->csetsize - 1; i >= 0; i--) if (CHIN(cs, i)) @@ -799,12 +799,12 @@ struct parse *p; static void p_b_term(p, cs) struct parse *p; -cset *cs; +cset *cs; { - char c; - char start, + char c; + char start, finish; - int i; + int i; /* classify what we've got */ switch ((MORE()) ? PEEK() : '\0') @@ -870,13 +870,13 @@ cset *cs; static void p_b_cclass(p, cs) struct parse *p; -cset *cs; +cset *cs; { - char *sp = p->next; + char *sp = p->next; struct cclass *cp; - size_t len; - char *u; - char c; + size_t len; + char *u; + char c; while (MORE() && isalpha(PEEK())) NEXT(); @@ -907,9 +907,9 @@ cset *cs; static void p_b_eclass(p, cs) struct parse *p; -cset *cs; +cset *cs; { - char c; + char c; c = p_b_coll_elem(p, '='); CHadd(cs, c); @@ -923,7 +923,7 @@ static char /* value of symbol */ p_b_symbol(p) struct parse *p; { - char value; + char value; REQUIRE(MORE(), REG_EBRACK); if (!EATTWO('[', '.')) @@ -944,9 +944,9 @@ p_b_coll_elem(p, endc) struct parse *p; int endc; /* name ended by endc,']' */ { - char *sp = p->next; + char *sp = p->next; struct cname *cp; - int len; + int len; while (MORE() && !SEETWO(endc, ']')) NEXT(); @@ -994,8 +994,8 @@ bothcases(p, ch) struct parse *p; int ch; { - char *oldnext = p->next; - char *oldend = p->end; + char *oldnext = p->next; + char *oldend = p->end; char bracket[3]; assert(othercase(ch) != ch);/* p_bracket() would recurse */ @@ -1017,9 +1017,9 @@ int ch; static void ordinary(p, ch) struct parse *p; -int ch; +int ch; { - cat_t *cap = p->g->categories; + cat_t *cap = p->g->categories; if ((p->g->cflags & REG_ICASE) && isalpha(ch) && othercase(ch) != ch) bothcases(p, ch); @@ -1041,8 +1041,8 @@ static void nonnewline(p) struct parse *p; { - char *oldnext = p->next; - char *oldend = p->end; + char *oldnext = p->next; + char *oldend = p->end; char bracket[4]; p->next = bracket; @@ -1069,13 +1069,13 @@ int from; /* repeated from this number */ int to; /* to this number of times (maybe * INFINITY) */ { - sopno finish = HERE(); + sopno finish = HERE(); #define N 2 #define INF 3 #define REP(f, t) ((f)*8 + (t)) #define MAP(n) (((n) <= 1) ? (n) : ((n) == INFINITY) ? INF : N) - sopno copy; + sopno copy; if (p->error != 0) /* head off possible runaway recursion */ return; @@ -1156,12 +1156,12 @@ static cset * allocset(p) struct parse *p; { - int no = p->g->ncsets++; - size_t nc; - size_t nbytes; - cset *cs; - size_t css = (size_t) p->g->csetsize; - int i; + int no = p->g->ncsets++; + size_t nc; + size_t nbytes; + cset *cs; + size_t css = (size_t) p->g->csetsize; + int i; if (no >= p->ncsalloc) { /* need another column of space */ @@ -1213,11 +1213,11 @@ struct parse *p; static void freeset(p, cs) struct parse *p; -cset *cs; +cset *cs; { - int i; - cset *top = &p->g->sets[p->g->ncsets]; - size_t css = (size_t) p->g->csetsize; + int i; + cset *top = &p->g->sets[p->g->ncsets]; + size_t css = (size_t) p->g->csetsize; for (i = 0; i < css; i++) CHsub(cs, i); @@ -1238,13 +1238,13 @@ cset *cs; static int /* set number */ freezeset(p, cs) struct parse *p; -cset *cs; +cset *cs; { - uch h = cs->hash; - int i; - cset *top = &p->g->sets[p->g->ncsets]; - cset *cs2; - size_t css = (size_t) p->g->csetsize; + uch h = cs->hash; + int i; + cset *top = &p->g->sets[p->g->ncsets]; + cset *cs2; + size_t css = (size_t) p->g->csetsize; /* look for an earlier one which is the same */ for (cs2 = &p->g->sets[0]; cs2 < top; cs2++) @@ -1274,10 +1274,10 @@ cset *cs; static int /* character; there is no "none" value */ firstch(p, cs) struct parse *p; -cset *cs; +cset *cs; { - int i; - size_t css = (size_t) p->g->csetsize; + int i; + size_t css = (size_t) p->g->csetsize; for (i = 0; i < css; i++) if (CHIN(cs, i)) @@ -1293,11 +1293,11 @@ cset *cs; static int nch(p, cs) struct parse *p; -cset *cs; +cset *cs; { - int i; - size_t css = (size_t) p->g->csetsize; - int n = 0; + int i; + size_t css = (size_t) p->g->csetsize; + int n = 0; for (i = 0; i < css; i++) if (CHIN(cs, i)) @@ -1313,10 +1313,10 @@ cset *cs; static void mcadd(p, cs, cp) struct parse *p; -cset *cs; -char *cp; +cset *cs; +char *cp; { - size_t oldend = cs->smultis; + size_t oldend = cs->smultis; cs->smultis += strlen(cp) + 1; if (cs->multis == NULL) @@ -1406,7 +1406,7 @@ char *cp; static void mcinvert(p, cs) struct parse *p; -cset *cs; +cset *cs; { assert(cs->multis == NULL); /* xxx */ } @@ -1421,7 +1421,7 @@ cset *cs; static void mccase(p, cs) struct parse *p; -cset *cs; +cset *cs; { assert(cs->multis == NULL); /* xxx */ } @@ -1435,10 +1435,10 @@ isinsets(g, c) struct re_guts *g; int c; { - uch *col; - int i; - int ncols = (g->ncsets + (CHAR_BIT - 1)) / CHAR_BIT; - unsigned uc = (unsigned char) c; + uch *col; + int i; + int ncols = (g->ncsets + (CHAR_BIT - 1)) / CHAR_BIT; + unsigned uc = (unsigned char) c; for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize) if (col[uc] != 0) @@ -1456,11 +1456,11 @@ struct re_guts *g; int c1; int c2; { - uch *col; - int i; - int ncols = (g->ncsets + (CHAR_BIT - 1)) / CHAR_BIT; - unsigned uc1 = (unsigned char) c1; - unsigned uc2 = (unsigned char) c2; + uch *col; + int i; + int ncols = (g->ncsets + (CHAR_BIT - 1)) / CHAR_BIT; + unsigned uc1 = (unsigned char) c1; + unsigned uc2 = (unsigned char) c2; for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize) if (col[uc1] != col[uc2]) @@ -1477,10 +1477,10 @@ categorize(p, g) struct parse *p; struct re_guts *g; { - cat_t *cats = g->categories; - int c; - int c2; - cat_t cat; + cat_t *cats = g->categories; + int c; + int c2; + cat_t cat; /* avoid making error situations worse */ if (p->error != 0) @@ -1507,8 +1507,8 @@ struct parse *p; sopno start; /* from here */ sopno finish; /* to this less one */ { - sopno ret = HERE(); - sopno len = finish - start; + sopno ret = HERE(); + sopno len = finish - start; assert(finish >= start); if (len == 0) @@ -1562,9 +1562,9 @@ sop op; size_t opnd; sopno pos; { - sopno sn; - sop s; - int i; + sopno sn; + sop s; + int i; /* avoid making error situations worse */ if (p->error != 0) @@ -1601,7 +1601,7 @@ sopno pos; static void dofwd(p, pos, value) struct parse *p; -sopno pos; +sopno pos; sop value; { /* avoid making error situations worse */ @@ -1619,9 +1619,9 @@ sop value; static void enlarge(p, size) struct parse *p; -sopno size; +sopno size; { - sop *sp; + sop *sp; if (p->ssize >= size) return; @@ -1669,13 +1669,13 @@ findmust(p, g) struct parse *p; struct re_guts *g; { - sop *scan; + sop *scan; sop *start = 0; - sop *newstart = 0; - sopno newlen; - sop s; - char *cp; - sopno i; + sop *newstart = 0; + sopno newlen; + sop s; + char *cp; + sopno i; /* avoid making error situations worse */ if (p->error != 0) @@ -1757,10 +1757,10 @@ pluscount(p, g) struct parse *p; struct re_guts *g; { - sop *scan; - sop s; - sopno plusnest = 0; - sopno maxnest = 0; + sop *scan; + sop s; + sopno plusnest = 0; + sopno maxnest = 0; if (p->error != 0) return (0); /* there may not be an OEND */ diff --git a/src/backend/regex/regerror.c b/src/backend/regex/regerror.c index 3125e1cc96d..a8ba2443c5f 100644 --- a/src/backend/regex/regerror.c +++ b/src/backend/regex/regerror.c @@ -161,9 +161,9 @@ char *errbuf; size_t errbuf_size; { struct rerr *r; - size_t len; - int target = errcode & ~REG_ITOA; - char *s; + size_t len; + int target = errcode & ~REG_ITOA; + char *s; char convbuf[50]; if (errcode == REG_ATOI) |