| regex.h | | regex.h | |
| | | | |
| skipping to change at line 91 | | skipping to change at line 91 | |
| REG_ESPACE, /* Out of memory. */ | | REG_ESPACE, /* Out of memory. */ | |
| REG_BADRPT | | REG_BADRPT | |
| } reg_errcode_t; | | } reg_errcode_t; | |
| | | | |
| /* POSIX regcomp() flags. */ | | /* POSIX regcomp() flags. */ | |
| #define REG_EXTENDED 1 | | #define REG_EXTENDED 1 | |
| #define REG_ICASE (REG_EXTENDED << 1) | | #define REG_ICASE (REG_EXTENDED << 1) | |
| #define REG_NEWLINE (REG_ICASE << 1) | | #define REG_NEWLINE (REG_ICASE << 1) | |
| #define REG_NOSUB (REG_NEWLINE << 1) | | #define REG_NOSUB (REG_NEWLINE << 1) | |
| | | | |
|
| | | /* Extra regcomp() flags. */ | |
| | | #define REG_LITERAL (REG_NOSUB << 1) | |
| | | | |
| /* POSIX regexec() flags. */ | | /* POSIX regexec() flags. */ | |
| #define REG_NOTBOL 1 | | #define REG_NOTBOL 1 | |
| #define REG_NOTEOL (REG_NOTBOL << 1) | | #define REG_NOTEOL (REG_NOTBOL << 1) | |
| | | | |
| #endif /* !TRE_USE_SYSTEM_REGEX_H */ | | #endif /* !TRE_USE_SYSTEM_REGEX_H */ | |
| | | | |
| /* The maximum number of iterations in a bound expression. */ | | /* The maximum number of iterations in a bound expression. */ | |
| #undef RE_DUP_MAX | | #undef RE_DUP_MAX | |
| #define RE_DUP_MAX 255 | | #define RE_DUP_MAX 255 | |
| | | | |
| | | | |
| skipping to change at line 139 | | skipping to change at line 142 | |
| #endif /* TRE_WCHAR */ | | #endif /* TRE_WCHAR */ | |
| | | | |
| #ifdef TRE_APPROX | | #ifdef TRE_APPROX | |
| | | | |
| /* Approximate matching parameter struct. */ | | /* Approximate matching parameter struct. */ | |
| typedef struct { | | typedef struct { | |
| int cost_ins; /* Default cost of an inserted character. */ | | int cost_ins; /* Default cost of an inserted character. */ | |
| int cost_del; /* Default cost of a deleted character. */ | | int cost_del; /* Default cost of a deleted character. */ | |
| int cost_subst; /* Default cost of a substituted character. */ | | int cost_subst; /* Default cost of a substituted character. */ | |
| int max_cost; /* Maximum allowed cost of a match. */ | | int max_cost; /* Maximum allowed cost of a match. */ | |
|
| | | | |
| | | int max_ins; /* Maximum allowed number of inserts. */ | |
| | | int max_del; /* Maximum allowed number of deletes. */ | |
| | | int max_subst; /* Maximum allowed number of substitutes. */ | |
| | | int max_err; /* Maximum allowed number of errors total. */ | |
| } regaparams_t; | | } regaparams_t; | |
| | | | |
| /* Approximate matching result struct. */ | | /* Approximate matching result struct. */ | |
| typedef struct { | | typedef struct { | |
| size_t nmatch; /* Length of pmatch[] array. */ | | size_t nmatch; /* Length of pmatch[] array. */ | |
| regmatch_t *pmatch; /* Submatch data. */ | | regmatch_t *pmatch; /* Submatch data. */ | |
| int cost; /* Cost of the match. */ | | int cost; /* Cost of the match. */ | |
|
| | | int num_ins; /* Number of inserts in the match. */ | |
| | | int num_del; /* Number of deletes in the match. */ | |
| | | int num_subst; /* Number of substitutes in the match. */ | |
| } regamatch_t; | | } regamatch_t; | |
| | | | |
| /* Approximate matching functions. */ | | /* Approximate matching functions. */ | |
| int regaexec(const regex_t *preg, const char *string, | | int regaexec(const regex_t *preg, const char *string, | |
| regamatch_t *match, regaparams_t params, int eflags); | | regamatch_t *match, regaparams_t params, int eflags); | |
| int reganexec(const regex_t *preg, const char *string, size_t len, | | int reganexec(const regex_t *preg, const char *string, size_t len, | |
| regamatch_t *match, regaparams_t params, int eflags); | | regamatch_t *match, regaparams_t params, int eflags); | |
| #ifdef TRE_WCHAR | | #ifdef TRE_WCHAR | |
| /* Wide character approximate matching. */ | | /* Wide character approximate matching. */ | |
| int regawexec(const regex_t *preg, const wchar_t *string, | | int regawexec(const regex_t *preg, const wchar_t *string, | |
| regamatch_t *match, regaparams_t params, int eflags); | | regamatch_t *match, regaparams_t params, int eflags); | |
| int regawnexec(const regex_t *preg, const wchar_t *string, size_t len, | | int regawnexec(const regex_t *preg, const wchar_t *string, size_t len, | |
| regamatch_t *match, regaparams_t params, int eflags); | | regamatch_t *match, regaparams_t params, int eflags); | |
| #endif /* TRE_WCHAR */ | | #endif /* TRE_WCHAR */ | |
|
| | | | |
| | | /* Sets the parameters to default values. */ | |
| | | void regaparams_default(regaparams_t *params); | |
| #endif /* TRE_APPROX */ | | #endif /* TRE_APPROX */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| #endif /* TRE_REGEX_H */ | | #endif /* TRE_REGEX_H */ | |
| | | | |
| /* EOF */ | | /* EOF */ | |
| | | | |
End of changes. 4 change blocks. |
| 0 lines changed or deleted | | 14 lines changed or added | |
|