00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _GL_GLOB_H
00025 #define _GL_GLOB_H
00026
00027 #if 1
00028 # include <sys/cdefs.h>
00029 #endif
00030
00031 #include <stddef.h>
00032
00033
00034
00035
00036 #include <sys/stat.h>
00037
00038 #ifndef __BEGIN_DECLS
00039 # ifdef __cplusplus
00040 # define __BEGIN_DECLS extern "C" {
00041 # define __END_DECLS }
00042 # else
00043 # define __BEGIN_DECLS
00044 # define __END_DECLS
00045 # endif
00046 #endif
00047 #ifndef __THROW
00048 # define __THROW
00049 #endif
00050
00051
00052 #ifndef _GL_CXXDEFS_H
00053 #define _GL_CXXDEFS_H
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116 #if defined __cplusplus
00117 # define _GL_EXTERN_C extern "C"
00118 #else
00119 # define _GL_EXTERN_C extern
00120 #endif
00121
00122
00123
00124
00125
00126
00127
00128
00129 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
00130 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
00131 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
00132 _GL_EXTERN_C rettype rpl_func parameters_and_attributes
00133
00134
00135
00136
00137
00138
00139
00140
00141 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
00142 _GL_EXTERN_C rettype func parameters_and_attributes
00143
00144
00145
00146
00147
00148
00149
00150 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
00151 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
00152 #if defined __cplusplus && defined GNULIB_NAMESPACE
00153 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
00154 namespace GNULIB_NAMESPACE \
00155 { \
00156 rettype (*const func) parameters = ::rpl_func; \
00157 } \
00158 _GL_EXTERN_C int _gl_cxxalias_dummy
00159 #else
00160 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
00161 _GL_EXTERN_C int _gl_cxxalias_dummy
00162 #endif
00163
00164
00165
00166
00167
00168
00169 #if defined __cplusplus && defined GNULIB_NAMESPACE
00170 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
00171 namespace GNULIB_NAMESPACE \
00172 { \
00173 rettype (*const func) parameters = \
00174 reinterpret_cast<rettype(*)parameters>(::rpl_func); \
00175 } \
00176 _GL_EXTERN_C int _gl_cxxalias_dummy
00177 #else
00178 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
00179 _GL_EXTERN_C int _gl_cxxalias_dummy
00180 #endif
00181
00182
00183
00184
00185
00186
00187
00188
00189 #if defined __cplusplus && defined GNULIB_NAMESPACE
00190
00191
00192
00193
00194
00195
00196 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
00197 namespace GNULIB_NAMESPACE \
00198 { \
00199 static rettype (*func) parameters = ::func; \
00200 } \
00201 _GL_EXTERN_C int _gl_cxxalias_dummy
00202 #else
00203 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
00204 _GL_EXTERN_C int _gl_cxxalias_dummy
00205 #endif
00206
00207
00208
00209
00210
00211
00212 #if defined __cplusplus && defined GNULIB_NAMESPACE
00213 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
00214 namespace GNULIB_NAMESPACE \
00215 { \
00216 static rettype (*func) parameters = \
00217 reinterpret_cast<rettype(*)parameters>(::func); \
00218 } \
00219 _GL_EXTERN_C int _gl_cxxalias_dummy
00220 #else
00221 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
00222 _GL_EXTERN_C int _gl_cxxalias_dummy
00223 #endif
00224
00225
00226
00227
00228
00229
00230
00231 #if defined __cplusplus && defined GNULIB_NAMESPACE
00232
00233
00234
00235
00236
00237 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
00238 namespace GNULIB_NAMESPACE \
00239 { \
00240 static rettype (*func) parameters = \
00241 reinterpret_cast<rettype(*)parameters>( \
00242 (rettype2(*)parameters2)(::func)); \
00243 } \
00244 _GL_EXTERN_C int _gl_cxxalias_dummy
00245 #else
00246 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
00247 _GL_EXTERN_C int _gl_cxxalias_dummy
00248 #endif
00249
00250
00251
00252
00253
00254 #if defined __cplusplus && defined GNULIB_NAMESPACE
00255 # define _GL_CXXALIASWARN(func) \
00256 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
00257 # define _GL_CXXALIASWARN_1(func,namespace) \
00258 _GL_CXXALIASWARN_2 (func, namespace)
00259
00260
00261 # if !__OPTIMIZE__
00262 # define _GL_CXXALIASWARN_2(func,namespace) \
00263 _GL_WARN_ON_USE (func, \
00264 "The symbol ::" #func " refers to the system function. " \
00265 "Use " #namespace "::" #func " instead.")
00266 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00267 # define _GL_CXXALIASWARN_2(func,namespace) \
00268 extern __typeof__ (func) func
00269 # else
00270 # define _GL_CXXALIASWARN_2(func,namespace) \
00271 _GL_EXTERN_C int _gl_cxxalias_dummy
00272 # endif
00273 #else
00274 # define _GL_CXXALIASWARN(func) \
00275 _GL_EXTERN_C int _gl_cxxalias_dummy
00276 #endif
00277
00278
00279
00280
00281 #if defined __cplusplus && defined GNULIB_NAMESPACE
00282 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
00283 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
00284 GNULIB_NAMESPACE)
00285 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
00286 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
00287
00288
00289 # if !__OPTIMIZE__
00290 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
00291 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
00292 "The symbol ::" #func " refers to the system function. " \
00293 "Use " #namespace "::" #func " instead.")
00294 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00295 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
00296 extern __typeof__ (func) func
00297 # else
00298 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
00299 _GL_EXTERN_C int _gl_cxxalias_dummy
00300 # endif
00301 #else
00302 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
00303 _GL_EXTERN_C int _gl_cxxalias_dummy
00304 #endif
00305
00306 #endif
00307
00308
00309
00310
00311
00312 #ifndef _GL_ARG_NONNULL
00313 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
00314 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
00315 # else
00316 # define _GL_ARG_NONNULL(params)
00317 # endif
00318 #endif
00319
00320
00321 #ifndef _GL_WARN_ON_USE
00322
00323 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
00324
00325 # define _GL_WARN_ON_USE(function, message) \
00326 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
00327 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00328
00329 # define _GL_WARN_ON_USE(function, message) \
00330 extern __typeof__ (function) function
00331 # else
00332 # define _GL_WARN_ON_USE(function, message) \
00333 _GL_WARN_EXTERN_C int _gl_warn_on_use
00334 # endif
00335 #endif
00336
00337
00338
00339
00340
00341
00342
00343 #ifndef _GL_WARN_ON_USE_CXX
00344 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
00345 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
00346 extern rettype function parameters_and_attributes \
00347 __attribute__ ((__warning__ (msg)))
00348 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00349
00350 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
00351 extern rettype function parameters_and_attributes
00352 # else
00353 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
00354 _GL_WARN_EXTERN_C int _gl_warn_on_use
00355 # endif
00356 #endif
00357
00358
00359
00360 #ifndef _GL_WARN_EXTERN_C
00361 # if defined __cplusplus
00362 # define _GL_WARN_EXTERN_C extern "C"
00363 # else
00364 # define _GL_WARN_EXTERN_C extern
00365 # endif
00366 #endif
00367
00368 #ifndef __size_t
00369 # define __size_t size_t
00370 #endif
00371 #ifndef __USE_GNU
00372 # define __USE_GNU 1
00373 #endif
00374
00375
00376 #define glob rpl_glob
00377 #define globfree rpl_globfree
00378 #define glob_pattern_p rpl_glob_pattern_p
00379
00380 #define __GLOB_GNULIB 1
00381
00382
00383 #include "glob-libc.h"
00384
00385 __BEGIN_DECLS
00386 typedef int (*_gl_glob_errfunc_fn) (const char *, int);
00387 __END_DECLS
00388
00389 #if defined __cplusplus && defined GNULIB_NAMESPACE
00390 # undef glob
00391 # undef globfree
00392 # undef glob_pattern_p
00393 _GL_CXXALIAS_RPL (glob, int, (const char *_Restrict_ __pattern, int __flags,
00394 _gl_glob_errfunc_fn __errfunc,
00395 glob_t *_Restrict_ __pglob));
00396 _GL_CXXALIAS_RPL (globfree, void, (glob_t *__pglob));
00397 _GL_CXXALIAS_RPL (glob_pattern_p, int, (const char *__pattern, int __quote));
00398 # if 0
00399 _GL_CXXALIASWARN (glob);
00400 _GL_CXXALIASWARN (globfree);
00401 _GL_CXXALIASWARN (glob_pattern_p);
00402 # endif
00403 #endif
00404
00405 #endif