48 #define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
49 #define MIN(X, Y) ((X) < (Y) ? (X) : (Y))
194 if ((status >= m_codeblock[i].
min) && (status <= m_codeblock[i].
max)) {
228 const char* text = NULL;
232 text = m_codeblock[block].
message[status - m_codeblock[block].
min];
236 text = strerror(status);
269 output = m_codeblock[block].
output;
342 va_start(ap, status);
383 vsnprintf(buffer,
sizeof(buffer), message, ap);
384 buffer[
sizeof(buffer) - 1] =
'\0';
389 snprintf(buffer,
sizeof(buffer),
"?????: unknown message number %d", status);
void * MemCalloc(size_t nmemb, size_t size)
void MsgNoOutput(const char *text)
int MsgLogAp(int status, va_list ap)
int MsgLog(int status,...)
const char * MsgText(int status)
MSG_OUTPUT_FUNCTION MsgGetOutput(int status)
void * MemRealloc(void *ptr, size_t size)
void(* MSG_OUTPUT_FUNCTION)(const char *text)
int MsgFindCodeBlock(int status)
MSG_OUTPUT_FUNCTION output
void MsgRegister(int min, int max, const char **message, MSG_OUTPUT_FUNCTION output)
void MsgSetOutput(int code, MSG_OUTPUT_FUNCTION output)
void MsgDefaultOutput(const char *text)
MSG_CODEBLOCK * m_codeblock