46 #define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) 47 #define MIN(X, Y) ((X) < (Y) ? (X) : (Y)) 192 if ((status >= m_codeblock[i].
min) && (status <= m_codeblock[i].
max)) {
226 const char* text = NULL;
230 text = m_codeblock[block].
message[status - m_codeblock[block].
min];
234 text = strerror(status);
267 output = m_codeblock[block].
output;
340 va_start(ap, status);
381 vsnprintf(buffer,
sizeof(buffer), message, ap);
382 buffer[
sizeof(buffer) - 1] =
'\0';
387 snprintf(buffer,
sizeof(buffer),
"?????: unknown message number %d", status);
void * MemCalloc(size_t nmemb, size_t size)
int MsgLogAp(int status, va_list ap)
const char * MsgText(int status)
MSG_OUTPUT_FUNCTION MsgGetOutput(int status)
int MsgFindCodeBlock(int status)
void * MemRealloc(void *ptr, size_t size)
void MsgRegister(int min, int max, const char **message, MSG_OUTPUT_FUNCTION output)
void MsgDefaultOutput(const char *text)
int MsgLog(int status,...)
MSG_OUTPUT_FUNCTION output
void MsgSetOutput(int status, MSG_OUTPUT_FUNCTION output)
void MsgNoOutput(const char *text)
MSG_CODEBLOCK * m_codeblock
void(* MSG_OUTPUT_FUNCTION)(const char *text)