remove arch/$(ARCH)/src from the build system
[musl.git] / include / regex.h
blobdce217718f8c825acec8d7dad38806db2064b4ec
1 #ifndef _REGEX_H
2 #define _REGEX_H
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
8 #include <features.h>
10 #define __NEED_regoff_t
11 #define __NEED_size_t
13 #include <bits/alltypes.h>
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;
22 typedef struct {
23 regoff_t rm_so;
24 regoff_t rm_eo;
25 } regmatch_t;
27 #define REG_EXTENDED 1
28 #define REG_ICASE 2
29 #define REG_NEWLINE 4
30 #define REG_NOSUB 8
32 #define REG_NOTBOL 1
33 #define REG_NOTEOL 2
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
50 #define REG_ENOSYS -1
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 *);
56 size_t regerror(int, const regex_t *__restrict, char *__restrict, size_t);
58 #ifdef __cplusplus
60 #endif
62 #endif