123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- #ifndef _GLOB_H
- #define _GLOB_H 1
- #include <sys/cdefs.h>
- __BEGIN_DECLS
- #ifndef __size_t
- typedef __SIZE_TYPE__ __size_t;
- # if defined __USE_XOPEN || __USE_XOPEN2K8
- typedef __SIZE_TYPE__ size_t;
- # endif
- #else
- # undef __size_t
- # define __size_t size_t
- #endif
- #define GLOB_ERR (1 << 0)
- #define GLOB_MARK (1 << 1)
- #define GLOB_NOSORT (1 << 2)
- #define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */
- #define GLOB_NOCHECK (1 << 4)
- #define GLOB_APPEND (1 << 5)
- #define GLOB_NOESCAPE (1 << 6)
- #define GLOB_PERIOD (1 << 7)
- #if !defined __USE_POSIX2 || defined __USE_MISC
- # define GLOB_MAGCHAR (1 << 8)
- # define GLOB_ALTDIRFUNC (1 << 9)
- # define GLOB_BRACE (1 << 10)
- # define GLOB_NOMAGIC (1 << 11)
- # define GLOB_TILDE (1 << 12)
- # define GLOB_ONLYDIR (1 << 13)
- # define GLOB_TILDE_CHECK (1 << 14)
- # define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
- GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
- GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
- GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
- #else
- # define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
- GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
- GLOB_PERIOD)
- #endif
- #define GLOB_NOSPACE 1
- #define GLOB_ABORTED 2
- #define GLOB_NOMATCH 3
- #define GLOB_NOSYS 4
- #ifdef __USE_GNU
- # define GLOB_ABEND GLOB_ABORTED
- #endif
- #ifdef __USE_GNU
- struct stat;
- #endif
- typedef struct
- {
- __size_t gl_pathc;
- char **gl_pathv;
- __size_t gl_offs;
- int gl_flags;
-
- void (*gl_closedir) (void *);
- #ifdef __USE_GNU
- struct dirent *(*gl_readdir) (void *);
- #else
- void *(*gl_readdir) (void *);
- #endif
- void *(*gl_opendir) (const char *);
- #ifdef __USE_GNU
- int (*gl_lstat) (const char *__restrict, struct stat *__restrict);
- int (*gl_stat) (const char *__restrict, struct stat *__restrict);
- #else
- int (*gl_lstat) (const char *__restrict, void *__restrict);
- int (*gl_stat) (const char *__restrict, void *__restrict);
- #endif
- } glob_t;
- #ifdef __USE_LARGEFILE64
- # ifdef __USE_GNU
- struct stat64;
- # endif
- typedef struct
- {
- __size_t gl_pathc;
- char **gl_pathv;
- __size_t gl_offs;
- int gl_flags;
-
- void (*gl_closedir) (void *);
- # ifdef __USE_GNU
- struct dirent64 *(*gl_readdir) (void *);
- # else
- void *(*gl_readdir) (void *);
- # endif
- void *(*gl_opendir) (const char *);
- # ifdef __USE_GNU
- int (*gl_lstat) (const char *__restrict, struct stat64 *__restrict);
- int (*gl_stat) (const char *__restrict, struct stat64 *__restrict);
- # else
- int (*gl_lstat) (const char *__restrict, void *__restrict);
- int (*gl_stat) (const char *__restrict, void *__restrict);
- # endif
- } glob64_t;
- #endif
- #if !defined __USE_FILE_OFFSET64
- extern int glob (const char *__restrict __pattern, int __flags,
- int (*__errfunc) (const char *, int),
- glob_t *__restrict __pglob) __THROW;
- extern void globfree (glob_t *__pglob) __THROW;
- #else
- extern int __REDIRECT_NTH (glob, (const char *__restrict __pattern,
- int __flags,
- int (*__errfunc) (const char *, int),
- glob_t *__restrict __pglob), glob64);
- extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64);
- #endif
- #ifdef __USE_LARGEFILE64
- extern int glob64 (const char *__restrict __pattern, int __flags,
- int (*__errfunc) (const char *, int),
- glob64_t *__restrict __pglob) __THROW;
- extern void globfree64 (glob64_t *__pglob) __THROW;
- #endif
- #ifdef __USE_GNU
- extern int glob_pattern_p (const char *__pattern, int __quote) __THROW;
- #endif
- __END_DECLS
- #endif
|