File: MIGRATION

package info (click to toggle)
ffcall 2.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,024 kB
  • sloc: asm: 100,607; ansic: 50,932; sh: 5,630; makefile: 1,588; cpp: 2
file content (79 lines) | stat: -rw-r--r-- 2,904 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Migration Guide
===============

When switching from vacall+trampoline to callback, you need to make the
following changes to your code:

       vacall+trampoline                       callback
       -----------------                       --------

                              -- Include files --

#include "vacall/vacall.h"              #include "callback/callback.h"
#include "trampoline/trampoline.h"

                          -- Variable declarations --

static void* trampvar;

                           -- Callback declaration --
                                
static void                             static void
mycallback (va_alist args)              mycallback (void* data, va_alist args)
{                                       {
  void* data = trampvar;                  ...
  ...

                              -- Initialization --

vacall_function = &mycallback;

                          -- Allocating a callback --

void* trampoline =                      void* trampoline =
  alloc_trampoline(                       alloc_callback(&mycallback,data);
    (__TR_function)&vacall,
    &trampvar,
    data);

                          -- Testing for a callback --

if                                      if
(is_trampoline(address)                 (is_callback(address)
 && (trampoline_address(address)         && (callback_address(address)
     == (__TR_function)&vacall)              == &mycallback)
 && (trampoline_variable(address)       )
     == &trampvar)
)

void* data = trampoline_data(address);  void* data = callback_data(address);

                         -- Deallocating a callback --

free_trampoline(address);               free_callback(address);

                                -- Libraries --

libvacall.a libtrampoline.a             libcallback.a


================================================================================
Copyright (C) 1995-1998 Bruno Haible

This manual is free documentation.  It is dually licensed under the
GNU FDL and the GNU GPL.  This means that you can redistribute this
manual under either of these two licenses, at your choice.

This manual is covered by the GNU FDL.  Permission is granted to copy,
distribute and/or modify this document under the terms of the
GNU Free Documentation License (FDL), either version 1.2 of the
License, or (at your option) any later version published by the
Free Software Foundation (FSF); with no Invariant Sections, with no
Front-Cover Text, and with no Back-Cover Texts.
A copy of the license is at <https://www.gnu.org/licenses/old-licenses/fdl-1.2>.

This manual is covered by the GNU GPL.  You can redistribute it and/or
modify it under the terms of the GNU General Public License (GPL), either
version 2 of the License, or (at your option) any later version published
by the Free Software Foundation (FSF).
A copy of the license is at <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.