123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- #ifndef _GLOB_H
- #define _GLOB_H 1
- #ifdef __cplusplus
- extern "C" {
- #endif
- #undef __ptr_t
- #if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
- # if !defined __GLIBC__ || !defined __P
- # undef __P
- # undef __PMT
- # define __P(protos) protos
- # define __PMT(protos) protos
- # if !defined __GNUC__ || __GNUC__ < 2
- # undef __const
- # define __const const
- # endif
- # endif
- # define __ptr_t void *
- #else
- # undef __P
- # undef __PMT
- # define __P(protos) ()
- # define __PMT(protos) ()
- # undef __const
- # define __const
- # define __ptr_t char *
- #endif
- #ifndef __size_t
- # if defined __GNUC__ && __GNUC__ >= 2
- typedef __SIZE_TYPE__ __size_t;
- # ifdef _XOPEN_SOURCE
- typedef __SIZE_TYPE__ size_t;
- # endif
- # else
- typedef unsigned long int __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 _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _BSD_SOURCE \
- || defined _GNU_SOURCE)
- # 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 _GNU_SOURCE
- # define GLOB_ABEND GLOB_ABORTED
- #endif
- #if !defined _AMIGA && !defined VMS
- # ifdef _GNU_SOURCE
- struct stat;
- # endif
- #endif
- typedef struct
- {
- __size_t gl_pathc;
- char **gl_pathv;
- __size_t gl_offs;
- int gl_flags;
-
- void (*gl_closedir) __PMT ((void *));
- #ifdef _GNU_SOURCE
- struct dirent *(*gl_readdir) __PMT ((void *));
- #else
- void *(*gl_readdir) __PMT ((void *));
- #endif
- __ptr_t (*gl_opendir) __PMT ((__const char *));
- #ifdef _GNU_SOURCE
- int (*gl_lstat) __PMT ((__const char *__restrict,
- struct stat *__restrict));
- int (*gl_stat) __PMT ((__const char *__restrict, struct stat *__restrict));
- #else
- int (*gl_lstat) __PMT ((__const char *__restrict, void *__restrict));
- int (*gl_stat) __PMT ((__const char *__restrict, void *__restrict));
- #endif
- } glob_t;
- #ifdef _LARGEFILE64_SOURCE
- # ifdef _GNU_SOURCE
- struct stat64;
- # endif
- typedef struct
- {
- __size_t gl_pathc;
- char **gl_pathv;
- __size_t gl_offs;
- int gl_flags;
-
- void (*gl_closedir) __PMT ((void *));
- # ifdef _GNU_SOURCE
- struct dirent64 *(*gl_readdir) __PMT ((void *));
- # else
- void *(*gl_readdir) __PMT ((void *));
- # endif
- __ptr_t (*gl_opendir) __PMT ((__const char *));
- # ifdef _GNU_SOURCE
- int (*gl_lstat) __PMT ((__const char *__restrict,
- struct stat64 *__restrict));
- int (*gl_stat) __PMT ((__const char *__restrict,
- struct stat64 *__restrict));
- # else
- int (*gl_lstat) __PMT ((__const char *__restrict, void *__restrict));
- int (*gl_stat) __PMT ((__const char *__restrict, void *__restrict));
- # endif
- } glob64_t;
- #endif
- #if _FILE_OFFSET_BITS == 64 && __GNUC__ < 2
- # define glob glob64
- # define globfree globfree64
- #endif
- #if _FILE_OFFSET_BITS != 64 || __GNUC__ < 2
- extern int glob __P ((__const char *__restrict __pattern, int __flags,
- int (*__errfunc) (__const char *, int),
- glob_t *__restrict __pglob));
- extern void globfree __P ((glob_t *__pglob));
- #else
- extern int glob __P ((__const char *__restrict __pattern, int __flags,
- int (*__errfunc) (__const char *, int),
- glob_t *__restrict __pglob)) __asm__ ("glob64");
- extern void globfree __P ((glob_t *__pglob)) __asm__ ("globfree64");
- #endif
- #ifdef _LARGEFILE64_SOURCE
- extern int glob64 __P ((__const char *__restrict __pattern, int __flags,
- int (*__errfunc) (__const char *, int),
- glob64_t *__restrict __pglob));
- extern void globfree64 __P ((glob64_t *__pglob));
- #endif
- #ifdef _GNU_SOURCE
- extern int glob_pattern_p __P ((__const char *__pattern, int __quote));
- #endif
- #ifdef __cplusplus
- }
- #endif
- #endif
|