Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _GLOB_H
00019 #define _GLOB_H 1
00020
00021 #if defined(hpux) || defined(__hpux)
00022 #define _GLOB_INCLUDED
00023 #endif
00024
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028
00029 #undef __ptr_t
00030 #if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
00031 # if !defined __GLIBC__ || !defined __P || !defined __PMT
00032 # undef __P
00033 # undef __PMT
00034 # define __P(protos) protos
00035 # define __PMT(protos) protos
00036 # if !defined __GNUC__ || __GNUC__ < 2
00037 # undef __const
00038 # define __const const
00039 # endif
00040 # endif
00041 # define __ptr_t void *
00042 #else
00043 # undef __P
00044 # undef __PMT
00045 # define __P(protos) ()
00046 # define __PMT(protos) ()
00047 # undef __const
00048 # define __const
00049 # define __ptr_t char *
00050 #endif
00051
00052
00053 #if !defined(__size_t) && !defined(_BSD_SIZE_T_DEFINED_)
00054 # if defined __GNUC__ && __GNUC__ >= 2
00055 typedef __SIZE_TYPE__ __size_t;
00056 # if 0
00057 # ifdef _XOPEN_SOURCE
00058 typedef __SIZE_TYPE__ size_t;
00059 # endif
00060 # endif
00061 # else
00062
00063 typedef unsigned long int __size_t;
00064 # endif
00065 #else
00066
00067
00068 # undef __size_t
00069 # define __size_t size_t
00070 #endif
00071
00072
00073 #define GLOB_ERR (1 << 0)
00074 #define GLOB_MARK (1 << 1)
00075 #define GLOB_NOSORT (1 << 2)
00076 #define GLOB_DOOFFS (1 << 3)
00077 #define GLOB_NOCHECK (1 << 4)
00078 #define GLOB_APPEND (1 << 5)
00079 #define GLOB_NOESCAPE (1 << 6)
00080 #define GLOB_PERIOD (1 << 7)
00081
00082 #if (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _BSD_SOURCE \
00083 || defined _GNU_SOURCE)
00084 # define GLOB_MAGCHAR (1 << 8)
00085 # define GLOB_ALTDIRFUNC (1 << 9)
00086 # define GLOB_BRACE (1 << 10)
00087 # define GLOB_NOMAGIC (1 << 11)
00088 # define GLOB_TILDE (1 << 12)
00089 # define GLOB_ONLYDIR (1 << 13)
00090 # define GLOB_TILDE_CHECK (1 << 14)
00091
00092 # define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
00093 GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
00094 GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
00095 GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
00096 #else
00097 # define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
00098 GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
00099 GLOB_PERIOD)
00100 #endif
00101
00102
00103 #define GLOB_NOSPACE 1
00104 #define GLOB_ABORTED 2
00105 #define GLOB_NOMATCH 3
00106 #define GLOB_NOSYS 4
00107 #ifdef _GNU_SOURCE
00108
00109
00110 # define GLOB_ABEND GLOB_ABORTED
00111 #endif
00112
00113
00114 #if !defined _AMIGA && !defined VMS
00115 struct stat;
00116 #endif
00117 typedef struct
00118 {
00119 __size_t gl_pathc;
00120 char **gl_pathv;
00121 __size_t gl_offs;
00122 int gl_flags;
00123
00124
00125
00126 void (*gl_closedir) __PMT ((void *))
00127 ;
00128 struct dirent *(*gl_readdir) __PMT ((void *))
00129 ;
00130 __ptr_t (*gl_opendir) __PMT ((__const char *))
00131 ;
00132 int (*gl_lstat) __PMT ((__const char *, struct stat *))
00133 ;
00134 int (*gl_stat) __PMT ((__const char *, struct stat *))
00135 ;
00136 } glob_t;
00137
00138 #ifdef _LARGEFILE64_SOURCE
00139 struct stat64;
00140 typedef struct
00141 {
00142 __size_t gl_pathc;
00143 char **gl_pathv;
00144 __size_t gl_offs;
00145 int gl_flags;
00146
00147
00148
00149 void (*gl_closedir) __PMT ((void *))
00150 ;
00151 struct dirent64 *(*gl_readdir) __PMT ((void *))
00152 ;
00153 __ptr_t (*gl_opendir) __PMT ((__const char *))
00154 ;
00155 int (*gl_lstat) __PMT ((__const char *, struct stat64 *))
00156 ;
00157 int (*gl_stat) __PMT ((__const char *, struct stat64 *))
00158 ;
00159 } glob64_t;
00160 #endif
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS != 64
00171 extern int glob __P ((__const char *__pattern, int __flags,
00172 int (*__errfunc) (__const char *, int),
00173 glob_t *__pglob))
00174
00175 ;
00176
00177
00178 extern void globfree __P ((glob_t *__pglob));
00179 #else
00180 # if defined(__GNUC__) && __GNUC__ >= 2
00181 extern int glob __P ((__const char *__pattern, int __flags,
00182 int (*__errfunc) (__const char *, int),
00183 glob_t *__pglob)) __asm__ ("glob64")
00184
00185 ;
00186
00187 extern void globfree __P ((glob_t *__pglob)) __asm__ ("globfree64")
00188 ;
00189 # else
00190 # define glob glob64
00191 # define globfree globfree64
00192 # define glob_t glob64_t
00193 # endif
00194 #endif
00195
00196 #ifdef _LARGEFILE64_SOURCE
00197
00198 extern int glob64 __P ((__const char *__pattern, int __flags,
00199 int (*__errfunc) (__const char *, int),
00200 glob64_t *__pglob))
00201
00202 ;
00203
00204 extern void globfree64 __P ((glob64_t *__pglob))
00205 ;
00206
00207 #endif
00208
00209
00210 #ifdef _GNU_SOURCE
00211
00212
00213
00214
00215
00216 extern int glob_pattern_p __P ((__const char *__pattern, int __quote))
00217 ;
00218 #endif
00219
00220 #ifdef __cplusplus
00221 }
00222 #endif
00223
00224 #endif