00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef INHERIT_H
00018 #define INHERIT_H
00019
00020 #include "apr_inherit.h"
00021
00022 #define APR_INHERIT (1 << 24)
00023
00024 #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \
00025 apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \
00026 { \
00027 if (the##name->flag & APR_FILE_NOCLEANUP) \
00028 return APR_EINVAL; \
00029 if (!(the##name->flag & APR_INHERIT)) { \
00030 the##name->flag |= APR_INHERIT; \
00031 apr_pool_child_cleanup_set(the##name->pool, \
00032 (void *)the##name, \
00033 cleanup, apr_pool_cleanup_null); \
00034 } \
00035 return APR_SUCCESS; \
00036 }
00037
00038 #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \
00039 apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name) \
00040 { \
00041 if (the##name->flag & APR_FILE_NOCLEANUP) \
00042 return APR_EINVAL; \
00043 if (the##name->flag & APR_INHERIT) { \
00044 the##name->flag &= ~APR_INHERIT; \
00045 apr_pool_child_cleanup_set(the##name->pool, \
00046 (void *)the##name, \
00047 cleanup, cleanup); \
00048 } \
00049 return APR_SUCCESS; \
00050 }
00051
00052 #endif