mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-14 15:52:47 -05:00
add winfsp-tests and ext/tlib
This commit is contained in:
30
ext/tlib/injection.h
Normal file
30
ext/tlib/injection.h
Normal file
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* @file tlib/injection.h
|
||||
*
|
||||
* @copyright 2014-2015 Bill Zissimopoulos
|
||||
*/
|
||||
|
||||
/* NOTE: This header may usefully be included multiple times.
|
||||
* The TLIB_INJECT() macro will be redefined based on whether
|
||||
* TLIB_INJECTIONS_ENABLED is defined.
|
||||
*/
|
||||
|
||||
#undef TLIB_INJECT
|
||||
#if defined(TLIB_INJECTIONS_ENABLED)
|
||||
#define TLIB_INJECT(name, stmt) \
|
||||
do\
|
||||
{\
|
||||
static void *injection = 0;\
|
||||
if (0 == injection)\
|
||||
injection = tlib_injection(name);\
|
||||
if (tlib_injection_trace(injection))\
|
||||
stmt;\
|
||||
} while (0)
|
||||
#else
|
||||
#define TLIB_INJECT(name, stmt) do {} while (0)
|
||||
#endif
|
||||
|
||||
void *tlib_injection(const char *name);
|
||||
int tlib_injection_trace(void *injection);
|
||||
void tlib_injection_enable(const char *name, const char *sym, unsigned trigger);
|
||||
void tlib_injection_disable(const char *name, const char *sym);
|
Reference in New Issue
Block a user