37 #include <sys/types.h>
63 {
RZ_REGEX_BADBR,
"RZ_REGEX_BADBR",
"invalid repetition count(s)" },
66 {
RZ_REGEX_BADRPT,
"RZ_REGEX_BADRPT",
"repetition-operator operand invalid" },
68 {
RZ_REGEX_ASSERT,
"RZ_REGEX_ASSERT",
"\"can't happen\" -- you found a bug" },
69 {
RZ_REGEX_INVARG,
"RZ_REGEX_INVARG",
"invalid argument to regex routine" },
70 { 0,
"",
"*** unknown regexp error code ***" }
86 s =
regatoi(preg, convbuf,
sizeof convbuf);
89 if (
r->code == target) {
96 STRLCPY(convbuf,
r->name,
sizeof(convbuf) - 1);
98 snprintf(convbuf,
sizeof convbuf,
"RZ_REGEX_0x%x", target);
107 if (errbuf_size > 0) {
108 STRLCPY(errbuf,
s, errbuf_size - 1);
121 for (
r =
rerrs;
r->code != 0;
r++) {
122 if (strcmp(
r->name, preg->
re_endp) == 0) {
130 (void)
snprintf(localbuf, localbufsize,
"%d",
r->code);
static struct rerr rerrs[]
RZ_API size_t rz_regex_error(int errcode, const RzRegex *preg, char *errbuf, size_t errbuf_size)
static char * regatoi(const RzRegex *, char *, int)
#define RZ_REGEX_ECOLLATE