Mercurial > hg > dmlib
annotate src/dmfile.h @ 2202:455a3849b8ac
Comments and cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 14 Jun 2019 01:56:47 +0300 |
parents | 6b1f41ca300a |
children | 9807ae37ad69 |
rev | line source |
---|---|
0 | 1 /* |
2 * DMLib | |
414
c452a459e552
Clear up the file descriptions.
Matti Hamalainen <ccr@tnsp.org>
parents:
405
diff
changeset
|
3 * -- Standard I/O (stdio) file write/read endianess helpers |
0 | 4 * Programmed and designed by Matti 'ccr' Hamalainen |
5 * (C) Copyright 2011 Tecnic Software productions (TNSP) | |
6 */ | |
7 #ifndef DMFILE_H | |
8 #define DMFILE_H | |
9 | |
10 #include "dmlib.h" | |
11 | |
434 | 12 #ifdef __cplusplus |
13 extern "C" { | |
14 #endif | |
15 | |
0 | 16 |
17 /* Plain file endianess functions | |
18 */ | |
19 #define DM_DEFINE_FFUNC(xname, xtype, z) \ | |
20 BOOL dm_fread_ ## xname (FILE *f, xtype *v); \ | |
405
d0257d0004f6
Implement dm_{read,write}_byte() and constify.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
21 BOOL dm_fwrite_ ## xname (FILE *f, const xtype v); |
0 | 22 |
23 #include "dmfiletmpl.h" | |
24 | |
25 #undef DM_DEFINE_FFUNC | |
26 | |
405
d0257d0004f6
Implement dm_{read,write}_byte() and constify.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
27 BOOL dm_fread_str(FILE *f, void *, const size_t); |
d0257d0004f6
Implement dm_{read,write}_byte() and constify.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
28 BOOL dm_fwrite_str(FILE *f, const void *, const size_t); |
d0257d0004f6
Implement dm_{read,write}_byte() and constify.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
29 |
d0257d0004f6
Implement dm_{read,write}_byte() and constify.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
30 BOOL dm_fread_byte(FILE *f, Uint8 *); |
d0257d0004f6
Implement dm_{read,write}_byte() and constify.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
31 BOOL dm_fwrite_byte(FILE *f, const Uint8); |
0 | 32 |
33 | |
1474
6b1f41ca300a
Add dmWriteDataFile() helper function.
Matti Hamalainen <ccr@tnsp.org>
parents:
1473
diff
changeset
|
34 int dmWriteDataFile(FILE *outFile, const char *filename, const Uint8 *buf, const size_t bufSize); |
1473
c543f5ae92d5
Cleanup dmReadDataFile() helper function.
Matti Hamalainen <ccr@tnsp.org>
parents:
812
diff
changeset
|
35 int dmReadDataFile(FILE *inFile, const char *filename, Uint8 **pbuf, size_t *pbufSize); |
567
b2b461829c61
Move utility function dmReadDataFile() to dmfile module instead.
Matti Hamalainen <ccr@tnsp.org>
parents:
434
diff
changeset
|
36 |
b2b461829c61
Move utility function dmReadDataFile() to dmfile module instead.
Matti Hamalainen <ccr@tnsp.org>
parents:
434
diff
changeset
|
37 |
0 | 38 #ifdef __cplusplus |
39 } | |
40 #endif | |
434 | 41 |
0 | 42 #endif // DMFILE_H |