20 #define VT_LIBWRAP_MAX_SHLIBS 10
23 #define VT_LIBWRAP_ATTR_DEFAULT \
24 { 0, { NULL }, NULL, 0, NULL }
27 #define VT_LIBWRAP_ATTR_INITIALIZER(_init_func) \
28 { 0, { NULL }, NULL, 0, _init_func }
31 #define VT_LIBWRAP_NULL NULL
32 #define VT_LIBWRAP_NOID -1
48 #define VT_LIBWRAP_FUNC_INIT(_lw, _lwattr, _func, _rettype, _argtypes, \
50 static _rettype (*VT_LIBWRAP_FUNC_PTR)_argtypes = VT_LIBWRAP_NULL; \
51 static int VT_LIBWRAP_FUNC_ID = VT_LIBWRAP_NOID; \
52 if( _lw == VT_LIBWRAP_NULL ) { \
53 VTLibwrap_create(&_lw, &_lwattr); \
55 if( VT_LIBWRAP_FUNC_PTR == VT_LIBWRAP_NULL || \
56 VT_LIBWRAP_FUNC_ID == VT_LIBWRAP_NOID ) { \
57 VTLibwrap_func_init(_lw, _func, _file, _line, \
58 (void**)(&VT_LIBWRAP_FUNC_PTR), &VT_LIBWRAP_FUNC_ID); \
65 #define VT_LIBWRAP_FUNC_PTR _vtlw_funcptr
67 #define VT_LIBWRAP_FUNC_ID _vtlw_funcid
73 #define VT_LIBWRAP_FUNC_START(_lw) VTLibwrap_func_start(_lw, VT_LIBWRAP_FUNC_ID)
74 #define VT_LIBWRAP_FUNC_END(_lw) VTLibwrap_func_end(_lw, VT_LIBWRAP_FUNC_ID)
80 #define VT_LIBWRAP_FUNC_CALL(_lw, _args) (*VT_LIBWRAP_FUNC_PTR)_args
106 char* shlibs[VT_LIBWRAP_MAX_SHLIBS];
120 VTLibwrapAttrInitFunc init_func;
126 void vt_libwrap_init(
void);
128 void vt_libwrap_finalize(
void);
131 void* vt_libwrap_get_libc_handle(
void);
133 void vt_libwrap_set_libc_errno(
const int value);
135 int vt_libwrap_get_libc_errno(
void);
150 void VTLibwrap_delete_all(
void);
160 void VTLibwrap_func_init(
const VTLibwrap* lw,
const char* func,
161 const char* file,
int line,
162 void** funcptr,
int* funcid);
168 void VTLibwrap_func_start(
const VTLibwrap* lw,
const int funcid);
174 void VTLibwrap_func_end(
const VTLibwrap* lw,
const int funcid);
Definition: vt_libwrap.c:43
Definition: vt_libwrap.h:96