1
1
// note for asar devs: autogenerated by update_c_bind.py, don't edit this
2
2
// directly! either edit asardll.h.in or interface-lib.cpp.
3
3
#ifndef ASAR_DLL_H_INCLUDED
4
- # define ASAR_DLL_H_INCLUDED
4
+ #define ASAR_DLL_H_INCLUDED
5
5
6
6
#define expectedapiversion 400
7
7
8
8
#include <stdbool.h>
9
- #include <stddef.h> // for size_t
9
+ #include <stddef.h> // for size_t
10
10
11
11
// These structures are returned from various functions
12
12
struct stackentry {
13
- const char * fullpath;
14
- const char * prettypath;
15
- int lineno;
16
- const char * details;
13
+ const char* fullpath;
14
+ const char* prettypath;
15
+ int lineno;
16
+ const char* details;
17
17
};
18
18
19
19
struct errordata {
20
- const char * fullerrdata;
21
- const char * rawerrdata;
22
- const char * block;
23
- const char * filename;
24
- int line;
25
- const struct stackentry * callstack;
26
- int callstacksize;
27
- const char * errname;
20
+ const char* fullerrdata;
21
+ const char* rawerrdata;
22
+ const char* block;
23
+ const char* filename;
24
+ int line;
25
+ const struct stackentry* callstack;
26
+ int callstacksize;
27
+ const char* errname;
28
28
};
29
29
30
30
struct labeldata {
31
- const char * name;
32
- int location;
31
+ const char* name;
32
+ int location;
33
33
};
34
34
35
35
struct definedata {
36
- const char * name;
37
- const char * contents;
36
+ const char* name;
37
+ const char* contents;
38
38
};
39
39
40
40
struct warnsetting {
41
- const char * warnid;
42
- bool enabled;
41
+ const char* warnid;
42
+ bool enabled;
43
43
};
44
44
45
45
struct memoryfile {
46
- const char* path;
47
- const void* buffer;
48
- size_t length;
46
+ const char* path;
47
+ const void* buffer;
48
+ size_t length;
49
49
};
50
50
51
51
enum mappertype {
52
- invalid_mapper,
53
- lorom,
54
- hirom,
55
- sa1rom,
56
- bigsa1rom,
57
- sfxrom,
58
- exlorom,
59
- exhirom,
60
- norom
52
+ invalid_mapper,
53
+ lorom,
54
+ hirom,
55
+ sa1rom,
56
+ bigsa1rom,
57
+ sfxrom,
58
+ exlorom,
59
+ exhirom,
60
+ norom
61
61
};
62
62
63
63
struct writtenblockdata {
64
- int pcoffset;
65
- int snesoffset;
66
- int numbytes;
64
+ int pcoffset;
65
+ int snesoffset;
66
+ int numbytes;
67
67
};
68
68
69
69
struct patchparams {
70
- // The size of this struct. Set to (int)sizeof(patchparams).
71
- int structsize;
72
-
73
- // Same parameters as asar_patch()
74
- const char * patchloc;
75
- char * romdata;
76
- int buflen;
77
- int * romlen;
78
-
79
- // Include paths to use when searching files.
80
- const char** includepaths;
81
- int numincludepaths;
82
-
83
- // A list of additional defines to make available to the patch.
84
- const struct definedata* additional_defines;
85
- int additional_define_count;
86
-
87
- // Path to a text file to parse standard include search paths from.
88
- // Set to NULL to not use any standard includes search paths.
89
- const char* stdincludesfile;
90
-
91
- // Path to a text file to parse standard defines from.
92
- // Set to NULL to not use any standard defines.
93
- const char* stddefinesfile;
94
-
95
- // A list of warnings to enable or disable.
96
- // Specify warnings in the format "WXXXX" where XXXX = warning ID.
97
- const struct warnsetting * warning_settings;
98
- int warning_setting_count;
99
-
100
- // List of memory files to create on the virtual filesystem.
101
- const struct memoryfile * memory_files;
102
- int memory_file_count;
103
-
104
- // Set override_checksum_gen to true and generate_checksum to true/false
105
- // to force generating/not generating a checksum.
106
- bool override_checksum_gen;
107
- bool generate_checksum;
108
-
109
- // Set this to true for generated error and warning texts to always
110
- // contain their full call stack.
111
- bool full_call_stack;
70
+ // The size of this struct. Set to (int)sizeof(patchparams).
71
+ int structsize;
72
+
73
+ // Same parameters as asar_patch()
74
+ const char* patchloc;
75
+ char * romdata;
76
+ int buflen;
77
+ int * romlen;
78
+
79
+ // Include paths to use when searching files.
80
+ const char** includepaths;
81
+ int numincludepaths;
82
+
83
+ // A list of additional defines to make available to the patch.
84
+ const struct definedata* additional_defines;
85
+ int additional_define_count;
86
+
87
+ // Path to a text file to parse standard include search paths from.
88
+ // Set to NULL to not use any standard includes search paths.
89
+ const char* stdincludesfile;
90
+
91
+ // Path to a text file to parse standard defines from.
92
+ // Set to NULL to not use any standard defines.
93
+ const char* stddefinesfile;
94
+
95
+ // A list of warnings to enable or disable.
96
+ // Specify warnings in the format "WXXXX" where XXXX = warning ID.
97
+ const struct warnsetting* warning_settings;
98
+ int warning_setting_count;
99
+
100
+ // List of memory files to create on the virtual filesystem.
101
+ const struct memoryfile* memory_files;
102
+ int memory_file_count;
103
+
104
+ // Set override_checksum_gen to true and generate_checksum to true/false
105
+ // to force generating/not generating a checksum.
106
+ bool override_checksum_gen;
107
+ bool generate_checksum;
108
+
109
+ // Set this to true for generated error and warning texts to always
110
+ // contain their full call stack.
111
+ bool full_call_stack;
112
112
};
113
113
114
114
#ifdef __cplusplus
115
115
extern "C" {
116
116
#endif
117
117
118
- //Initializes Asar. Call this before doing anything.
119
- //If it returns false, something went wrong, and you may not use any other Asar functions. This is
120
- //either due to not finding the library, or not finding all expected functions in the library.
118
+ // Initializes Asar. Call this before doing anything.
119
+ // If it returns false, something went wrong, and you may not use any other Asar
120
+ // functions. This is either due to not finding the library, or not finding all expected
121
+ // functions in the library.
121
122
bool asar_init(void);
122
123
123
- // Same as above, but instead of automatically looking for and trying to load asar.dll, takes
124
- // a path to the Asar DLL and tries to load it.
125
- // The path is expected to be UTF-8-encoded, even on Windows.
126
- bool asar_init_with_dll_path(const char * dllpath);
124
+ // Same as above, but instead of automatically looking for and trying to load asar.dll,
125
+ // takes a path to the Asar DLL and tries to load it. The path is expected to be
126
+ // UTF-8-encoded, even on Windows.
127
+ bool asar_init_with_dll_path(const char* dllpath);
127
128
128
- //Frees all of Asar's structures and unloads the module. Only asar_init may be called after calling
129
+ // Frees all of Asar's structures and unloads the module. Only asar_init may be called
130
+ // after calling
129
131
// this; anything else will lead to segfaults.
130
132
void asar_close(void);
131
133
@@ -159,7 +161,7 @@ extern bool (*asar_reset)(void);
159
161
* be left unchanged.
160
162
* See the documentation of struct patchparams for more information.
161
163
*/
162
- extern bool (*asar_patch)(const struct patchparams * params);
164
+ extern bool (*asar_patch)(const struct patchparams* params);
163
165
164
166
/* Returns the maximum possible size of the output ROM from asar_patch().
165
167
* Giving this size to buflen guarantees you will not get any buffer too small
@@ -173,59 +175,59 @@ extern int (*asar_maxromsize)(void);
173
175
* called again, or until asar_patch, asar_reset or asar_close is called,
174
176
* whichever comes first. Copy the contents if you need it for a longer time.
175
177
*/
176
- extern const struct errordata * (*asar_geterrors)(int * count);
178
+ extern const struct errordata* (*asar_geterrors)(int* count);
177
179
178
180
/* Get a list of all warnings.
179
181
*/
180
- extern const struct errordata * (*asar_getwarnings)(int * count);
182
+ extern const struct errordata* (*asar_getwarnings)(int* count);
181
183
182
184
/* Get a list of all printed data.
183
185
*/
184
- extern const char * const * (*asar_getprints)(int * count);
186
+ extern const char* const* (*asar_getprints)(int* count);
185
187
186
188
/* Get a list of all labels.
187
189
*/
188
- extern const struct labeldata * (*asar_getalllabels)(int * count);
190
+ extern const struct labeldata* (*asar_getalllabels)(int* count);
189
191
190
192
/* Get the ROM location of one label. -1 means "not found".
191
193
*/
192
- extern int (*asar_getlabelval)(const char * name);
194
+ extern int (*asar_getlabelval)(const char* name);
193
195
194
196
/* Get the value of a define.
195
197
*/
196
- extern const char * (*asar_getdefine)(const char * name);
198
+ extern const char* (*asar_getdefine)(const char* name);
197
199
198
200
/* Parses all defines in the parameter. Note that it may emit errors.
199
201
*/
200
- extern const char * (*asar_resolvedefines)(const char * data);
202
+ extern const char* (*asar_resolvedefines)(const char* data);
201
203
202
204
/* Gets the values and names of all defines.
203
205
*/
204
- extern const struct definedata * (*asar_getalldefines)(int * count);
206
+ extern const struct definedata* (*asar_getalldefines)(int* count);
205
207
206
208
/* Parses a string containing math. It automatically assumes global scope (no
207
209
* namespaces), and has access to all functions and labels from the last call
208
210
* to asar_patch. Remember to check error to see if it's successful (NULL) or
209
211
* if it failed (non-NULL, contains a descriptive string). It does not affect
210
212
* asar_geterrors.
211
213
*/
212
- extern double (*asar_math)(const char * math_, const char ** error);
214
+ extern double (*asar_math)(const char* math_, const char** error);
213
215
214
216
/* Get a list of all the blocks written to the ROM by calls such as
215
217
* asar_patch().
216
218
*/
217
- extern const struct writtenblockdata * (*asar_getwrittenblocks)(int * count);
219
+ extern const struct writtenblockdata* (*asar_getwrittenblocks)(int* count);
218
220
219
221
/* Get the mapper currently used by Asar.
220
222
*/
221
223
extern enum mappertype (*asar_getmapper)(void);
222
224
223
225
/* Generates the contents of a symbols file for in a specific format.
224
226
*/
225
- extern const char * (*asar_getsymbolsfile)(const char* type);
227
+ extern const char* (*asar_getsymbolsfile)(const char* type);
226
228
227
229
#ifdef __cplusplus
228
- }
230
+ }
229
231
#endif
230
232
231
- #endif // ASAR_DLL_H_INCLUDED
233
+ #endif // ASAR_DLL_H_INCLUDED
0 commit comments