This commit is contained in:
junyoung 2007-02-08 05:44:18 +00:00
parent f7a084b3b0
commit 9641e3f094
5 changed files with 205 additions and 205 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: engine.c,v 1.20 2007/02/08 05:07:23 junyoung Exp $ */
/* $NetBSD: engine.c,v 1.21 2007/02/08 05:44:18 junyoung Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@ -173,12 +173,12 @@ static int nope = 0;
== size_t nmatch, regmatch_t pmatch[], int eflags);
*/
static int /* 0 success, REG_NOMATCH failure */
matcher(g, string, nmatch, pmatch, eflags)
struct re_guts *g;
const char *string;
size_t nmatch;
regmatch_t pmatch[];
int eflags;
matcher(
struct re_guts *g,
const char *string,
size_t nmatch,
regmatch_t pmatch[],
int eflags)
{
const char *endp;
int i;
@ -350,12 +350,12 @@ done:
== const char *stop, sopno startst, sopno stopst);
*/
static const char * /* == stop (success) always */
dissect(m, start, stop, startst, stopst)
struct match *m;
const char *start;
const char *stop;
sopno startst;
sopno stopst;
dissect(
struct match *m,
const char *start,
const char *stop,
sopno startst,
sopno stopst)
{
int i;
sopno ss; /* start sop of current subRE */
@ -559,13 +559,13 @@ sopno stopst;
== const char *stop, sopno startst, sopno stopst, sopno lev);
*/
static const char * /* == stop (success) or NULL (failure) */
backref(m, start, stop, startst, stopst, lev)
struct match *m;
const char *start;
const char *stop;
sopno startst;
sopno stopst;
sopno lev; /* PLUS nesting level */
backref(
struct match *m,
const char *start,
const char *stop,
sopno startst,
sopno stopst,
sopno lev) /* PLUS nesting level */
{
int i;
sopno ss; /* start sop of current subRE */
@ -769,12 +769,12 @@ sopno lev; /* PLUS nesting level */
== const char *stop, sopno startst, sopno stopst);
*/
static const char * /* where tentative match ended, or NULL */
fast(m, start, stop, startst, stopst)
struct match *m;
const char *start;
const char *stop;
sopno startst;
sopno stopst;
fast(
struct match *m,
const char *start,
const char *stop,
sopno startst,
sopno stopst)
{
states st = m->st;
states fresh = m->fresh;
@ -864,12 +864,12 @@ sopno stopst;
== const char *stop, sopno startst, sopno stopst);
*/
static const char * /* where it ended */
slow(m, start, stop, startst, stopst)
struct match *m;
const char *start;
const char *stop;
sopno startst;
sopno stopst;
slow(
struct match *m,
const char *start,
const char *stop,
sopno startst,
sopno stopst)
{
states st = m->st;
states empty = m->empty;
@ -964,13 +964,13 @@ sopno stopst;
== #define NNONCHAR (CODEMAX-CHAR_MAX)
*/
static states
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 */
int ch; /* character or NONCHAR code */
states aft; /* states already known reachable after */
step(
struct re_guts *g,
sopno start, /* start state within strip */
sopno stop, /* state after stop state within strip */
states bef, /* states reachable before */
int ch, /* character or NONCHAR code */
states aft) /* states already known reachable after */
{
cset *cs;
sop s;
@ -1088,12 +1088,12 @@ states aft; /* states already known reachable after */
== #endif
*/
static void
print(m, caption, st, ch, d)
struct match *m;
char *caption;
states st;
int ch;
FILE *d;
print(
struct match *m,
char *caption,
states st,
int ch,
FILE *d)
{
struct re_guts *g = m->g;
int i;
@ -1126,13 +1126,13 @@ FILE *d;
== #endif
*/
static void
at(m, title, start, stop, startst, stopst)
struct match *m;
char *title;
char *start;
char *stop;
sopno startst;
sopno stopst;
at(
struct match *m,
char *title,
char *start,
char *stop,
sopno startst,
sopno stopst)
{
_DIAGASSERT(m != NULL);
@ -1162,8 +1162,8 @@ sopno stopst;
* the non-debug compilation anyway, so it doesn't matter much.
*/
static char * /* -> representation */
pchar(ch)
int ch;
pchar(
int ch)
{
static char pbuf[10];

View File

@ -1,4 +1,4 @@
/* $NetBSD: regcomp.c,v 1.26 2007/02/08 05:07:23 junyoung Exp $ */
/* $NetBSD: regcomp.c,v 1.27 2007/02/08 05:44:18 junyoung Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@ -76,7 +76,7 @@
#if 0
static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94";
#else
__RCSID("$NetBSD: regcomp.c,v 1.26 2007/02/08 05:07:23 junyoung Exp $");
__RCSID("$NetBSD: regcomp.c,v 1.27 2007/02/08 05:44:18 junyoung Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -224,10 +224,10 @@ static int never = 0; /* for use in asserts; shuts lint up */
= #define REG_DUMP 0200
*/
int /* 0 success, otherwise REG_something */
regcomp(preg, pattern, cflags)
regex_t *preg;
const char *pattern;
int cflags;
regcomp(
regex_t *preg,
const char *pattern,
int cflags)
{
struct parse pa;
struct re_guts *g;
@ -331,9 +331,9 @@ int cflags;
== static void p_ere(struct parse *p, int stop);
*/
static void
p_ere(p, stop)
struct parse *p;
int stop; /* character this ERE should end at */
p_ere(
struct parse *p,
int stop) /* character this ERE should end at */
{
char c;
sopno prevback = 0; /* pacify gcc */
@ -379,8 +379,8 @@ int stop; /* character this ERE should end at */
== static void p_ere_exp(struct parse *p);
*/
static void
p_ere_exp(p)
struct parse *p;
p_ere_exp(
struct parse *p)
{
char c;
sopno pos;
@ -530,8 +530,8 @@ struct parse *p;
== static void p_str(struct parse *p);
*/
static void
p_str(p)
struct parse *p;
p_str(
struct parse *p)
{
_DIAGASSERT(p != NULL);
@ -554,10 +554,10 @@ struct parse *p;
* The amount of lookahead needed to avoid this kludge is excessive.
*/
static void
p_bre(p, end1, end2)
struct parse *p;
int end1; /* first terminating character */
int end2; /* second terminating character */
p_bre(
struct parse *p,
int end1, /* first terminating character */
int end2) /* second terminating character */
{
sopno start;
int first = 1; /* first subexpression? */
@ -591,9 +591,9 @@ int end2; /* second terminating character */
== static int p_simp_re(struct parse *p, int starordinary);
*/
static int /* was the simple RE an unbackslashed $? */
p_simp_re(p, starordinary)
struct parse *p;
int starordinary; /* is a leading * an ordinary character? */
p_simp_re(
struct parse *p,
int starordinary) /* is a leading * an ordinary character? */
{
int c;
int count;
@ -711,8 +711,8 @@ int starordinary; /* is a leading * an ordinary character? */
== static int p_count(struct parse *p);
*/
static int /* the value */
p_count(p)
struct parse *p;
p_count(
struct parse *p)
{
int count = 0;
int ndigits = 0;
@ -736,8 +736,8 @@ struct parse *p;
* no set operations are done.
*/
static void
p_bracket(p)
struct parse *p;
p_bracket(
struct parse *p)
{
cset *cs;
int invert = 0;
@ -816,9 +816,9 @@ struct parse *p;
== static void p_b_term(struct parse *p, cset *cs);
*/
static void
p_b_term(p, cs)
struct parse *p;
cset *cs;
p_b_term(
struct parse *p,
cset *cs)
{
char c;
char start, finish;
@ -886,9 +886,9 @@ cset *cs;
== static void p_b_cclass(struct parse *p, cset *cs);
*/
static void
p_b_cclass(p, cs)
struct parse *p;
cset *cs;
p_b_cclass(
struct parse *p,
cset *cs)
{
const char *sp;
const struct cclass *cp;
@ -927,9 +927,9 @@ cset *cs;
* This implementation is incomplete. xxx
*/
static void
p_b_eclass(p, cs)
struct parse *p;
cset *cs;
p_b_eclass(
struct parse *p,
cset *cs)
{
char c;
@ -945,8 +945,8 @@ cset *cs;
== static char p_b_symbol(struct parse *p);
*/
static char /* value of symbol */
p_b_symbol(p)
struct parse *p;
p_b_symbol(
struct parse *p)
{
char value;
@ -967,9 +967,9 @@ struct parse *p;
== static char p_b_coll_elem(struct parse *p, int endc);
*/
static char /* value of collating element */
p_b_coll_elem(p, endc)
struct parse *p;
int endc; /* name ended by endc,']' */
p_b_coll_elem(
struct parse *p,
int endc) /* name ended by endc,']' */
{
const char *sp;
const struct cname *cp;
@ -1000,8 +1000,8 @@ int endc; /* name ended by endc,']' */
== static int othercase(int ch);
*/
static int /* if no counterpart, return ch */
othercase(ch)
int ch;
othercase(
int ch)
{
assert(isalpha(ch));
if (isupper(ch))
@ -1019,9 +1019,9 @@ int ch;
* Boy, is this implementation ever a kludge...
*/
static void
bothcases(p, ch)
struct parse *p;
int ch;
bothcases(
struct parse *p,
int ch)
{
const char *oldnext;
const char *oldend;
@ -1049,9 +1049,9 @@ int ch;
== static void ordinary(struct parse *p, int ch);
*/
static void
ordinary(p, ch)
struct parse *p;
int ch;
ordinary(
struct parse *p,
int ch)
{
cat_t *cap;
@ -1075,8 +1075,8 @@ int ch;
* Boy, is this implementation ever a kludge...
*/
static void
nonnewline(p)
struct parse *p;
nonnewline(
struct parse *p)
{
const char *oldnext;
const char *oldend;
@ -1104,11 +1104,11 @@ struct parse *p;
== static void repeat(struct parse *p, sopno start, int from, int to);
*/
static void
repeat(p, start, from, to)
struct parse *p;
sopno start; /* operand from here to end of strip */
int from; /* repeated from this number */
int to; /* to this number of times (maybe INFINITY) */
repeat(
struct parse *p,
sopno start, /* operand from here to end of strip */
int from, /* repeated from this number */
int to) /* to this number of times (maybe INFINITY) */
{
sopno finish;
# define N 2
@ -1180,9 +1180,9 @@ int to; /* to this number of times (maybe INFINITY) */
== static int seterr(struct parse *p, int e);
*/
static int /* useless but makes type checking happy */
seterr(p, e)
struct parse *p;
int e;
seterr(
struct parse *p,
int e)
{
_DIAGASSERT(p != NULL);
@ -1199,8 +1199,8 @@ int e;
== static cset *allocset(struct parse *p);
*/
static cset *
allocset(p)
struct parse *p;
allocset(
struct parse *p)
{
int no;
size_t nc;
@ -1256,9 +1256,9 @@ struct parse *p;
== static void freeset(struct parse *p, cset *cs);
*/
static void
freeset(p, cs)
struct parse *p;
cset *cs;
freeset(
struct parse *p,
cset *cs)
{
int i;
cset *top;
@ -1287,9 +1287,9 @@ cset *cs;
* the same value!
*/
static int /* set number */
freezeset(p, cs)
struct parse *p;
cset *cs;
freezeset(
struct parse *p,
cset *cs)
{
uch h;
int i;
@ -1328,9 +1328,9 @@ cset *cs;
== static int firstch(struct parse *p, cset *cs);
*/
static int /* character; there is no "none" value */
firstch(p, cs)
struct parse *p;
cset *cs;
firstch(
struct parse *p,
cset *cs)
{
int i;
size_t css;
@ -1352,9 +1352,9 @@ cset *cs;
== static int nch(struct parse *p, cset *cs);
*/
static int
nch(p, cs)
struct parse *p;
cset *cs;
nch(
struct parse *p,
cset *cs)
{
int i;
size_t css;
@ -1377,10 +1377,10 @@ cset *cs;
== char *cp);
*/
static void
mcadd(p, cs, cp)
struct parse *p;
cset *cs;
const char *cp;
mcadd(
struct parse *p,
cset *cs,
const char *cp)
{
size_t oldend;
@ -1410,9 +1410,9 @@ const char *cp;
== static void mcsub(cset *cs, char *cp);
*/
static void
mcsub(cs, cp)
cset *cs;
char *cp;
mcsub(
cset *cs,
char *cp)
{
char *fp;
size_t len;
@ -1443,9 +1443,9 @@ char *cp;
== static int mcin(cset *cs, char *cp);
*/
static int
mcin(cs, cp)
cset *cs;
char *cp;
mcin(
cset *cs,
char *cp)
{
_DIAGASSERT(cs != NULL);
@ -1459,9 +1459,9 @@ char *cp;
== static char *mcfind(cset *cs, char *cp);
*/
static char *
mcfind(cs, cp)
cset *cs;
char *cp;
mcfind(
cset *cs,
char *cp)
{
char *p;
@ -1486,9 +1486,9 @@ char *cp;
*/
/* ARGSUSED */
static void
mcinvert(p, cs)
struct parse *p;
cset *cs;
mcinvert(
struct parse *p,
cset *cs)
{
_DIAGASSERT(p != NULL);
@ -1506,9 +1506,9 @@ cset *cs;
*/
/* ARGSUSED */
static void
mccase(p, cs)
struct parse *p;
cset *cs;
mccase(
struct parse *p,
cset *cs)
{
_DIAGASSERT(p != NULL);
@ -1522,9 +1522,9 @@ cset *cs;
== static int isinsets(struct re_guts *g, int c);
*/
static int /* predicate */
isinsets(g, c)
struct re_guts *g;
int c;
isinsets(
struct re_guts *g,
int c)
{
uch *col;
int i;
@ -1546,10 +1546,10 @@ int c;
== static int samesets(struct re_guts *g, int c1, int c2);
*/
static int /* predicate */
samesets(g, c1, c2)
struct re_guts *g;
int c1;
int c2;
samesets(
struct re_guts *g,
int c1,
int c2)
{
uch *col;
int i;
@ -1572,9 +1572,9 @@ int c2;
== static void categorize(struct parse *p, struct re_guts *g);
*/
static void
categorize(p, g)
struct parse *p;
struct re_guts *g;
categorize(
struct parse *p,
struct re_guts *g)
{
cat_t *cats;
int c;
@ -1605,10 +1605,10 @@ struct re_guts *g;
== static sopno dupl(struct parse *p, sopno start, sopno finish);
*/
static sopno /* start of duplicate */
dupl(p, start, finish)
struct parse *p;
sopno start; /* from here */
sopno finish; /* to this less one */
dupl(
struct parse *p,
sopno start, /* from here */
sopno finish) /* to this less one */
{
sopno ret;
sopno len = finish - start;
@ -1637,10 +1637,10 @@ sopno finish; /* to this less one */
* some changes to the data structures. Maybe later.
*/
static void
doemit(p, op, opnd)
struct parse *p;
sop op;
sopno opnd;
doemit(
struct parse *p,
sop op,
sopno opnd)
{
_DIAGASSERT(p != NULL);
@ -1666,11 +1666,11 @@ sopno opnd;
== static void doinsert(struct parse *p, sop op, size_t opnd, sopno pos);
*/
static void
doinsert(p, op, opnd, pos)
struct parse *p;
sop op;
sopno opnd;
sopno pos;
doinsert(
struct parse *p,
sop op,
sopno opnd,
sopno pos)
{
sopno sn;
sop s;
@ -1707,10 +1707,10 @@ sopno pos;
== static void dofwd(struct parse *p, sopno pos, sop value);
*/
static void
dofwd(p, pos, value)
struct parse *p;
sopno pos;
sopno value;
dofwd(
struct parse *p,
sopno pos,
sopno value)
{
_DIAGASSERT(p != NULL);
@ -1728,9 +1728,9 @@ sopno value;
== static void enlarge(struct parse *p, sopno size);
*/
static void
enlarge(p, size)
struct parse *p;
sopno size;
enlarge(
struct parse *p,
sopno size)
{
sop *sp;
@ -1753,9 +1753,9 @@ sopno size;
== static void stripsnug(struct parse *p, struct re_guts *g);
*/
static void
stripsnug(p, g)
struct parse *p;
struct re_guts *g;
stripsnug(
struct parse *p,
struct re_guts *g)
{
_DIAGASSERT(p != NULL);
@ -1780,9 +1780,9 @@ struct re_guts *g;
* Note that must and mlen got initialized during setup.
*/
static void
findmust(p, g)
struct parse *p;
struct re_guts *g;
findmust(
struct parse *p,
struct re_guts *g)
{
sop *scan;
sop *start = NULL;
@ -1867,9 +1867,9 @@ struct re_guts *g;
== static sopno pluscount(struct parse *p, struct re_guts *g);
*/
static sopno /* nesting depth */
pluscount(p, g)
struct parse *p;
struct re_guts *g;
pluscount(
struct parse *p,
struct re_guts *g)
{
sop *scan;
sop s;

View File

@ -1,4 +1,4 @@
/* $NetBSD: regerror.c,v 1.21 2007/02/08 05:07:23 junyoung Exp $ */
/* $NetBSD: regerror.c,v 1.22 2007/02/08 05:44:18 junyoung Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@ -76,7 +76,7 @@
#if 0
static char sccsid[] = "@(#)regerror.c 8.4 (Berkeley) 3/20/94";
#else
__RCSID("$NetBSD: regerror.c,v 1.21 2007/02/08 05:07:23 junyoung Exp $");
__RCSID("$NetBSD: regerror.c,v 1.22 2007/02/08 05:44:18 junyoung Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -159,11 +159,11 @@ static const struct rerr {
*/
/* ARGSUSED */
size_t
regerror(errcode, preg, errbuf, errbuf_size)
int errcode;
const regex_t *preg;
char *errbuf;
size_t errbuf_size;
regerror(
int errcode,
const regex_t *preg,
char *errbuf,
size_t errbuf_size)
{
const struct rerr *r;
size_t len;
@ -205,10 +205,10 @@ size_t errbuf_size;
* size_t buflen);
*/
static const char *
regatoi(preg, localbuf, buflen)
const regex_t *preg;
char *localbuf;
size_t buflen;
regatoi(
const regex_t *preg,
char *localbuf,
size_t buflen)
{
const struct rerr *r;

View File

@ -1,4 +1,4 @@
/* $NetBSD: regexec.c,v 1.18 2005/11/29 03:12:00 christos Exp $ */
/* $NetBSD: regexec.c,v 1.19 2007/02/08 05:44:18 junyoung Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@ -76,7 +76,7 @@
#if 0
static char sccsid[] = "@(#)regexec.c 8.3 (Berkeley) 3/20/94";
#else
__RCSID("$NetBSD: regexec.c,v 1.18 2005/11/29 03:12:00 christos Exp $");
__RCSID("$NetBSD: regexec.c,v 1.19 2007/02/08 05:44:18 junyoung Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -200,12 +200,12 @@ __weak_alias(regexec,_regexec)
* have been prototyped.
*/
int /* 0 success, REG_NOMATCH failure */
regexec(preg, string, nmatch, pmatch, eflags)
const regex_t *preg;
const char *string;
size_t nmatch;
regmatch_t pmatch[];
int eflags;
regexec(
const regex_t *preg,
const char *string,
size_t nmatch,
regmatch_t pmatch[],
int eflags)
{
struct re_guts *g = preg->re_g;
char *s;

View File

@ -1,4 +1,4 @@
/* $NetBSD: regfree.c,v 1.13 2003/08/07 16:43:21 agc Exp $ */
/* $NetBSD: regfree.c,v 1.14 2007/02/08 05:44:18 junyoung Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@ -76,7 +76,7 @@
#if 0
static char sccsid[] = "@(#)regfree.c 8.3 (Berkeley) 3/20/94";
#else
__RCSID("$NetBSD: regfree.c,v 1.13 2003/08/07 16:43:21 agc Exp $");
__RCSID("$NetBSD: regfree.c,v 1.14 2007/02/08 05:44:18 junyoung Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -100,8 +100,8 @@ __weak_alias(regfree,_regfree)
= extern void regfree(regex_t *);
*/
void
regfree(preg)
regex_t *preg;
regfree(
regex_t *preg)
{
struct re_guts *g;