diff options
Diffstat (limited to 'dynasm/dasm_proto.h')
-rw-r--r-- | dynasm/dasm_proto.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/dynasm/dasm_proto.h b/dynasm/dasm_proto.h new file mode 100644 index 00000000..94d9a9e2 --- /dev/null +++ b/dynasm/dasm_proto.h | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | ** DynASM encoding engine prototypes. | ||
3 | ** Copyright (C) 2005-2009 Mike Pall. All rights reserved. | ||
4 | ** Released under the MIT/X license. See dynasm.lua for full copyright notice. | ||
5 | */ | ||
6 | |||
7 | #ifndef _DASM_PROTO_H | ||
8 | #define _DASM_PROTO_H | ||
9 | |||
10 | #include <stddef.h> | ||
11 | #include <stdarg.h> | ||
12 | |||
13 | #define DASM_IDENT "DynASM 1.2.1" | ||
14 | #define DASM_VERSION 10201 /* 1.2.1 */ | ||
15 | |||
16 | #ifndef Dst_DECL | ||
17 | #define Dst_DECL dasm_State *Dst | ||
18 | #endif | ||
19 | |||
20 | #ifndef Dst_GET | ||
21 | #define Dst_GET (Dst) | ||
22 | #endif | ||
23 | |||
24 | #ifndef DASM_FDEF | ||
25 | #define DASM_FDEF extern | ||
26 | #endif | ||
27 | |||
28 | |||
29 | /* Internal DynASM encoder state. */ | ||
30 | typedef struct dasm_State dasm_State; | ||
31 | |||
32 | /* Action list type. */ | ||
33 | typedef const unsigned char *dasm_ActList; | ||
34 | |||
35 | |||
36 | /* Initialize and free DynASM state. */ | ||
37 | DASM_FDEF void dasm_init(Dst_DECL, int maxsection); | ||
38 | DASM_FDEF void dasm_free(Dst_DECL); | ||
39 | |||
40 | /* Setup global array. Must be called before dasm_setup(). */ | ||
41 | DASM_FDEF void dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl); | ||
42 | |||
43 | /* Grow PC label array. Can be called after dasm_setup(), too. */ | ||
44 | DASM_FDEF void dasm_growpc(Dst_DECL, unsigned int maxpc); | ||
45 | |||
46 | /* Setup encoder. */ | ||
47 | DASM_FDEF void dasm_setup(Dst_DECL, dasm_ActList actionlist); | ||
48 | |||
49 | /* Feed encoder with actions. Calls are generated by pre-processor. */ | ||
50 | DASM_FDEF void dasm_put(Dst_DECL, int start, ...); | ||
51 | |||
52 | /* Link sections and return the resulting size. */ | ||
53 | DASM_FDEF int dasm_link(Dst_DECL, size_t *szp); | ||
54 | |||
55 | /* Encode sections into buffer. */ | ||
56 | DASM_FDEF int dasm_encode(Dst_DECL, void *buffer); | ||
57 | |||
58 | /* Get PC label offset. */ | ||
59 | DASM_FDEF int dasm_getpclabel(Dst_DECL, unsigned int pc); | ||
60 | |||
61 | #ifdef DASM_CHECKS | ||
62 | /* Optional sanity checker to call between isolated encoding steps. */ | ||
63 | DASM_FDEF int dasm_checkstep(Dst_DECL, int secmatch); | ||
64 | #else | ||
65 | #define dasm_checkstep(a, b) 0 | ||
66 | #endif | ||
67 | |||
68 | |||
69 | #endif /* _DASM_PROTO_H */ | ||