1 #ifndef _REGEX_H 2 #define _REGEX_H 3 4 #ifdef __cplusplus 5 extern "C" { 6 #endif 7 8 #include <features.h> 9 10 #define __NEED_regoff_t 11 #define __NEED_size_t 12 13 #include <bits/alltypes.h> 14 15 typedef struct re_pattern_buffer { 16 size_t re_nsub; 17 void *__opaque, *__padding[4]; 18 size_t __nsub2; 19 char __padding2; 20 } regex_t; 21 22 typedef struct { 23 regoff_t rm_so; 24 regoff_t rm_eo; 25 } regmatch_t; 26 27 #define REG_EXTENDED 1 28 #define REG_ICASE 2 29 #define REG_NEWLINE 4 30 #define REG_NOSUB 8 31 32 #define REG_NOTBOL 1 33 #define REG_NOTEOL 2 34 35 #define REG_OK 0 36 #define REG_NOMATCH 1 37 #define REG_BADPAT 2 38 #define REG_ECOLLATE 3 39 #define REG_ECTYPE 4 40 #define REG_EESCAPE 5 41 #define REG_ESUBREG 6 42 #define REG_EBRACK 7 43 #define REG_EPAREN 8 44 #define REG_EBRACE 9 45 #define REG_BADBR 10 46 #define REG_ERANGE 11 47 #define REG_ESPACE 12 48 #define REG_BADRPT 13 49 50 #define REG_ENOSYS -1 51 52 int regcomp(regex_t *__restrict, const char *__restrict, int); 53 int regexec(const regex_t *__restrict, const char *__restrict, size_t, regmatch_t *__restrict, int); 54 void regfree(regex_t *); 55 56 size_t regerror(int, const regex_t *__restrict, char *__restrict, size_t); 57 58 #ifdef __cplusplus 59 } 60 #endif 61 62 #endif 63