5
* Copyright 1997-1999, 2005 Bruno Haible, <bruno@clisp.org>
7
* This is free software distributed under the GNU General Public Licence
8
* described in the file COPYING. Contact the author if you don't have this
9
* or can't live with it. There is ABSOLUTELY NO WARRANTY, explicit or implied,
13
#if !defined(LIBFFCALL_VERSION)
14
# define LIBFFCALL_VERSION @LIBFFCALL_VERSION@
18
#include "trampoline_r.h"
20
typedef void (*__VA_function) (void*, va_alist);
23
extern __TR_function alloc_callback (__VA_function, void*);
24
extern void free_callback (__TR_function);
25
extern int is_callback (void*);
26
extern __VA_function callback_address (void*);
27
extern void* callback_data (void*);
29
#define alloc_callback(address,data) \
30
alloc_trampoline_r((__TR_function)&__vacall_r,(void*)(__VA_function)(address),(void*)(data))
31
#define free_callback(function) \
32
free_trampoline_r(function)
33
#define is_callback(function) \
34
(is_trampoline_r(function) \
35
&& trampoline_r_address(function) == (__TR_function)&__vacall_r \
37
#define callback_address(function) \
38
(__VA_function)trampoline_r_data0(function)
39
#define callback_data(function) \
40
trampoline_r_data1(function)
43
#endif /* _CALLBACK_H */