version 1.12 | | version 1.13 |
---|
| | |
/* | | /* |
* static char *rcsid_player_c = | | * static char *rcsid_player_c = |
* "$Id: re-cmp.c,v 1.12 2005/08/12 08:18:59 ryo_saeba Exp $"; | | * "$Id: re-cmp.c,v 1.13 2005/10/28 19:08:53 akirschbaum Exp $"; |
*/ | | */ |
| | |
| | |
| | |
/* P r o t o t y p e s | | /* P r o t o t y p e s |
*/ | | */ |
const char *re_cmp(const char *, const char *); | | const char *re_cmp(const char *, const char *); |
static Boolean re_cmp_step(const char *, const char *, int, int); | | static Boolean re_cmp_step(const char *, const char *, unsigned, int); |
static void re_init(void); | | static void re_init(void); |
static Boolean re_match_token(uchar, selection *); | | static Boolean re_match_token(uchar, selection *); |
static const char *re_get_token(selection *, const char *); | | static const char *re_get_token(selection *, const char *); |
| | |
re_token_depth = 0; | | re_token_depth = 0; |
re_substr[0] = next_regexp; | | re_substr[0] = next_regexp; |
| | |
| | matched = False; |
while (*str != '\0' && !(matched = re_match_token(*str, re_token[0]))) | | while (*str != '\0' && !(matched = re_match_token(*str, re_token[0]))) |
str++; | | str++; |
| | |
| | |
*/ | | */ |
| | |
static Boolean | | static Boolean |
re_cmp_step(const char *str, const char *regexp, int slot, int matches) { | | re_cmp_step(const char *str, const char *regexp, unsigned slot, int matches) { |
/* str - string to match | | /* str - string to match |
* regexp - pattern | | * regexp - pattern |
* slot - number of the token which under consideration | | * slot - number of the token which under consideration |
| | |
Boolean matched; | | Boolean matched; |
| | |
#ifdef DEBUG | | #ifdef DEBUG |
/* fprintf(stderr, "['%s', '%s', %d, %d]\n", str, regexp, slot, matches);*/ | | /* fprintf(stderr, "['%s', '%s', %u, %d]\n", str, regexp, slot, matches);*/ |
#endif | | #endif |
| | |
if (*regexp == 0) { | | if (*regexp == 0) { |