From: Mark Whitley Date: Wed, 28 Jun 2000 21:59:31 +0000 (-0000) Subject: Moved some function decls, a struct, and a #define from regexp.h into here. X-Git-Tag: 0_46~78 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=268b8c4f387b9019bbb3591fb07403925d55d0c5;p=platform%2Fupstream%2Fbusybox.git Moved some function decls, a struct, and a #define from regexp.h into here. Also static-ified said functions so they do not have namespace conflicts with the libc regex functions. --- diff --git a/regexp.c b/regexp.c index c271412..6fedb01 100644 --- a/regexp.c +++ b/regexp.c @@ -8,6 +8,21 @@ #include +#define NSUBEXP 10 +typedef struct regexp { + char *startp[NSUBEXP]; + char *endp[NSUBEXP]; + int minlen; /* length of shortest possible match */ + char first; /* first character, if known; else \0 */ + char bol; /* boolean: must start at beginning of line? */ + char program[1]; /* Unwarranted chumminess with compiler. */ +} regexp; + + +static regexp *regcomp(char* text); +static int regexec(struct regexp* re, char* str, int bol, int ignoreCase); +static void regsub(struct regexp* re, char* src, char* dst); + #if ( defined BB_GREP || defined BB_SED) /* This also tries to find a needle in a haystack, but uses @@ -467,7 +482,7 @@ static int match(regexp * re, char *str, char *prog, char *here, /* This function compiles a regexp. */ -extern regexp *regcomp(char *text) +static regexp *regcomp(char *text) { int needfirst; unsigned size; @@ -595,7 +610,7 @@ extern regexp *regcomp(char *text) /* str -- the string to search through */ /* bol -- does str start at the beginning of a line? (boolean) */ /* ignoreCase -- ignoreCase or not */ -extern int regexec(struct regexp *re, char *str, int bol, int ignoreCase) +static int regexec(struct regexp *re, char *str, int bol, int ignoreCase) { char *prog; /* the entry point of re->program */ int len; /* length of the string */ @@ -644,7 +659,7 @@ extern int regexec(struct regexp *re, char *str, int bol, int ignoreCase) #if defined BB_SED /* This performs substitutions after a regexp match has been found. */ -extern void regsub(regexp * re, char *src, char *dst) +static void regsub(regexp * re, char *src, char *dst) { char *cpy; char *end;