~ubuntu-branches/debian/squeeze/ffcall/squeeze

« back to all changes in this revision

Viewing changes to callback/callback.h.in

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger
  • Date: 2010-06-26 15:29:30 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100626152930-c09y01gk3szcnykn
Tags: 1.10+cvs20100619-2
Ship to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _CALLBACK_H
 
2
#define _CALLBACK_H
 
3
 
 
4
/*
 
5
 * Copyright 1997-1999, 2005 Bruno Haible, <bruno@clisp.org>
 
6
 *
 
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,
 
10
 * on this software.
 
11
 */
 
12
 
 
13
#if !defined(LIBFFCALL_VERSION)
 
14
# define LIBFFCALL_VERSION @LIBFFCALL_VERSION@
 
15
#endif
 
16
 
 
17
#include "vacall_r.h"
 
18
#include "trampoline_r.h"
 
19
 
 
20
typedef void (*__VA_function) (void*, va_alist);
 
21
 
 
22
#if 0
 
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*);
 
28
#else
 
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 \
 
36
  )
 
37
#define callback_address(function)  \
 
38
  (__VA_function)trampoline_r_data0(function)
 
39
#define callback_data(function)  \
 
40
  trampoline_r_data1(function)
 
41
#endif
 
42
 
 
43
#endif /* _CALLBACK_H */