LLVM 19.0.0git
Classes | Functions | Variables
regerror.c File Reference
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include <stdlib.h>
#include "regex_impl.h"
#include "regutils.h"

Go to the source code of this file.

Classes

struct  rerr
 

Functions

static const charregatoi (const llvm_regex_t *, char *, int)
 
size_t llvm_regerror (int errcode, const llvm_regex_t *preg, char *errbuf, size_t errbuf_size)
 

Variables

static struct rerr rerrs []
 

Function Documentation

◆ llvm_regerror()

size_t llvm_regerror ( int  errcode,
const llvm_regex_t preg,
char errbuf,
size_t  errbuf_size 
)

◆ regatoi()

static const char * regatoi ( const llvm_regex_t preg,
char localbuf,
int  localbufsize 
)
static

Definition at line 123 of file regerror.c.

References rerr::code, rerr::name, llvm_regex::re_endp, and rerrs.

Referenced by llvm_regerror().

Variable Documentation

◆ rerrs

struct rerr rerrs[]
static
Initial value:
= {
{ REG_NOMATCH, "REG_NOMATCH", "llvm_regexec() failed to match" },
{ REG_BADPAT, "REG_BADPAT", "invalid regular expression" },
{ REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element" },
{ REG_ECTYPE, "REG_ECTYPE", "invalid character class" },
{ REG_EESCAPE, "REG_EESCAPE", "trailing backslash (\\)" },
{ REG_ESUBREG, "REG_ESUBREG", "invalid backreference number" },
{ REG_EBRACK, "REG_EBRACK", "brackets ([ ]) not balanced" },
{ REG_EPAREN, "REG_EPAREN", "parentheses not balanced" },
{ REG_EBRACE, "REG_EBRACE", "braces not balanced" },
{ REG_BADBR, "REG_BADBR", "invalid repetition count(s)" },
{ REG_ERANGE, "REG_ERANGE", "invalid character range" },
{ REG_ESPACE, "REG_ESPACE", "out of memory" },
{ REG_BADRPT, "REG_BADRPT", "repetition-operator operand invalid" },
{ REG_EMPTY, "REG_EMPTY", "empty (sub)expression" },
{ REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug" },
{ REG_INVARG, "REG_INVARG", "invalid argument to regex routine" },
{ 0, "", "*** unknown regexp error code ***" }
}
#define REG_ECTYPE
Definition: regex_impl.h:69
#define REG_NOMATCH
Definition: regex_impl.h:66
#define REG_EBRACK
Definition: regex_impl.h:72
#define REG_ASSERT
Definition: regex_impl.h:80
#define REG_BADRPT
Definition: regex_impl.h:78
#define REG_EESCAPE
Definition: regex_impl.h:70
#define REG_INVARG
Definition: regex_impl.h:81
#define REG_ERANGE
Definition: regex_impl.h:76
#define REG_ESUBREG
Definition: regex_impl.h:71
#define REG_BADBR
Definition: regex_impl.h:75
#define REG_EMPTY
Definition: regex_impl.h:79
#define REG_ECOLLATE
Definition: regex_impl.h:68
#define REG_EBRACE
Definition: regex_impl.h:74
#define REG_EPAREN
Definition: regex_impl.h:73
#define REG_BADPAT
Definition: regex_impl.h:67
#define REG_ESPACE
Definition: regex_impl.h:77

Referenced by llvm_regerror(), and regatoi().