comparison dmres.h @ 730:3d813c81f33c

More work on resources API.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 21 Apr 2013 19:29:00 +0300
parents 867fc7f205a8
children 0e164aaa7409
comparison
equal deleted inserted replaced
729:e09b7fbedf8c 730:3d813c81f33c
35 }; 35 };
36 36
37 enum 37 enum
38 { 38 {
39 DMF_PERSIST = 0x0001, // Persist loaded RAW resource 39 DMF_PERSIST = 0x0001, // Persist loaded RAW resource
40 DMF_TEMPORARY = 0x0002,
40 DMF_LOADED_RAW = 0x1000, // Raw data has been loaded 41 DMF_LOADED_RAW = 0x1000, // Raw data has been loaded
41 DMF_LOADED_RES = 0x2000, // Resource has been loaded 42 DMF_LOADED_RES = 0x2000, // Resource has been loaded
42 }; 43 };
43 44
44 45
139 int dmResourceRef(DMResource *); 140 int dmResourceRef(DMResource *);
140 int dmResourceUnref(DMResource *); 141 int dmResourceUnref(DMResource *);
141 142
142 143
143 // Opening and closing resources 144 // Opening and closing resources
144 DMResource * dmf_open(DMResourceLib *lib, const char *); 145 int dmf_open(DMResourceLib *lib, const char *, DMResource **handle);
145 DMResource * dmf_create_memio(DMResourceLib *lib, const char *, Uint8 *buf, size_t len); 146 int dmf_create_memio(DMResourceLib *lib, const char *, Uint8 *buf, size_t len, DMResource **phandle);
146 #ifdef DM_USE_STDIO 147 #ifdef DM_USE_STDIO
147 DMResource * dmf_create_stdio(const char *filename, const char *mode); 148 int dmf_create_stdio(const char *filename, const char *mode, DMResource **phandle);
148 DMResource * dmf_create_stdio_stream(FILE *); 149 int dmf_create_stdio_stream(FILE *, DMResource **phandle);
149 #endif 150 #endif
150 void dmf_close(DMResource *); 151 void dmf_close(DMResource *);
151 152
152 153
153 // Basic resource access functions 154 // Basic resource access functions