00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef APR_OPTIONAL_H
00018 #define APR_OPTIONAL_H
00019
00020 #include "apu.h"
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028
00042 #define APR_OPTIONAL_FN_TYPE(name) apr_OFN_##name##_t
00043
00050 #define APR_DECLARE_OPTIONAL_FN(ret,name,args) \
00051 typedef ret (APR_OPTIONAL_FN_TYPE(name)) args
00052
00059 typedef void (apr_opt_fn_t)(void);
00061 APU_DECLARE_NONSTD(void) apr_dynamic_fn_register(const char *szName,
00062 apr_opt_fn_t *pfn);
00063
00070 #define APR_REGISTER_OPTIONAL_FN(name) do { \
00071 APR_OPTIONAL_FN_TYPE(name) *apu__opt = name; \
00072 apr_dynamic_fn_register(#name,(apr_opt_fn_t *)apu__opt); \
00073 } while (0)
00074
00078 APU_DECLARE(apr_opt_fn_t *) apr_dynamic_fn_retrieve(const char *szName);
00079
00084 #define APR_RETRIEVE_OPTIONAL_FN(name) \
00085 (APR_OPTIONAL_FN_TYPE(name) *)apr_dynamic_fn_retrieve(#name)
00086
00088 #ifdef __cplusplus
00089 }
00090 #endif
00091
00092 #endif