diff options
author | 2004-11-30 17:04:23 +0000 | |
---|---|---|
committer | 2004-11-30 17:04:23 +0000 | |
commit | a1a765374b785807f7f250e74238e14e6f25a199 (patch) | |
tree | 42be6b51cd70b81c92a2bb63d37e68e89b377baf /lib/libc/regex/engine.c | |
parent | need to pass MAKEOBJDIR to prereq and includes (diff) | |
download | wireguard-openbsd-a1a765374b785807f7f250e74238e14e6f25a199.tar.xz wireguard-openbsd-a1a765374b785807f7f250e74238e14e6f25a199.zip |
remove useless comments, once used for header file generation and delete
parameter names from prototypes. ok millert@
Diffstat (limited to 'lib/libc/regex/engine.c')
-rw-r--r-- | lib/libc/regex/engine.c | 65 |
1 files changed, 11 insertions, 54 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 |