Mercurial > hg > th-libs
annotate th_ioctx.h @ 432:1b3472ba7b23
Bump copyrights.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 01 Jan 2017 01:59:49 +0200 |
parents | faeeac291a6c |
children | 9148bc3fa838 |
rev | line source |
---|---|
67
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1 /* |
202
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
2 * Simple I/O abstraction and context handling layer |
67
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3 * Programmed and designed by Matti 'ccr' Hamalainen |
432 | 4 * (C) Copyright 2012-2017 Tecnic Software productions (TNSP) |
67
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
5 * |
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
6 * Please read file 'COPYING' for information on license and distribution. |
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
7 */ |
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
8 #ifndef TH_IOCTX_H |
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
9 #define TH_IOCTX_H |
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
10 |
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
11 #include "th_util.h" |
202
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
12 #include <time.h> |
67
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
13 |
92 | 14 |
67
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
15 #ifdef __cplusplus |
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
16 extern "C" { |
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
17 #endif |
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
18 |
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
19 |
202
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
20 // Typedefs and structures |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
21 // |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
22 struct th_ioctx; |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
23 struct th_ioctx_ops; |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
24 |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
25 |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
26 typedef struct th_ioctx |
67
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
27 { |
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
28 char *filename; |
202
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
29 char *mode; |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
30 void *data; |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
31 time_t atime; |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
32 int64_t size; |
219
faeeac291a6c
Oops, using "errno" as io_ctx struct member causes problems on some
Matti Hamalainen <ccr@tnsp.org>
parents:
218
diff
changeset
|
33 int status; |
67
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
34 size_t line; |
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
35 |
202
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
36 void (*error)(struct th_ioctx *, const int err, const char *msg); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
37 void (*msg)(struct th_ioctx *, const int level, const char *msg); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
38 |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
39 const struct th_ioctx_ops *fops; |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
40 } th_ioctx; |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
41 |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
42 |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
43 typedef struct th_ioctx_ops |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
44 { |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
45 char *name; |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
46 |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
47 int (*fopen)(th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
48 void (*fclose)(th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
49 |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
50 int (*freset)(th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
51 int (*ferror)(th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
52 int (*fseek)(th_ioctx *ctx, const off_t, const int whence); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
53 off_t (*fsize)(th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
54 off_t (*ftell)(th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
55 BOOL (*feof)(th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
56 int (*fgetc)(th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
57 int (*fputc)(int, th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
58 size_t (*fread)(void *ptr, const size_t, const size_t, th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
59 size_t (*fwrite)(const void *ptr, const size_t, const size_t, th_ioctx *ctx); |
208
3635415a2d03
More work on th_ioctx stuff and wrappers.
Matti Hamalainen <ccr@tnsp.org>
parents:
204
diff
changeset
|
60 |
3635415a2d03
More work on th_ioctx stuff and wrappers.
Matti Hamalainen <ccr@tnsp.org>
parents:
204
diff
changeset
|
61 char * (*fgets)(char *str, int size, th_ioctx *ctx); |
3635415a2d03
More work on th_ioctx stuff and wrappers.
Matti Hamalainen <ccr@tnsp.org>
parents:
204
diff
changeset
|
62 int (*fputs)(const char *str, th_ioctx *ctx); |
3635415a2d03
More work on th_ioctx stuff and wrappers.
Matti Hamalainen <ccr@tnsp.org>
parents:
204
diff
changeset
|
63 int (*vfprintf)(th_ioctx *ctx, const char *fmt, va_list ap); |
202
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
64 |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
65 } th_ioctx_ops; |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
66 |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
67 |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
68 // |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
69 // Some basic iops |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
70 // |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
71 extern const th_ioctx_ops th_stdio_io_ops; |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
72 |
67
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
73 |
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
74 |
202
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
75 // |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
76 // I/O context management functions |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
77 // |
209
462b837ea492
Change io context API. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
208
diff
changeset
|
78 th_ioctx * th_io_new(const th_ioctx_ops *fops, const char *filename); |
462b837ea492
Change io context API. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
208
diff
changeset
|
79 int th_io_open(th_ioctx *ctx, const char *mode); |
204
55f429dff750
Add th_io_fopen() helper function.
Matti Hamalainen <ccr@tnsp.org>
parents:
202
diff
changeset
|
80 th_ioctx * th_io_fopen(const th_ioctx_ops *fops, const char *filename, const char *mode); |
202
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
81 void th_io_close(th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
82 void th_io_free(th_ioctx *ctx); |
72
43df05a632cb
Break I/O context API, add function pointers to init/open/new functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
67
diff
changeset
|
83 |
202
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
84 BOOL th_io_set_handlers(th_ioctx *ctx, |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
85 void (*error)(th_ioctx *, const int, const char *msg), |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
86 void (*msg)(th_ioctx *, const int, const char *msg)); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
87 |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
88 void th_io_error_v(th_ioctx *ctx, const int err, const char *fmt, va_list ap); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
89 void th_io_msg_v(th_ioctx *ctx, const int level, const char *fmt, va_list ap); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
90 void th_io_error(th_ioctx *ctx, const int err, const char *fmt, ...); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
91 void th_io_msg(th_ioctx *ctx, const int level, const char *fmt, ...); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
92 |
67
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
93 |
202
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
94 // |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
95 // Basic I/O operations |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
96 // |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
97 int thfreset(th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
98 int thferror(th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
99 int thfseek(th_ioctx *ctx, const off_t, const int whence); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
100 off_t thfsize(th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
101 off_t thftell(th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
102 BOOL thfeof(th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
103 int thfgetc(th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
104 int thfputc(int ch, th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
105 size_t thfread(void *ptr, const size_t, const size_t, th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
106 size_t thfwrite(const void *, const size_t, const size_t, th_ioctx *ctx); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
107 char * thfgets(char *ptr, int size, th_ioctx *ctx); |
208
3635415a2d03
More work on th_ioctx stuff and wrappers.
Matti Hamalainen <ccr@tnsp.org>
parents:
204
diff
changeset
|
108 int thfputs(const char *ptr, th_ioctx *ctx); |
202
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
109 int thvfprintf(th_ioctx *ctx, const char *fmt, va_list ap); |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
110 int thfprintf(th_ioctx *ctx, const char *fmt, ...); |
72
43df05a632cb
Break I/O context API, add function pointers to init/open/new functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
67
diff
changeset
|
111 |
202
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
112 int thfread_str(th_ioctx *ctx, void *ptr, const size_t len); |
218
e20fdeee6bdf
Rename some functions for consistency.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
113 BOOL thfread_u8(th_ioctx *ctx, uint8_t *); |
202
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
114 int thfwrite_str(th_ioctx *ctx, const void *ptr, const size_t len); |
218
e20fdeee6bdf
Rename some functions for consistency.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
115 BOOL thfwrite_u8(th_ioctx *ctx, const uint8_t); |
202
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
116 |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
117 |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
118 // |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
119 // Endian-handling file read/write routines |
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
120 // |
217
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
121 BOOL thfwrite_ne16(th_ioctx *ctx, const uint16_t v); |
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
122 BOOL thfwrite_ne32(th_ioctx *ctx, const uint32_t v); |
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
123 BOOL thfwrite_ne64(th_ioctx *ctx, const uint64_t v); |
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
124 BOOL thfread_ne16(th_ioctx *ctx, uint16_t *v); |
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
125 BOOL thfread_ne32(th_ioctx *ctx, uint32_t *v); |
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
126 BOOL thfread_ne64(th_ioctx *ctx, uint64_t *v); |
202
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
127 |
217
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
128 BOOL thfwrite_le16(th_ioctx *ctx, const uint16_t v); |
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
129 BOOL thfwrite_le32(th_ioctx *ctx, const uint32_t v); |
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
130 BOOL thfwrite_le64(th_ioctx *ctx, const uint64_t v); |
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
131 BOOL thfread_le16(th_ioctx *ctx, uint16_t *v); |
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
132 BOOL thfread_le32(th_ioctx *ctx, uint32_t *v); |
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
133 BOOL thfread_le64(th_ioctx *ctx, uint64_t *v); |
202
b392293047da
Refactor I/O contexts. Breaks API and all that.
Matti Hamalainen <ccr@tnsp.org>
parents:
129
diff
changeset
|
134 |
217
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
135 BOOL thfwrite_be16(th_ioctx *ctx, const uint16_t v); |
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
136 BOOL thfwrite_be32(th_ioctx *ctx, const uint32_t v); |
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
137 BOOL thfwrite_be64(th_ioctx *ctx, const uint64_t v); |
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
138 BOOL thfread_be16(th_ioctx *ctx, uint16_t *v); |
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
139 BOOL thfread_be32(th_ioctx *ctx, uint32_t *v); |
97c1ab4719cf
Don't use macro expansion in the th_ctx.h header file for generating the
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
140 BOOL thfread_be64(th_ioctx *ctx, uint64_t *v); |
67
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
141 |
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
142 |
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
143 #ifdef __cplusplus |
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
144 } |
d94af48cef7b
Added new module, a simple I/O context helper.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
145 #endif |
129 | 146 #endif // TH_IOCTX_H |