X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/b5d655f7532a546b54809da387f7467d128a756b..70ad1dc8a19d6edd9b97aa81f32cfd65758ae97d:/include/glob.h diff --git a/include/glob.h b/include/glob.h index 13c8da4..4f2b684 100644 --- a/include/glob.h +++ b/include/glob.h @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -41,11 +37,9 @@ #define _GLOB_H_ #include <_types.h> - -#ifndef _SIZE_T -#define _SIZE_T -typedef __darwin_size_t size_t; -#endif +#include +#include +#include #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) struct dirent; @@ -58,7 +52,14 @@ typedef struct { int gl_flags; /* Copy of flags parameter to glob. */ char **gl_pathv; /* List of paths matching pattern. */ /* Copy of errfunc parameter to glob. */ - int (*gl_errfunc)(const char *, int); +#ifdef __BLOCKS__ + union { +#endif /* __BLOCKS__ */ + int (*gl_errfunc)(const char *, int); +#ifdef __BLOCKS__ + int (^gl_errblk)(const char *, int); + }; +#endif /* __BLOCKS__ */ /* * Alternate filesystem access methods for glob; replacement @@ -103,6 +104,9 @@ typedef struct { #define GLOB_QUOTE 0x0400 /* Quote special chars with \. */ #define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */ #define GLOB_LIMIT 0x1000 /* limit number of returned paths */ +#ifdef __BLOCKS__ +#define _GLOB_ERR_BLOCK 0x80000000 /* (internal) error callback is a block */ +#endif /* __BLOCKS__ */ /* source compatibility, these are the old names */ #define GLOB_MAXPATH GLOB_LIMIT @@ -120,6 +124,19 @@ int glob(const char * __restrict, int, int (*)(const char *, int), glob_t * __restrict) LIBC_INODE64(glob); #endif /* !LIBC_ALIAS_GLOB */ //End-Libc +#ifdef __BLOCKS__ +//Begin-Libc +#ifndef LIBC_ALIAS_GLOB_B +//End-Libc +int glob_b(const char * __restrict, int, int (^)(const char *, int), + glob_t * __restrict) __DARWIN_INODE64(glob_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); +//Begin-Libc +#else /* LIBC_ALIAS_GLOB_B */ +int glob_b(const char * __restrict, int, int (^)(const char *, int), + glob_t * __restrict) LIBC_INODE64(glob_b); +#endif /* !LIBC_ALIAS_GLOB_B */ +//End-Libc +#endif /* __BLOCKS__ */ void globfree(glob_t *); __END_DECLS