17 |
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
18 |
*/ |
*/ |
19 |
|
|
20 |
|
#include <config.h> |
21 |
|
|
22 |
#include "resource-manager.h" |
#include "resource-manager.h" |
23 |
|
|
24 |
|
#include <assert.h> |
25 |
#include <stdlib.h> |
#include <stdlib.h> |
26 |
#include <string.h> |
#include <string.h> |
27 |
|
|
36 |
return &RESOURCES[i]; |
return &RESOURCES[i]; |
37 |
} |
} |
38 |
} |
} |
39 |
abort(); |
return NULL; |
40 |
} |
} |
41 |
|
|
42 |
void copy_resource_to_stream(const char * resource, FILE * stream) { |
void copy_resource_to_stream(const char * resource, FILE * stream) { |
43 |
const struct Resource * r = get_resource(resource); |
const struct Resource * r = get_resource(resource); |
44 |
|
assert(r != NULL); |
45 |
if (fwrite(r->data, 1, r->length, stream) != r->length) { |
if (fwrite(r->data, 1, r->length, stream) != r->length) { |
46 |
fatal("cannot write to stream"); |
fatal("cannot write to stream"); |
47 |
} |
} |