comparison src/dmlib.h @ 2585:ef6c826c5b7a

Cosmetics.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 08 Dec 2022 15:56:36 +0200
parents c58cd7797aff
children 9807ae37ad69
comparison
equal deleted inserted replaced
2584:9f26a93d7e70 2585:ef6c826c5b7a
136 #ifdef __cplusplus 136 #ifdef __cplusplus
137 extern "C" { 137 extern "C" {
138 #endif 138 #endif
139 139
140 // Defaults 140 // Defaults
141 #define DM_PROG_AUTHOR "By Matti 'ccr' Hamalainen (C) Copyright 2002-2022 TNSP" 141 #define DM_PROG_AUTHOR "By Matti 'ccr' Hamalainen (C) Copyright 2002-2022 TNSP"
142 #define DM_PROG_LICENSE "This program is distributed under a 3-clause BSD -style license." 142 #define DM_PROG_LICENSE "This program is distributed under a 3-clause BSD -style license."
143 143
144 144
145 /* Error codes 145 /* Error codes
146 */ 146 */
147 enum { 147 enum {
148 // General error codes 148 // General error codes
149 DMERR_OK = 0, 149 DMERR_OK = 0,
150 DMERR_PROGRESS, // Status OK, but operation in progress 150 DMERR_PROGRESS, // Status OK, but operation in progress
151 151
152 DMERR_INTERNAL, 152 DMERR_INTERNAL,
153 153
154 DMERR_FOPEN, 154 DMERR_FOPEN,
155 DMERR_FREAD, 155 DMERR_FREAD,
156 DMERR_FWRITE, 156 DMERR_FWRITE,
157 DMERR_FSEEK, 157 DMERR_FSEEK,
158 DMERR_NOT_FOUND, // Resource/data not found 158 DMERR_NOT_FOUND, // Resource/data not found
159 159
160 DMERR_INVALID_DATA, // Some data was invalid 160 DMERR_INVALID_DATA, // Some data was invalid
161 DMERR_MALLOC, // Memory allocation failure 161 DMERR_MALLOC, // Memory allocation failure
162 DMERR_ALREADY_INIT, // Resource has already been initialized 162 DMERR_ALREADY_INIT, // Resource has already been initialized
163 DMERR_INIT_FAIL, // General initialization failure 163 DMERR_INIT_FAIL, // General initialization failure
164 DMERR_INVALID_ARGS, 164 DMERR_INVALID_ARGS,
165 165
166 DMERR_NULLPTR, // NULL pointer specified in critical argument 166 DMERR_NULLPTR, // NULL pointer specified in critical argument
167 DMERR_NOT_SUPPORTED,// Operation not supported 167 DMERR_NOT_SUPPORTED, // Operation not supported
168 DMERR_OUT_OF_DATA, 168 DMERR_OUT_OF_DATA,
169 DMERR_EXTRA_DATA, 169 DMERR_EXTRA_DATA,
170 DMERR_BOUNDS, 170 DMERR_BOUNDS,
171 171
172 DMERR_DATA_ERROR, // Data decoding/encoding/parsing error 172 DMERR_DATA_ERROR, // Data decoding/encoding/parsing error
173 173
174 DMERR_VERSION, // Unsupported data version 174 DMERR_VERSION, // Unsupported data version
175 175
176 // PACK-file subsystem 176 // PACK-file subsystem
177 DMERR_NOTPACK, 177 DMERR_NOTPACK,
178 DMERR_PACK_VERSION, 178 DMERR_PACK_VERSION,
179 DMERR_INVALID, 179 DMERR_INVALID,
180 DMERR_COMPRESSION, 180 DMERR_COMPRESSION,
181 }; 181 };
182 182
183 183
184 // Directory/path separator stuff 184 // Directory/path separator stuff
185 #define DM_DIR_SEPARATOR '/' 185 #define DM_DIR_SEPARATOR '/'
186 186
187 187
188 // Resource management defines 188 // Resource management defines
189 #define DMRES_NAME_LEN 32 189 #define DMRES_NAME_LEN 32
190 #define DMRES_RES_FILE "res.txt" // Resource data file 190 #define DMRES_RES_FILE "res.txt" // Resource data file
191 191
192 192
193 /* Define a boolean type 193 /* Define a boolean type
194 */ 194 */
195 #if !defined(FALSE) && !defined(TRUE) && !defined(BOOL) 195 #if !defined(FALSE) && !defined(TRUE) && !defined(BOOL)
205 #endif 205 #endif
206 206
207 207
208 /* Math constants 208 /* Math constants
209 */ 209 */
210 #define DM_PI 3.14159265358f 210 #define DM_PI 3.14159265358f
211 #define DM_PI2 6.28318530718f 211 #define DM_PI2 6.28318530718f
212 #define DM_E 2.71828182846f 212 #define DM_E 2.71828182846f
213 213
214 214
215 /* Fixed point math types 215 /* Fixed point math types
216 */ 216 */
217 typedef union 217 typedef union