void SoundDecoder_SetError(const char* err_str, ...) { if(NULL == s_errorPool) { fprintf(stderr, "Error: You should not call SoundDecoder_SetError while Sound is not initialized\n"); return; } va_list argp; va_start(argp, err_str); // SDL_SetError which I'm emulating has no number parameter. TError_SetErrorv(s_errorPool, 1, err_str, argp); va_end(argp); #ifdef ANDROID_NDK __android_log_print(ANDROID_LOG_INFO, "SoundDecoder_SetError", TError_GetLastErrorStr(s_errorPool)); #endif }
const char* SoundDecoder_GetError() { const char* error_string = NULL; if(NULL == s_errorPool) { return "Error: You should not call SoundDecoder_GetError while Sound is not initialized"; } error_string = TError_GetLastErrorStr(s_errorPool); /* SDL returns empty strings instead of NULL */ if(NULL == error_string) { return ""; } else { return error_string; } }