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