]> git.saurik.com Git - apple/libc.git/blobdiff - include/regex.h
Libc-1353.11.2.tar.gz
[apple/libc.git] / include / regex.h
index d362ab4660bc4fc854282219b885fdac2d1b22ef..7ef9b35f10e62ccfe7c6f91b608b9737f27973d4 100644 (file)
 #ifndef _REGEX_H_
 #define        _REGEX_H_
 
-#include <_types.h>
-#include <Availability.h>
-
-/*********/
-/* types */
-/*********/
-#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
-#ifndef        __cplusplus
-#ifndef        _WCHAR_T
-#define        _WCHAR_T
-typedef        __darwin_wchar_t        wchar_t;
-#endif /* _WCHAR_T */
-#endif /* __cplusplus */
-#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
-
-typedef __darwin_off_t regoff_t;
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef __darwin_size_t        size_t;
-#endif
-
-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 */
@@ -139,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
@@ -154,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 */
@@ -200,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 */
@@ -215,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.