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