Mercurial > spc_convert
comparison demo/demo_util.h @ 0:e38dacceb958
initial import
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Fri, 21 Oct 2011 05:53:11 -0700 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e38dacceb958 |
---|---|
1 /* General-purpose utilities used by demos */ | |
2 | |
3 /* snes_spc 0.9.0 */ | |
4 #ifndef DEMO_UTIL_H | |
5 #define DEMO_UTIL_H | |
6 | |
7 /* commonly used headers */ | |
8 #include <assert.h> | |
9 #include <stdlib.h> | |
10 #include <string.h> | |
11 #include <stdio.h> | |
12 | |
13 #ifdef __cplusplus | |
14 extern "C" { | |
15 #endif | |
16 | |
17 /* If str is not NULL, prints it and exits program, otherwise returns */ | |
18 void error( const char* str ); | |
19 | |
20 /* Loads file and returns pointer to data in memory, allocated with malloc(). | |
21 If size_out != NULL, sets *size_out to size of data. */ | |
22 unsigned char* load_file( const char* path, long* size_out ); | |
23 | |
24 /* Writes data to file */ | |
25 void write_file( const char* path, void const* in, long size ); | |
26 | |
27 #ifdef __cplusplus | |
28 } | |
29 #endif | |
30 | |
31 #endif |