annotate test/callback_suite/globals.h @ 505:049e04af13c8

test/callback_suite: - greatly simplified - refactored to look more like other test cases (especially call_suite{,_aggrs} for consistency/maintainablity/future code sharing
author Tassilo Philipp
date Sat, 09 Apr 2022 13:53:58 +0200
parents test/callback_suite/env.h@d8f0e6cecdab
children f3d44195dbdf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
1 /*
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
2
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
3 Package: dyncall
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
4 Library: test
505
049e04af13c8 test/callback_suite:
Tassilo Philipp
parents: 487
diff changeset
5 File: test/callback_suite/globals.h
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
6 Description:
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
7 License:
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
8
505
049e04af13c8 test/callback_suite:
Tassilo Philipp
parents: 487
diff changeset
9 Copyright (c) 2011-2022 Daniel Adler <dadler@uni-goettingen.de>,
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
10 Tassilo Philipp <tphilipp@potion-studios.com>
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
11
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
12 Permission to use, copy, modify, and distribute this software for any
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
13 purpose with or without fee is hereby granted, provided that the above
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
14 copyright notice and this permission notice appear in all copies.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
15
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
16 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
17 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
18 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
19 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
20 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
21 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
22 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
23
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
24 */
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
25
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
26 #include "dyncall_value.h"
487
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
27
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
28
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
29 #define DEF_NON_VOID_TYPES \
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
30 X(B,DCbool) \
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
31 X(c,DCchar) X(C,DCuchar) X(s,DCshort) X(S,DCushort) \
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
32 X(i,DCint) X(I,DCuint) X(j,DClong) X(J,DCulong) \
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
33 X(l,DClonglong) X(L,DCulonglong) \
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
34 X(f,DCfloat) X(d,DCdouble) \
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
35 X(p,DCpointer) X(Z,DCpointer)
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
36
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
37 #define DEF_TYPES \
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
38 X(v,DCvoid) \
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
39 DEF_NON_VOID_TYPES
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
40
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
41
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
42 typedef struct DCValueSet_
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
43 {
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
44 #define X(CH,T) T CH;
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
45 DEF_NON_VOID_TYPES
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
46 #undef X
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
47 } DCValueSet;
505
049e04af13c8 test/callback_suite:
Tassilo Philipp
parents: 487
diff changeset
48 extern DCValueSet* ValueMatrix;
049e04af13c8 test/callback_suite:
Tassilo Philipp
parents: 487
diff changeset
49
049e04af13c8 test/callback_suite:
Tassilo Philipp
parents: 487
diff changeset
50 /* arguments filled-in by callback handlers, and return value */
049e04af13c8 test/callback_suite:
Tassilo Philipp
parents: 487
diff changeset
51 extern DCValue* Args;
049e04af13c8 test/callback_suite:
Tassilo Philipp
parents: 487
diff changeset
52 extern DCValue Result;
487
d8f0e6cecdab - simplified test/callback_suite
Tassilo Philipp
parents: 281
diff changeset
53
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
54
505
049e04af13c8 test/callback_suite:
Tassilo Philipp
parents: 487
diff changeset
55 typedef void (*funptr)(void*);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
56
505
049e04af13c8 test/callback_suite:
Tassilo Philipp
parents: 487
diff changeset
57 extern funptr G_funtab[];
049e04af13c8 test/callback_suite:
Tassilo Philipp
parents: 487
diff changeset
58 extern const char * G_sigtab[];
049e04af13c8 test/callback_suite:
Tassilo Philipp
parents: 487
diff changeset
59 extern int G_ncases;
049e04af13c8 test/callback_suite:
Tassilo Philipp
parents: 487
diff changeset
60 extern int G_maxargs;
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
61
505
049e04af13c8 test/callback_suite:
Tassilo Philipp
parents: 487
diff changeset
62 void init_test_data();
049e04af13c8 test/callback_suite:
Tassilo Philipp
parents: 487
diff changeset
63 void deinit_test_data();
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
64
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
65 /* function of type and position */
505
049e04af13c8 test/callback_suite:
Tassilo Philipp
parents: 487
diff changeset
66 void get_reference_arg(DCValue* output, char type, int argpos);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
67 /* function of type (position = -1) */
505
049e04af13c8 test/callback_suite:
Tassilo Philipp
parents: 487
diff changeset
68 void get_reference_result(DCValue* output, char type);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
69
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
70