]> git.saurik.com Git - apple/libc.git/blobdiff - include/regex.h
Libc-1439.100.3.tar.gz
[apple/libc.git] / include / regex.h
index a735132763b9d860744e1a3c5dcc0901ea83e1b3..7ef9b35f10e62ccfe7c6f91b608b9737f27973d4 100644 (file)
 #ifndef _REGEX_H_
 #define        _REGEX_H_
 
-#include <_types.h>
-#include <Availability.h>
-#include <sys/_types/_size_t.h>
-
-/*********/
-/* types */
-/*********/
-#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
-#include <sys/_types/_wchar_t.h>
-#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
-
-typedef __darwin_off_t regoff_t;
-
-typedef struct {
-       int re_magic;
-       size_t re_nsub;         /* number of parenthesized subexpressions */
-       const char *re_endp;    /* end pointer for REG_PEND */
-       struct re_guts *re_g;   /* none of your business :-) */
-} regex_t;
-
-typedef struct {
-       regoff_t rm_so;         /* start of match */
-       regoff_t rm_eo;         /* end of match */
-} regmatch_t;
+#include <_regex.h>
 
 /*******************/
 /* regcomp() flags */
@@ -130,14 +107,16 @@ typedef struct {
 #define        REG_NOSPEC      0020    /* Compile turning off all special characters */
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED  >= __MAC_10_8 \
- || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0
+ || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
+ || defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
 #define        REG_LITERAL     REG_NOSPEC
 #endif
 
 #define        REG_PEND        0040    /* Use re_endp as end pointer */
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED  >= __MAC_10_8 \
- || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0
+ || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
+ || defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
 #define        REG_MINIMAL     0100    /* Compile using minimal repetition */
 #define        REG_UNGREEDY    REG_MINIMAL
 #endif
@@ -145,7 +124,8 @@ typedef struct {
 #define        REG_DUMP        0200    /* Unused */
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED  >= __MAC_10_8 \
- || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0
+ || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
+ || defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
 #define        REG_ENHANCED    0400    /* Additional (non-POSIX) features */
 #endif
 #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
@@ -191,7 +171,8 @@ typedef struct {
 #define        REG_BACKR       02000   /* force use of backref code */
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED  >= __MAC_10_8 \
- || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0
+ || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
+ || defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
 #define        REG_BACKTRACKING_MATCHER        REG_BACKR
 #endif
 #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
@@ -206,7 +187,7 @@ int regcomp(regex_t * __restrict, const char * __restrict, int) __DARWIN_ALIAS(r
 int    regcomp(regex_t * __restrict, const char * __restrict, int) LIBC_ALIAS(regcomp);
 #endif /* !LIBC_ALIAS_REGCOMP */
 //End-Libc
-size_t regerror(int, const regex_t * __restrict, char * __restrict, size_t);
+size_t regerror(int, const regex_t * __restrict, char * __restrict, size_t) __cold;
 /*
  * gcc under c99 mode won't compile "[ __restrict]" by itself.  As a workaround,
  * a dummy argument name is added.