00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef APR_POOLS_H
00018 #define APR_POOLS_H
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #include "apr.h"
00044 #include "apr_errno.h"
00045 #include "apr_general.h"
00046 #define APR_WANT_MEMFUNC
00047 #include "apr_want.h"
00048
00049 #ifdef __cplusplus
00050 extern "C" {
00051 #endif
00052
00053
00054
00055
00056
00057
00058
00059
00060 typedef struct apr_pool_t apr_pool_t;
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081 #define APR_POOL_DECLARE_ACCESSOR(type) \
00082 APR_DECLARE(apr_pool_t *) apr_##type##_pool_get \
00083 (const apr_##type##_t *the##type)
00084
00085
00086
00087
00088
00089
00090
00091 #define APR_POOL_IMPLEMENT_ACCESSOR(type) \
00092 APR_DECLARE(apr_pool_t *) apr_##type##_pool_get \
00093 (const apr_##type##_t *the##type) \
00094 { return the##type->pool; }
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132 #if defined(APR_POOL_DEBUG)
00133
00134 #if (APR_POOL_DEBUG - APR_POOL_DEBUG -1 == 1)
00135 #undef APR_POOL_DEBUG
00136 #define APR_POOL_DEBUG 1
00137 #endif
00138 #else
00139 #define APR_POOL_DEBUG 0
00140 #endif
00141
00142
00143 #define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__)
00144
00145
00146
00147
00148 typedef int (*apr_abortfunc_t)(int retcode);
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164 APR_DECLARE(apr_status_t) apr_pool_initialize(void);
00165
00166
00167
00168
00169
00170
00171
00172 APR_DECLARE(void) apr_pool_terminate(void);
00173
00174
00175
00176
00177
00178
00179 #include "apr_allocator.h"
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196 APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool,
00197 apr_pool_t *parent,
00198 apr_abortfunc_t abort_fn,
00199 apr_allocator_t *allocator);
00200
00201
00202
00203
00204
00205 APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool,
00206 apr_abortfunc_t abort_fn,
00207 apr_allocator_t *allocator);
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221 APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool,
00222 apr_abortfunc_t abort_fn,
00223 apr_allocator_t *allocator);
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241 APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool,
00242 apr_pool_t *parent,
00243 apr_abortfunc_t abort_fn,
00244 apr_allocator_t *allocator,
00245 const char *file_line);
00246
00247 #if APR_POOL_DEBUG
00248 #define apr_pool_create_ex(newpool, parent, abort_fn, allocator) \
00249 apr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \
00250 APR_POOL__FILE_LINE__)
00251 #endif
00252
00253
00254
00255
00256
00257 APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool,
00258 apr_abortfunc_t abort_fn,
00259 apr_allocator_t *allocator,
00260 const char *file_line);
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277 APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpool,
00278 apr_abortfunc_t abort_fn,
00279 apr_allocator_t *allocator,
00280 const char *file_line);
00281
00282 #if APR_POOL_DEBUG
00283 #define apr_pool_create_core_ex(newpool, abort_fn, allocator) \
00284 apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, allocator, \
00285 APR_POOL__FILE_LINE__)
00286
00287 #define apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator) \
00288 apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, allocator, \
00289 APR_POOL__FILE_LINE__)
00290
00291 #endif
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305 #if defined(DOXYGEN)
00306 APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool,
00307 apr_pool_t *parent);
00308 #else
00309 #if APR_POOL_DEBUG
00310 #define apr_pool_create(newpool, parent) \
00311 apr_pool_create_ex_debug(newpool, parent, NULL, NULL, \
00312 APR_POOL__FILE_LINE__)
00313 #else
00314 #define apr_pool_create(newpool, parent) \
00315 apr_pool_create_ex(newpool, parent, NULL, NULL)
00316 #endif
00317 #endif
00318
00319
00320
00321
00322
00323 #if defined(DOXYGEN)
00324 APR_DECLARE(apr_status_t) apr_pool_create_core(apr_pool_t **newpool);
00325 APR_DECLARE(apr_status_t) apr_pool_create_unmanaged(apr_pool_t **newpool);
00326 #else
00327 #if APR_POOL_DEBUG
00328 #define apr_pool_create_core(newpool) \
00329 apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \
00330 APR_POOL__FILE_LINE__)
00331 #define apr_pool_create_unmanaged(newpool) \
00332 apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \
00333 APR_POOL__FILE_LINE__)
00334 #else
00335 #define apr_pool_create_core(newpool) \
00336 apr_pool_create_unmanaged_ex(newpool, NULL, NULL)
00337 #define apr_pool_create_unmanaged(newpool) \
00338 apr_pool_create_unmanaged_ex(newpool, NULL, NULL)
00339 #endif
00340 #endif
00341
00342
00343
00344
00345
00346 APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool);
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356 APR_DECLARE(void) apr_pool_clear(apr_pool_t *p);
00357
00358
00359
00360
00361
00362
00298
00299
00300
00301
00302
00303
00304
00305 #if defined(DOXYGEN)
00306 APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool,
00307 apr_pool_t *parent);
00308 #else
00309 #if APR_POOL_DEBUG
00310 #define apr_pool_create(newpool, parent) \
00311 apr_pool_create_ex_debug(newpool, parent, NULL, NULL, \
00312 APR_POOL__FILE_LINE__)
00313 #else
00314 #define apr_pool_create(newpool, parent) \
00315 apr_pool_create_ex(newpool, parent, NULL, NULL)
00316 #endif
00317 #endif
00318
00319
00320
00321
00322
00323 #if defined(DOXYGEN)
00324 APR_DECLARE(apr_status_t) apr_pool_create_core(apr_pool_t **newpool);
00325 APR_DECLARE(apr_status_t) apr_pool_create_unmanaged(apr_pool_t **newpool);
00326 #else
00327 #if APR_POOL_DEBUG
00328 #define apr_pool_create_core(newpool) \
00329 apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \
00330 APR_POOL__FILE_LINE__)
00331 #define apr_pool_create_unmanaged(newpool) \
00332 apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \
00333 APR_POOL__FILE_LINE__)
00334 #else
00335 #define apr_pool_create_core(newpool) \
00336 apr_pool_create_unmanaged_ex(newpool, NULL, NULL)
00337 #define apr_pool_create_unmanaged(newpool) \
00338 apr_pool_create_unmanaged_ex(newpool, NULL, NULL)
00339 #endif
00340 #endif
00341
00342
00343
00344
00345
00346 APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool);
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356 APR_DECLARE(void) apr_pool_clear(apr_pool_t *p);
00357
00358
00359
00360
00361
00362
00298
00299
00300
00301
00302
00303
00304
00305 #if defined(DOXYGEN)
00306 APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool,
00307 apr_pool_t *parent);
00308 #else
00309 #if APR_POOL_DEBUG
00310 #define apr_pool_create(newpool, parent) \
00311 apr_pool_create_ex_debug(newpool, parent, NULL, NULL, \
00312 APR_POOL__FILE_LINE__)
00313 #else
00314 #define apr_pool_create(newpool, parent) \
00315 apr_pool_create_ex(newpool, parent, NULL, NULL)
00316 #endif
00317 #endif
00318
00319
00320
00321
00322
00323 #if defined(DOXYGEN)
00324 APR_DECLARE(apr_status_t) apr_pool_create_core(apr_pool_t **newpool);
00325 APR_DECLARE(apr_status_t) apr_pool_create_unmanaged(apr_pool_t **newpool);
00326 #else
00327 #if APR_POOL_DEBUG
00328 #define apr_pool_create_core(newpool) \
00329 apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \
00330 APR_POOL__FILE_LINE__)
00331 #define apr_pool_create_unmanaged(newpool) \
00332 apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \
00333 APR_POOL__FILE_LINE__)
00334 #else
00335 #define apr_pool_create_core(newpool) \
00336 apr_pool_create_unmanaged_ex(newpool, NULL, NULL)
00337 #define apr_pool_create_unmanaged(newpool) \
00338 apr_pool_create_unmanaged_ex(newpool, NULL, NULL)
00339 #endif
00340 #endif
00341
00342
00343
00344
00345
00346 APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool);
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356 APR_DECLARE(void) apr_pool_clear(apr_pool_t *p);
00357
00358
00359
00360
00361
00362
00298
00299
00300
00301
00302
00303
00304
00305 #if defined(DOXYGEN)
00306 APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool,
00307 apr_pool_t *parent);
00308 #else
00309 #if APR_POOL_DEBUG
00310 #define apr_pool_create(newpool, parent) \
00311 apr_pool_create_ex_debug(newpool, parent, NULL, NULL, \
00312 APR_POOL__FILE_LINE__)
00313 #else
00314 #define apr_pool_create(newpool, parent) \
00315 apr_pool_create_ex(newpool, parent, NULL, NULL)
00316 #endif
00317 #endif
00318
00319
00320
00321
00322
00323 #if defined(DOXYGEN)
00324 APR_DECLARE(apr_status_t) apr_pool_create_core(apr_pool_t **newpool);
00325 APR_DECLARE(apr_status_t) apr_pool_create_unmanaged(apr_pool_t **newpool);
00326 #else
00327 #if APR_POOL_DEBUG
00328 #define apr_pool_create_core(newpool) \
00329 apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \
00330 APR_POOL__FILE_LINE__)
00331 #define apr_pool_create_unmanaged(newpool) \
00332 apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \
00333 APR_POOL__FILE_LINE__)
00334 #else
00335 #define apr_pool_create_core(newpool) \
00336 apr_pool_create_unmanaged_ex(newpool, NULL, NULL)
00337 #define apr_pool_create_unmanaged(newpool) \
00338 apr_pool_create_unmanaged_ex(newpool, NULL, NULL)
00339 #endif
00340 #endif
00341
00342
00343
00344
00345
00346 APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool);
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356 APR_DECLARE(void) apr_pool_clear(apr_pool_t *p);
00357
00358
00359
00360
00361
00362
00298
00299
00300
00301
00302
00303
00304
00305 #if defined(DOXYGEN)
00306 APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool,
00307 apr_pool_t *parent);
00308 #else
00309 #if APR_POOL_DEBUG
00310 #define apr_pool_create(newpool, parent) \
00311 apr_pool_create_ex_debug(newpool, parent, NULL, NULL, \
00312 APR_POOL__FILE_LINE__)
00313 #else
00314 #define apr_pool_create(newpool, parent) \
00315 apr_pool_create_ex(newpool, parent, NULL, NULL)
00316 #endif
00317 #endif
00318
00319
00320
00321
00322
00323 #if defined(DOXYGEN)
00324 APR_DECLARE(apr_status_t) apr_pool_create_core(apr_pool_t **newpool);
00325 APR_DECLARE(apr_status_t) apr_pool_create_unmanaged(apr_pool_t **newpool);
00326 #else
00327 #if APR_POOL_DEBUG
00328 #define apr_pool_create_core(newpool) \
00329 apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \
00330 APR_POOL__FILE_LINE__)
00331 #define apr_pool_create_unmanaged(newpool) \
00332 apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \
00333 APR_POOL__FILE_LINE__)
00334 #else
00335 #define apr_pool_create_core(newpool) \
00336 apr_pool_create_unmanaged_ex(newpool, NULL, NULL)
00337 #define apr_pool_create_unmanaged(newpool) \
00338 apr_pool_create_unmanaged_ex(newpool, NULL, NULL)
00339 #endif
00340 #endif
00341
00342
00343
00344
00345
00346 APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool);
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356 APR_DECLARE(void) apr_pool_clear(apr_pool_t *p);
00357
00358
00359
00360
00361
00362
00298
00299
00300
00301
00302
00303
00304
00305 #if defined(DOXYGEN)
00306 APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool,
00307 apr_pool_t *parent);
00308 #else
00309 #if APR_POOL_DEBUG
00310 #define apr_pool_create(newpool, parent) \
00311 apr_pool_create_ex_debug(newpool, parent, NULL, NULL, \
00312 APR_POOL__FILE_LINE__)
00313 #else
00314 #define apr_pool_create(newpool, parent) \
00315 apr_pool_create_ex(newpool, parent, NULL, NULL)
00316 #endif
00317 #endif
00318
00319
00320
00321
00322
00323 #if defined(DOXYGEN)
00324 APR_DECLARE(apr_status_t) apr_pool_create_core(apr_pool_t **newpool);
00325 APR_DECLARE(apr_status_t) apr_pool_create_unmanaged(apr_pool_t **newpool);
00326 #else
00327 #if APR_POOL_DEBUG
00328 #define apr_pool_create_core(newpool) \
00329 apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \
00330 APR_POOL__FILE_LINE__)
00331 #define apr_pool_create_unmanaged(newpool) \
00332 apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \
00333 APR_POOL__FILE_LINE__)
00334 #else
00335 #define apr_pool_create_core(newpool) \
00336 apr_pool_create_unmanaged_ex(newpool, NULL, NULL)
00337 #define apr_pool_create_unmanaged(newpool) \
00338 apr_pool_create_unmanaged_ex(newpool, NULL, NULL)
00339 #endif
00340 #endif
00341
00342
00343
00344
00345
00346 APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool);
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356 APR_DECLARE(void) apr_pool_clear(apr_pool_t *p);
00357
00358
00359
00360
00361
00362
00298
00299
00300
00301
00302
00303
00304
00305 #if defined(DOXYGEN)
00306 APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool,
00307 apr_pool_t *parent);
00308 #else
00309 #if APR_POOL_DEBUG
00310 #define apr_pool_create(newpool, parent) \
00311 apr_pool_create_ex_debug(newpool, parent, NULL, NULL, \
00312 APR_POOL__FILE_LINE__)
00313 #else
00314 #define apr_pool_create(newpool, parent) \
00315 apr_pool_create_ex(newpool, parent, NULL, NULL)
00316 #endif
00317 #endif
00318
00319
00320
00321
00322
00323 #if defined(DOXYGEN)
00324 APR_DECLARE(apr_status_t) apr_pool_create_core(apr_pool_t **newpool);
00325 APR_DECLARE(apr_status_t) apr_pool_create_unmanaged(apr_pool_t **newpool);
00326 #else
00327 #if APR_POOL_DEBUG
00328 #define apr_pool_create_core(newpool) \
00329 apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \
00330 APR_POOL__FILE_LINE__)
00331 #define apr_pool_create_unmanaged(newpool) \
00332 apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \
00333 APR_POOL__FILE_LINE__)
00334 #else
00335 #define apr_pool_create_core(newpool) \
00336 apr_pool_create_unmanaged_ex(newpool, NULL, NULL)
00337 #define apr_pool_create_unmanaged(newpool) \
00338 apr_pool_create_unmanaged_ex(newpool, NULL, NULL)
00339 #endif
00340 #endif
00341
00342
00343
00344
00345
00346 APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool);
00347
00348
00349
00350
00351
00352