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
00019
00020 #ifndef _GLOB_H
00021 #define _GLOB_H 1
00022
00023 #ifndef __GLOB_GNULIB
00024 # include <sys/cdefs.h>
00025 #endif
00026
00027
00028
00029
00030
00031
00032 #ifndef _Restrict_
00033 # if 199901L <= __STDC_VERSION__
00034 # define _Restrict_ restrict
00035 # elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)
00036 # define _Restrict_ __restrict
00037 # else
00038 # define _Restrict_
00039 # endif
00040 #endif
00041
00042 __BEGIN_DECLS
00043
00044
00045 #ifndef __size_t
00046 # if defined __GNUC__ && __GNUC__ >= 2
00047 typedef __SIZE_TYPE__ __size_t;
00048 # ifdef __USE_XOPEN
00049 typedef __SIZE_TYPE__ size_t;
00050 # endif
00051 # else
00052 # include <stddef.h>
00053 # ifndef __size_t
00054 # define __size_t size_t
00055 # endif
00056 # endif
00057 #else
00058
00059
00060 # undef __size_t
00061 # define __size_t size_t
00062 #endif
00063
00064
00065 #define GLOB_ERR (1 << 0)
00066 #define GLOB_MARK (1 << 1)
00067 #define GLOB_NOSORT (1 << 2)
00068 #define GLOB_DOOFFS (1 << 3)
00069 #define GLOB_NOCHECK (1 << 4)
00070 #define GLOB_APPEND (1 << 5)
00071 #define GLOB_NOESCAPE (1 << 6)
00072 #define GLOB_PERIOD (1 << 7)
00073
00074 #if !defined __USE_POSIX2 || defined __USE_BSD || defined __USE_GNU
00075 # define GLOB_MAGCHAR (1 << 8)
00076 # define GLOB_ALTDIRFUNC (1 << 9)
00077 # define GLOB_BRACE (1 << 10)
00078 # define GLOB_NOMAGIC (1 << 11)
00079 # define GLOB_TILDE (1 << 12)
00080 # define GLOB_ONLYDIR (1 << 13)
00081 # define GLOB_TILDE_CHECK (1 << 14)
00082
00083 # define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
00084 GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
00085 GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
00086 GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
00087 #else
00088 # define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
00089 GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
00090 GLOB_PERIOD)
00091 #endif
00092
00093
00094 #define GLOB_NOSPACE 1
00095 #define GLOB_ABORTED 2
00096 #define GLOB_NOMATCH 3
00097 #define GLOB_NOSYS 4
00098 #ifdef __USE_GNU
00099
00100
00101 # define GLOB_ABEND GLOB_ABORTED
00102 #endif
00103
00104
00105 #ifdef __USE_GNU
00106 struct stat;
00107 #endif
00108 typedef struct
00109 {
00110 __size_t gl_pathc;
00111 char **gl_pathv;
00112 __size_t gl_offs;
00113 int gl_flags;
00114
00115
00116
00117 void (*gl_closedir) (void *);
00118 #ifdef __USE_GNU
00119 struct dirent *(*gl_readdir) (void *);
00120 #else
00121 void *(*gl_readdir) (void *);
00122 #endif
00123 void *(*gl_opendir) (const char *);
00124 #ifdef __USE_GNU
00125 int (*gl_lstat) (const char *_Restrict_, struct stat *_Restrict_);
00126 int (*gl_stat) (const char *_Restrict_, struct stat *_Restrict_);
00127 #else
00128 int (*gl_lstat) (const char *_Restrict_, void *_Restrict_);
00129 int (*gl_stat) (const char *_Restrict_, void *_Restrict_);
00130 #endif
00131 } glob_t;
00132
00133 #if defined __USE_LARGEFILE64 && !defined __GLOB_GNULIB
00134 # ifdef __USE_GNU
00135 struct stat64;
00136 # endif
00137 typedef struct
00138 {
00139 __size_t gl_pathc;
00140 char **gl_pathv;
00141 __size_t gl_offs;
00142 int gl_flags;
00143
00144
00145
00146 void (*gl_closedir) (void *);
00147 # ifdef __USE_GNU
00148 struct dirent64 *(*gl_readdir) (void *);
00149 # else
00150 void *(*gl_readdir) (void *);
00151 # endif
00152 void *(*gl_opendir) (const char *);
00153 # ifdef __USE_GNU
00154 int (*gl_lstat) (const char *_Restrict_, struct stat64 *_Restrict_);
00155 int (*gl_stat) (const char *_Restrict_, struct stat64 *_Restrict_);
00156 # else
00157 int (*gl_lstat) (const char *_Restrict_, void *_Restrict_);
00158 int (*gl_stat) (const char *_Restrict_, void *_Restrict_);
00159 # endif
00160 } glob64_t;
00161 #endif
00162
00163 #if __USE_FILE_OFFSET64 && __GNUC__ < 2 && !defined __GLOB_GNULIB
00164 # define glob glob64
00165 # define globfree globfree64
00166 #endif
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176 #if !defined __USE_FILE_OFFSET64 || __GNUC__ < 2 || defined __GLOB_GNULIB
00177 extern int glob (const char *_Restrict_ __pattern, int __flags,
00178 int (*__errfunc) (const char *, int),
00179 glob_t *_Restrict_ __pglob) __THROW _GL_ARG_NONNULL ((1, 4));
00180
00181
00182 extern void globfree (glob_t *__pglob) __THROW _GL_ARG_NONNULL ((1));
00183 #else
00184 extern int __REDIRECT_NTH (glob, (const char *_Restrict_ __pattern,
00185 int __flags,
00186 int (*__errfunc) (const char *, int),
00187 glob_t *_Restrict_ __pglob), glob64);
00188
00189 extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64);
00190 #endif
00191
00192 #if defined __USE_LARGEFILE64 && !defined __GLOB_GNULIB
00193 extern int glob64 (const char *_Restrict_ __pattern, int __flags,
00194 int (*__errfunc) (const char *, int),
00195 glob64_t *_Restrict_ __pglob)
00196 __THROW _GL_ARG_NONNULL ((1, 4));
00197
00198 extern void globfree64 (glob64_t *__pglob) __THROW _GL_ARG_NONNULL ((1));
00199 #endif
00200
00201
00202 #ifdef __USE_GNU
00203
00204
00205
00206
00207
00208 extern int glob_pattern_p (const char *__pattern, int __quote)
00209 __THROW _GL_ARG_NONNULL ((1));
00210 #endif
00211
00212 __END_DECLS
00213
00214 #endif