MCPcopy Create free account
hub / github.com/cutdigital/mcut / mcDebugMessageCallback

Function mcDebugMessageCallback

source/mcut.cpp:95–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95MCAPI_ATTR McResult MCAPI_CALL mcDebugMessageCallback(McContext pContext, pfn_mcDebugOutput_CALLBACK cb, const McVoid* userParam)
96{
97 McResult return_value = McResult::MC_NO_ERROR;
98 per_thread_api_log_str.clear();
99
100 if (pContext == nullptr) {
101 per_thread_api_log_str = "context ptr (param0) undef (NULL)";
102 } else if (cb == nullptr) {
103 per_thread_api_log_str = "callback function ptr (param1) undef (NULL)";
104 } else {
105 try {
106 debug_message_callback_impl(pContext, cb, userParam);
107 }
108 CATCH_POSSIBLE_EXCEPTIONS(per_thread_api_log_str);
109 }
110
111 if (!per_thread_api_log_str.empty()) {
112 std::fprintf(stderr, "%s(...) -> %s\n", __FUNCTION__, per_thread_api_log_str.c_str());
113
114 if (return_value == McResult::MC_NO_ERROR) // i.e. problem with basic local parameter checks
115 {
116 return_value = McResult::MC_INVALID_VALUE;
117 }
118 }
119
120 return return_value;
121}
122
123MCAPI_ATTR McResult MCAPI_CALL mcGetDebugMessageLog(
124 McContext context,

Callers 7

UTEST_FFunction · 0.85
UTEST_FFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 2

emptyMethod · 0.45

Tested by

no test coverage detected