rlm@0: /* General-purpose utilities used by demos */ rlm@0: rlm@0: /* snes_spc 0.9.0 */ rlm@0: #ifndef DEMO_UTIL_H rlm@0: #define DEMO_UTIL_H rlm@0: rlm@0: /* commonly used headers */ rlm@0: #include rlm@0: #include rlm@0: #include rlm@0: #include rlm@0: rlm@0: #ifdef __cplusplus rlm@0: extern "C" { rlm@0: #endif rlm@0: rlm@0: /* If str is not NULL, prints it and exits program, otherwise returns */ rlm@0: void error( const char* str ); rlm@0: rlm@0: /* Loads file and returns pointer to data in memory, allocated with malloc(). rlm@0: If size_out != NULL, sets *size_out to size of data. */ rlm@0: unsigned char* load_file( const char* path, long* size_out ); rlm@0: rlm@0: /* Writes data to file */ rlm@0: void write_file( const char* path, void const* in, long size ); rlm@0: rlm@0: #ifdef __cplusplus rlm@0: } rlm@0: #endif rlm@0: rlm@0: #endif