32 void RMH_Print(
const RMH_Handle handle,
const RMH_LogLevel level,
const char *filename,
const uint32_t lineNumber,
const char *format, ...);
33 #define RMH_PrintErr(fmt, ...) if (!handle || (handle->logLevelBitMask & RMH_LOG_ERROR) == RMH_LOG_ERROR) { RMH_Print(handle, RMH_LOG_ERROR, __FUNCTION__, __LINE__, "ERROR: " fmt, ##__VA_ARGS__); }
34 #define RMH_PrintWrn(fmt, ...) if (!handle || (handle->logLevelBitMask & RMH_LOG_WARNING) == RMH_LOG_WARNING) { RMH_Print(handle, RMH_LOG_WARNING, __FUNCTION__, __LINE__, "WARNING: " fmt, ##__VA_ARGS__); }
35 #define RMH_PrintMsg(fmt, ...) if (!handle || (handle->logLevelBitMask & RMH_LOG_MESSAGE) == RMH_LOG_MESSAGE) { RMH_Print(handle, RMH_LOG_MESSAGE, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__); }
36 #define RMH_PrintDbg(fmt, ...) if (!handle || (handle->logLevelBitMask & RMH_LOG_DEBUG) == RMH_LOG_DEBUG) { RMH_Print(handle, RMH_LOG_DEBUG, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__); }
37 #define RMH_PrintTrace(fmt, ...) if ((handle->logLevelBitMask & RMH_LOG_TRACE) == RMH_LOG_TRACE) { RMH_Print(handle, RMH_LOG_TRACE, __FUNCTION__, __LINE__, "[0x%p|0x%p]%.*s" fmt, handle, handle->handle, handle->apiDepth, "\t\t\t\t\t\t\t\t\t", ##__VA_ARGS__); }
39 #define BRMH_RETURN_IF(expr, ret) { if (expr) { RMH_PrintErr("'" #expr "' is true!\n"); return ret; } }
40 #define BRMH_RETURN_IF_FAILED(cmd) { \
41 RMH_Result ret = cmd; \
42 if (ret == RMH_NOT_SUPPORTED) { \
43 RMH_PrintWrn("'" #cmd "' is not supported by this device\n"); \
45 else if (ret != RMH_SUCCESS) { \
46 RMH_PrintDbg("'" #cmd "' failed with error %s!\n", RMH_ResultToString(ret)); \
51 #define RMH_MAX_PRINT_LINE_SIZE 2048
54 extern RMH_APIList hRMHGeneric_SoCUnimplementedAPIList;
61 struct timeval startTime;
62 RMH_EventCallback eventCB;
64 RMH_LogLevel logLevelBitMask;
65 RMH_Event eventNotifyBitMask;
66 void* eventCBUserContext;