48 #define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
49 #define MIN(X, Y) ((X) < (Y) ? (X) : (Y))
195 if ((status >= m_codeblock[i].
min) && (status <= m_codeblock[i].
max)) {
229 const char* text = NULL;
233 text = m_codeblock[block].
message[status - m_codeblock[block].
min];
237 text = strerror(status);
270 output = m_codeblock[block].
output;
343 va_start(ap, status);
384 vsnprintf(buffer,
sizeof(buffer), message, ap);
385 buffer[
sizeof(buffer) - 1] =
'\0';
390 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