summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2004-11-30 17:04:24 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2004-11-30 17:04:24 +0000
commit09f49f85d46fe8685347ee71877211bb3b5a0ec0 (patch)
tree5c043d0353ea00f9230cef3eac7d8910bf261e37 /lib
parentdabbb7ff700a892c4acfcf1917f5ee277e8c605b (diff)
remove useless comments, once used for header file generation and delete
parameter names from prototypes. ok millert@
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/regex/engine.c65
-rw-r--r--lib/libc/regex/regcomp.c135
-rw-r--r--lib/libc/regex/regerror.c35
-rw-r--r--lib/libc/regex/regex2.h16
-rw-r--r--lib/libc/regex/regexec.c10
-rw-r--r--lib/libc/regex/regfree.c3
6 files changed, 54 insertions, 210 deletions
diff --git a/lib/libc/regex/engine.c b/lib/libc/regex/engine.c
index fd02dca60ee..09f8cb2bce1 100644
--- a/lib/libc/regex/engine.c
+++ b/lib/libc/regex/engine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: engine.c,v 1.12 2004/11/29 16:49:50 otto Exp $ */
+/* $OpenBSD: engine.c,v 1.13 2004/11/30 17:04:23 otto Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994 Henry Spencer.
@@ -36,7 +36,7 @@
*/
#if defined(SNAMES) && defined(LIBC_SCCS) && !defined(lint)
-static char enginercsid[] = "$OpenBSD: engine.c,v 1.12 2004/11/29 16:49:50 otto Exp $";
+static char enginercsid[] = "$OpenBSD: engine.c,v 1.13 2004/11/30 17:04:23 otto Exp $";
#endif /* SNAMES and LIBC_SCCS and not lint */
/*
@@ -88,18 +88,12 @@ struct match {
states empty; /* empty set of states */
};
-/* ========= begin header generated by ./mkh ========= */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* === engine.c === */
-static int matcher(struct re_guts *g, char *string, size_t nmatch, regmatch_t pmatch[], int eflags);
-static char *dissect(struct match *m, char *start, char *stop, sopno startst, sopno stopst);
-static char *backref(struct match *m, char *start, char *stop, sopno startst, sopno stopst, sopno lev, int);
-static char *fast(struct match *m, char *start, char *stop, sopno startst, sopno stopst);
-static char *slow(struct match *m, char *start, char *stop, sopno startst, sopno stopst);
-static states step(struct re_guts *g, sopno start, sopno stop, states bef, int ch, states aft);
+static int matcher(struct re_guts *, char *, size_t, regmatch_t[], int);
+static char *dissect(struct match *, char *, char *, sopno, sopno);
+static char *backref(struct match *, char *, char *, sopno, sopno, sopno, int);
+static char *fast(struct match *, char *, char *, sopno, sopno);
+static char *slow(struct match *, char *, char *, sopno, sopno);
+static states step(struct re_guts *, sopno, sopno, states, int, states);
#define MAX_RECURSION 100
#define BOL (OUT+1)
#define EOL (BOL+1)
@@ -111,19 +105,14 @@ static states step(struct re_guts *g, sopno start, sopno stop, states bef, int c
#define NONCHAR(c) ((c) > CHAR_MAX)
#define NNONCHAR (CODEMAX-CHAR_MAX)
#ifdef REDEBUG
-static void print(struct match *m, char *caption, states st, int ch, FILE *d);
+static void print(struct match *, char *, states, int, FILE *);
#endif
#ifdef REDEBUG
-static void at(struct match *m, char *title, char *start, char *stop, sopno startst, sopno stopst);
+static void at(struct match *, char *, char *, char *, sopno, sopno);
#endif
#ifdef REDEBUG
-static char *pchar(int ch);
-#endif
-
-#ifdef __cplusplus
-}
+static char *pchar(int);
#endif
-/* ========= end header generated by ./mkh ========= */
#ifdef REDEBUG
#define SP(t, s, c) print(m, t, s, c, stdout)
@@ -138,8 +127,6 @@ static int nope = 0;
/*
- matcher - the actual matching engine
- == static int matcher(struct re_guts *g, char *string, \
- == size_t nmatch, regmatch_t pmatch[], int eflags);
*/
static int /* 0 success, REG_NOMATCH failure */
matcher(struct re_guts *g, char *string, size_t nmatch, regmatch_t pmatch[],
@@ -301,8 +288,6 @@ matcher(struct re_guts *g, char *string, size_t nmatch, regmatch_t pmatch[],
/*
- dissect - figure out what matched what, no back references
- == static char *dissect(struct match *m, char *start, \
- == char *stop, sopno startst, sopno stopst);
*/
static char * /* == stop (success) always */
dissect(struct match *m, char *start, char *stop, sopno startst, sopno stopst)
@@ -484,8 +469,6 @@ dissect(struct match *m, char *start, char *stop, sopno startst, sopno stopst)
/*
- backref - figure out what matched what, figuring in back references
- == static char *backref(struct match *m, char *start, \
- == char *stop, sopno startst, sopno stopst, sopno lev);
*/
static char * /* == stop (success) or NULL (failure) */
backref(struct match *m, char *start, char *stop, sopno startst, sopno stopst,
@@ -685,8 +668,6 @@ backref(struct match *m, char *start, char *stop, sopno startst, sopno stopst,
/*
- fast - step through the string at top speed
- == static char *fast(struct match *m, char *start, \
- == char *stop, sopno startst, sopno stopst);
*/
static char * /* where tentative match ended, or NULL */
fast(struct match *m, char *start, char *stop, sopno startst, sopno stopst)
@@ -771,8 +752,6 @@ fast(struct match *m, char *start, char *stop, sopno startst, sopno stopst)
/*
- slow - step through the string more deliberately
- == static char *slow(struct match *m, char *start, \
- == char *stop, sopno startst, sopno stopst);
*/
static char * /* where it ended */
slow(struct match *m, char *start, char *stop, sopno startst, sopno stopst)
@@ -853,17 +832,6 @@ slow(struct match *m, char *start, char *stop, sopno startst, sopno stopst)
/*
- step - map set of states reachable before char to set reachable after
- == static states step(struct re_guts *g, sopno start, sopno stop, \
- == states bef, int ch, states aft);
- == #define BOL (OUT+1)
- == #define EOL (BOL+1)
- == #define BOLEOL (BOL+2)
- == #define NOTHING (BOL+3)
- == #define BOW (BOL+4)
- == #define EOW (BOL+5)
- == #define CODEMAX (BOL+5) // highest code used
- == #define NONCHAR(c) ((c) > CHAR_MAX)
- == #define NNONCHAR (CODEMAX-CHAR_MAX)
*/
static states
step(struct re_guts *g,
@@ -981,10 +949,6 @@ step(struct re_guts *g,
#ifdef REDEBUG
/*
- print - print a set of states
- == #ifdef REDEBUG
- == static void print(struct match *m, char *caption, states st, \
- == int ch, FILE *d);
- == #endif
*/
static void
print(struct match *m, char *caption, states st, int ch, FILE *d)
@@ -1009,10 +973,6 @@ print(struct match *m, char *caption, states st, int ch, FILE *d)
/*
- at - print current situation
- == #ifdef REDEBUG
- == static void at(struct match *m, char *title, char *start, char *stop, \
- == sopno startst, sopno stopst);
- == #endif
*/
static void
at(struct match *m, char *title, char *start, char *stop, sopno startst,
@@ -1030,9 +990,6 @@ at(struct match *m, char *title, char *start, char *stop, sopno startst,
#define PCHARDONE /* never again */
/*
- pchar - make a character printable
- == #ifdef REDEBUG
- == static char *pchar(int ch);
- == #endif
*
* Is this identical to regchar() over in debug.c? Well, yes. But a
* duplicate here avoids having a debugging-capable regexec.o tied to
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c
index 078be76265a..ad90f1975c7 100644
--- a/lib/libc/regex/regcomp.c
+++ b/lib/libc/regex/regcomp.c
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94";
#else
-static char rcsid[] = "$OpenBSD: regcomp.c,v 1.13 2004/10/17 17:58:54 otto Exp $";
+static char rcsid[] = "$OpenBSD: regcomp.c,v 1.14 2004/11/30 17:04:23 otto Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -73,54 +73,43 @@ struct parse {
sopno pend[NPAREN]; /* -> ) ([0] unused) */
};
-/* ========= begin header generated by ./mkh ========= */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* === regcomp.c === */
-static void p_ere(struct parse *p, int stop);
-static void p_ere_exp(struct parse *p);
-static void p_str(struct parse *p);
-static void p_bre(struct parse *p, int end1, int end2);
-static int p_simp_re(struct parse *p, int starordinary);
-static int p_count(struct parse *p);
-static void p_bracket(struct parse *p);
-static void p_b_term(struct parse *p, cset *cs);
-static void p_b_cclass(struct parse *p, cset *cs);
-static void p_b_eclass(struct parse *p, cset *cs);
-static char p_b_symbol(struct parse *p);
-static char p_b_coll_elem(struct parse *p, int endc);
-static char othercase(int ch);
-static void bothcases(struct parse *p, int ch);
-static void ordinary(struct parse *p, int ch);
-static void nonnewline(struct parse *p);
-static void repeat(struct parse *p, sopno start, int from, int to);
-static int seterr(struct parse *p, int e);
-static cset *allocset(struct parse *p);
-static void freeset(struct parse *p, cset *cs);
-static int freezeset(struct parse *p, cset *cs);
-static int firstch(struct parse *p, cset *cs);
-static int nch(struct parse *p, cset *cs);
-static void mcadd(struct parse *p, cset *cs, char *cp);
-static void mcinvert(struct parse *p, cset *cs);
-static void mccase(struct parse *p, cset *cs);
-static int isinsets(struct re_guts *g, int c);
-static int samesets(struct re_guts *g, int c1, int c2);
-static void categorize(struct parse *p, struct re_guts *g);
-static sopno dupl(struct parse *p, sopno start, sopno finish);
-static void doemit(struct parse *p, sop op, size_t opnd);
-static void doinsert(struct parse *p, sop op, size_t opnd, sopno pos);
-static void dofwd(struct parse *p, sopno pos, sop value);
-static void enlarge(struct parse *p, sopno size);
-static void stripsnug(struct parse *p, struct re_guts *g);
-static void findmust(struct parse *p, struct re_guts *g);
-static sopno pluscount(struct parse *p, struct re_guts *g);
-
-#ifdef __cplusplus
-}
-#endif
-/* ========= end header generated by ./mkh ========= */
+static void p_ere(struct parse *, int);
+static void p_ere_exp(struct parse *);
+static void p_str(struct parse *);
+static void p_bre(struct parse *, int, int);
+static int p_simp_re(struct parse *, int);
+static int p_count(struct parse *);
+static void p_bracket(struct parse *);
+static void p_b_term(struct parse *, cset *);
+static void p_b_cclass(struct parse *, cset *);
+static void p_b_eclass(struct parse *, cset *);
+static char p_b_symbol(struct parse *);
+static char p_b_coll_elem(struct parse *, int);
+static char othercase(int);
+static void bothcases(struct parse *, int);
+static void ordinary(struct parse *, int);
+static void nonnewline(struct parse *);
+static void repeat(struct parse *, sopno, int, int);
+static int seterr(struct parse *, int);
+static cset *allocset(struct parse *);
+static void freeset(struct parse *, cset *);
+static int freezeset(struct parse *, cset *);
+static int firstch(struct parse *, cset *);
+static int nch(struct parse *, cset *);
+static void mcadd(struct parse *, cset *, char *);
+static void mcinvert(struct parse *, cset *);
+static void mccase(struct parse *, cset *);
+static int isinsets(struct re_guts *, int);
+static int samesets(struct re_guts *, int, int);
+static void categorize(struct parse *, struct re_guts *);
+static sopno dupl(struct parse *, sopno, sopno);
+static void doemit(struct parse *, sop, size_t);
+static void doinsert(struct parse *, sop, size_t, sopno);
+static void dofwd(struct parse *, sopno, sop);
+static void enlarge(struct parse *, sopno);
+static void stripsnug(struct parse *, struct re_guts *);
+static void findmust(struct parse *, struct re_guts *);
+static sopno pluscount(struct parse *, struct re_guts *);
static char nuls[10]; /* place to point scanner in event of error */
@@ -162,15 +151,6 @@ static int never = 0; /* for use in asserts; shuts lint up */
/*
- regcomp - interface for parser and compilation
- = extern int regcomp(regex_t *, const char *, int);
- = #define REG_BASIC 0000
- = #define REG_EXTENDED 0001
- = #define REG_ICASE 0002
- = #define REG_NOSUB 0004
- = #define REG_NEWLINE 0010
- = #define REG_NOSPEC 0020
- = #define REG_PEND 0040
- = #define REG_DUMP 0200
*/
int /* 0 success, otherwise REG_something */
regcomp(regex_t *preg, const char *pattern, int cflags)
@@ -271,7 +251,6 @@ regcomp(regex_t *preg, const char *pattern, int cflags)
/*
- p_ere - ERE parser top level, concatenation and alternation
- == static void p_ere(struct parse *p, int stop);
*/
static void
p_ere(struct parse *p, int stop) /* character this ERE should end at */
@@ -315,7 +294,6 @@ p_ere(struct parse *p, int stop) /* character this ERE should end at */
/*
- p_ere_exp - parse one subERE, an atom possibly followed by a repetition op
- == static void p_ere_exp(struct parse *p);
*/
static void
p_ere_exp(struct parse *p)
@@ -463,7 +441,6 @@ p_ere_exp(struct parse *p)
/*
- p_str - string (no metacharacters) "parser"
- == static void p_str(struct parse *p);
*/
static void
p_str(struct parse *p)
@@ -475,8 +452,6 @@ p_str(struct parse *p)
/*
- p_bre - BRE parser top level, anchoring and concatenation
- == static void p_bre(struct parse *p, int end1, \
- == int end2);
* Giving end1 as OUT essentially eliminates the end1/end2 check.
*
* This implementation is a bit of a kludge, in that a trailing $ is first
@@ -515,7 +490,6 @@ p_bre(struct parse *p,
/*
- p_simp_re - parse a simple RE, an atom possibly followed by a repetition
- == static int p_simp_re(struct parse *p, int starordinary);
*/
static int /* was the simple RE an unbackslashed $? */
p_simp_re(struct parse *p,
@@ -632,7 +606,6 @@ p_simp_re(struct parse *p,
/*
- p_count - parse a repetition count
- == static int p_count(struct parse *p);
*/
static int /* the value */
p_count(struct parse *p)
@@ -651,7 +624,6 @@ p_count(struct parse *p)
/*
- p_bracket - parse a bracketed character list
- == static void p_bracket(struct parse *p);
*
* Note a significant property of this code: if the allocset() did SETERROR,
* no set operations are done.
@@ -731,7 +703,6 @@ p_bracket(struct parse *p)
/*
- p_b_term - parse one term of a bracketed character list
- == static void p_b_term(struct parse *p, cset *cs);
*/
static void
p_b_term(struct parse *p, cset *cs)
@@ -795,7 +766,6 @@ p_b_term(struct parse *p, cset *cs)
/*
- p_b_cclass - parse a character-class name and deal with it
- == static void p_b_cclass(struct parse *p, cset *cs);
*/
static void
p_b_cclass(struct parse *p, cset *cs)
@@ -827,7 +797,6 @@ p_b_cclass(struct parse *p, cset *cs)
/*
- p_b_eclass - parse an equivalence-class name and deal with it
- == static void p_b_eclass(struct parse *p, cset *cs);
*
* This implementation is incomplete. xxx
*/
@@ -842,7 +811,6 @@ p_b_eclass(struct parse *p, cset *cs)
/*
- p_b_symbol - parse a character or [..]ed multicharacter collating symbol
- == static char p_b_symbol(struct parse *p);
*/
static char /* value of symbol */
p_b_symbol(struct parse *p)
@@ -861,7 +829,6 @@ p_b_symbol(struct parse *p)
/*
- p_b_coll_elem - parse a collating-element name and look it up
- == static char p_b_coll_elem(struct parse *p, int endc);
*/
static char /* value of collating element */
p_b_coll_elem(struct parse *p,
@@ -889,7 +856,6 @@ p_b_coll_elem(struct parse *p,
/*
- othercase - return the case counterpart of an alphabetic
- == static char othercase(int ch);
*/
static char /* if no counterpart, return ch */
othercase(int ch)
@@ -906,7 +872,6 @@ othercase(int ch)
/*
- bothcases - emit a dualcase version of a two-case character
- == static void bothcases(struct parse *p, int ch);
*
* Boy, is this implementation ever a kludge...
*/
@@ -932,7 +897,6 @@ bothcases(struct parse *p, int ch)
/*
- ordinary - emit an ordinary character
- == static void ordinary(struct parse *p, int ch);
*/
static void
ordinary(struct parse *p, int ch)
@@ -950,7 +914,6 @@ ordinary(struct parse *p, int ch)
/*
- nonnewline - emit REG_NEWLINE version of OANY
- == static void nonnewline(struct parse *p);
*
* Boy, is this implementation ever a kludge...
*/
@@ -975,7 +938,6 @@ nonnewline(struct parse *p)
/*
- repeat - generate code for a bounded repetition, recursively if needed
- == static void repeat(struct parse *p, sopno start, int from, int to);
*/
static void
repeat(struct parse *p,
@@ -1046,7 +1008,6 @@ repeat(struct parse *p,
/*
- seterr - set an error condition
- == static int seterr(struct parse *p, int e);
*/
static int /* useless but makes type checking happy */
seterr(struct parse *p, int e)
@@ -1060,7 +1021,6 @@ seterr(struct parse *p, int e)
/*
- allocset - allocate a set of characters for []
- == static cset *allocset(struct parse *p);
*/
static cset *
allocset(struct parse *p)
@@ -1135,7 +1095,6 @@ nomem:
/*
- freeset - free a now-unused set
- == static void freeset(struct parse *p, cset *cs);
*/
static void
freeset(struct parse *p, cset *cs)
@@ -1152,7 +1111,6 @@ freeset(struct parse *p, cset *cs)
/*
- freezeset - final processing on a set of characters
- == static int freezeset(struct parse *p, cset *cs);
*
* The main task here is merging identical sets. This is usually a waste
* of time (although the hash code minimizes the overhead), but can win
@@ -1190,7 +1148,6 @@ freezeset(struct parse *p, cset *cs)
/*
- firstch - return first character in a set (which must have at least one)
- == static int firstch(struct parse *p, cset *cs);
*/
static int /* character; there is no "none" value */
firstch(struct parse *p, cset *cs)
@@ -1207,7 +1164,6 @@ firstch(struct parse *p, cset *cs)
/*
- nch - number of characters in a set
- == static int nch(struct parse *p, cset *cs);
*/
static int
nch(struct parse *p, cset *cs)
@@ -1224,8 +1180,6 @@ nch(struct parse *p, cset *cs)
/*
- mcadd - add a collating element to a cset
- == static void mcadd(struct parse *p, cset *cs, \
- == char *cp);
*/
static void
mcadd( struct parse *p, cset *cs, char *cp)
@@ -1252,7 +1206,6 @@ mcadd( struct parse *p, cset *cs, char *cp)
/*
- mcinvert - invert the list of collating elements in a cset
- == static void mcinvert(struct parse *p, cset *cs);
*
* This would have to know the set of possibilities. Implementation
* is deferred.
@@ -1266,7 +1219,6 @@ mcinvert(struct parse *p, cset *cs)
/*
- mccase - add case counterparts of the list of collating elements in a cset
- == static void mccase(struct parse *p, cset *cs);
*
* This would have to know the set of possibilities. Implementation
* is deferred.
@@ -1280,7 +1232,6 @@ mccase(struct parse *p, cset *cs)
/*
- isinsets - is this character in any sets?
- == static int isinsets(struct re_guts *g, int c);
*/
static int /* predicate */
isinsets(struct re_guts *g, int c)
@@ -1298,7 +1249,6 @@ isinsets(struct re_guts *g, int c)
/*
- samesets - are these two characters in exactly the same sets?
- == static int samesets(struct re_guts *g, int c1, int c2);
*/
static int /* predicate */
samesets(struct re_guts *g, int c1, int c2)
@@ -1317,7 +1267,6 @@ samesets(struct re_guts *g, int c1, int c2)
/*
- categorize - sort out character categories
- == static void categorize(struct parse *p, struct re_guts *g);
*/
static void
categorize(struct parse *p, struct re_guts *g)
@@ -1343,7 +1292,6 @@ categorize(struct parse *p, struct re_guts *g)
/*
- dupl - emit a duplicate of a bunch of sops
- == static sopno dupl(struct parse *p, sopno start, sopno finish);
*/
static sopno /* start of duplicate */
dupl(struct parse *p,
@@ -1366,7 +1314,6 @@ dupl(struct parse *p,
/*
- doemit - emit a strip operator
- == static void doemit(struct parse *p, sop op, size_t opnd);
*
* It might seem better to implement this as a macro with a function as
* hard-case backup, but it's just too big and messy unless there are
@@ -1393,7 +1340,6 @@ doemit(struct parse *p, sop op, size_t opnd)
/*
- doinsert - insert a sop into the strip
- == static void doinsert(struct parse *p, sop op, size_t opnd, sopno pos);
*/
static void
doinsert(struct parse *p, sop op, size_t opnd, sopno pos)
@@ -1429,7 +1375,6 @@ doinsert(struct parse *p, sop op, size_t opnd, sopno pos)
/*
- dofwd - complete a forward reference
- == static void dofwd(struct parse *p, sopno pos, sop value);
*/
static void
dofwd(struct parse *p, sopno pos, sop value)
@@ -1444,7 +1389,6 @@ dofwd(struct parse *p, sopno pos, sop value)
/*
- enlarge - enlarge the strip
- == static void enlarge(struct parse *p, sopno size);
*/
static void
enlarge(struct parse *p, sopno size)
@@ -1465,7 +1409,6 @@ enlarge(struct parse *p, sopno size)
/*
- stripsnug - compact the strip
- == static void stripsnug(struct parse *p, struct re_guts *g);
*/
static void
stripsnug(struct parse *p, struct re_guts *g)
@@ -1480,7 +1423,6 @@ stripsnug(struct parse *p, struct re_guts *g)
/*
- findmust - fill in must and mlen with longest mandatory literal string
- == static void findmust(struct parse *p, struct re_guts *g);
*
* This algorithm could do fancy things like analyzing the operands of |
* for common subsequences. Someday. This code is simple and finds most
@@ -1565,7 +1507,6 @@ findmust(struct parse *p, struct re_guts *g)
/*
- pluscount - count + nesting
- == static sopno pluscount(struct parse *p, struct re_guts *g);
*/
static sopno /* nesting depth */
pluscount(struct parse *p, struct re_guts *g)
diff --git a/lib/libc/regex/regerror.c b/lib/libc/regex/regerror.c
index e2c41bdc353..5f7e2b67446 100644
--- a/lib/libc/regex/regerror.c
+++ b/lib/libc/regex/regerror.c
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)regerror.c 8.4 (Berkeley) 3/20/94";
#else
-static char rcsid[] = "$OpenBSD: regerror.c,v 1.11 2004/10/17 17:58:54 otto Exp $";
+static char rcsid[] = "$OpenBSD: regerror.c,v 1.12 2004/11/30 17:04:23 otto Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -51,38 +51,8 @@ static char rcsid[] = "$OpenBSD: regerror.c,v 1.11 2004/10/17 17:58:54 otto Exp
#include "utils.h"
-/* ========= begin header generated by ./mkh ========= */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* === regerror.c === */
-static char *regatoi(const regex_t *preg, char *localbuf, int localbufsize);
+static char *regatoi(const regex_t *, char *, int);
-#ifdef __cplusplus
-}
-#endif
-/* ========= end header generated by ./mkh ========= */
-/*
- = #define REG_NOMATCH 1
- = #define REG_BADPAT 2
- = #define REG_ECOLLATE 3
- = #define REG_ECTYPE 4
- = #define REG_EESCAPE 5
- = #define REG_ESUBREG 6
- = #define REG_EBRACK 7
- = #define REG_EPAREN 8
- = #define REG_EBRACE 9
- = #define REG_BADBR 10
- = #define REG_ERANGE 11
- = #define REG_ESPACE 12
- = #define REG_BADRPT 13
- = #define REG_EMPTY 14
- = #define REG_ASSERT 15
- = #define REG_INVARG 16
- = #define REG_ATOI 255 // convert name to number (!)
- = #define REG_ITOA 0400 // convert number to name (!)
- */
static struct rerr {
int code;
char *name;
@@ -150,7 +120,6 @@ regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
/*
- regatoi - internal routine to implement REG_ATOI
- == static char *regatoi(const regex_t *preg, char *localbuf);
*/
static char *
regatoi(const regex_t *preg, char *localbuf, int localbufsize)
diff --git a/lib/libc/regex/regex2.h b/lib/libc/regex/regex2.h
index 36f44363d27..15e15bc924d 100644
--- a/lib/libc/regex/regex2.h
+++ b/lib/libc/regex/regex2.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: regex2.h,v 1.6 2003/06/02 20:18:36 millert Exp $ */
+/* $OpenBSD: regex2.h,v 1.7 2004/11/30 17:04:23 otto Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994 Henry Spencer.
@@ -36,20 +36,6 @@
*/
/*
- * First, the stuff that ends up in the outside-world include file
- = typedef off_t regoff_t;
- = typedef struct {
- = int re_magic;
- = size_t re_nsub; // number of parenthesized subexpressions
- = const char *re_endp; // end pointer for REG_PEND
- = struct re_guts *re_g; // none of your business :-)
- = } regex_t;
- = typedef struct {
- = regoff_t rm_so; // start of match
- = regoff_t rm_eo; // end of match
- = } regmatch_t;
- */
-/*
* internals of regex_t
*/
#define MAGIC1 ((('r'^0200)<<8) | 'e')
diff --git a/lib/libc/regex/regexec.c b/lib/libc/regex/regexec.c
index 81197098cbe..c644b4ff41b 100644
--- a/lib/libc/regex/regexec.c
+++ b/lib/libc/regex/regexec.c
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)regexec.c 8.3 (Berkeley) 3/20/94";
#else
-static char rcsid[] = "$OpenBSD: regexec.c,v 1.9 2004/10/17 17:58:54 otto Exp $";
+static char rcsid[] = "$OpenBSD: regexec.c,v 1.10 2004/11/30 17:04:23 otto Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -137,14 +137,6 @@ static char rcsid[] = "$OpenBSD: regexec.c,v 1.9 2004/10/17 17:58:54 otto Exp $"
/*
- regexec - interface for matching
- = extern int regexec(const regex_t *, const char *, size_t, \
- = regmatch_t [], int);
- = #define REG_NOTBOL 00001
- = #define REG_NOTEOL 00002
- = #define REG_STARTEND 00004
- = #define REG_TRACE 00400 // tracing of execution
- = #define REG_LARGE 01000 // force large representation
- = #define REG_BACKR 02000 // force use of backref code
*
* We put this here so we can exploit knowledge of the state representation
* when choosing which matcher to call. Also, by this point the matchers
diff --git a/lib/libc/regex/regfree.c b/lib/libc/regex/regfree.c
index 44dbf08449b..db8a38d97f0 100644
--- a/lib/libc/regex/regfree.c
+++ b/lib/libc/regex/regfree.c
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)regfree.c 8.3 (Berkeley) 3/20/94";
#else
-static char rcsid[] = "$OpenBSD: regfree.c,v 1.5 2004/10/17 17:58:54 otto Exp $";
+static char rcsid[] = "$OpenBSD: regfree.c,v 1.6 2004/11/30 17:04:23 otto Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -51,7 +51,6 @@ static char rcsid[] = "$OpenBSD: regfree.c,v 1.5 2004/10/17 17:58:54 otto Exp $"
/*
- regfree - free everything
- = extern void regfree(regex_t *);
*/
void
regfree(regex_t *preg)