14 #ifndef LIMBO_PREPROCESSOR_PRINTMSG_H
15 #define LIMBO_PREPROCESSOR_PRINTMSG_H
40 void limboPrintAssertMsg(
const char* expr,
const char* fileName,
unsigned lineNum,
const char* funcName,
const char* format, ...);
41 void limboPrintAssertMsg(
const char* expr,
const char* fileName,
unsigned lineNum,
const char* funcName);
52 va_start(args, format);
67 va_start(args, format);
87 sprintf(formatBuf,
"%s%s", prefix, format);
91 int ret = vfprintf(stream, formatBuf, args);
104 va_start(args, format);
122 sprintf(buf,
"%s", prefix);
125 int ret = vsprintf(buf+strlen(prefix), format, args);
139 return sprintf(prefix,
"%c",
'\0');
141 return sprintf(prefix,
"(I) ");
143 return sprintf(prefix,
"(W) ");
145 return sprintf(prefix,
"(E) ");
147 return sprintf(prefix,
"(D) ");
149 return sprintf(prefix,
"(A) ");
151 return sprintf(prefix,
"(?) ");
163 inline void limboPrintAssertMsg(
const char* expr,
const char* fileName,
unsigned lineNum,
const char* funcName,
const char* format, ...)
168 va_start(args, format);
169 vsprintf(buf, format, args);
173 limboPrintStream(kASSERT, stderr,
"%s:%u: %s: Assertion `%s' failed: %s\n", fileName, lineNum, funcName, expr, buf);
182 inline void limboPrintAssertMsg(
const char* expr,
const char* fileName,
unsigned lineNum,
const char* funcName)
185 limboPrintStream(kASSERT, stderr,
"%s:%u: %s: Assertion `%s' failed\n", fileName, lineNum, funcName, expr);
int limboPrintStream(MessageType m, FILE *stream, const char *format,...)
formatted print with prefix to stream
MessageType
message type for print functions
int limboSPrint(MessageType m, char *buf, const char *format,...)
formatted print with prefix to buffer
void limboPrintAssertMsg(const char *expr, const char *fileName, unsigned lineNum, const char *funcName, const char *format,...)
print message for assertion failure with additional message, see limboAssertMsg(condition, args...)
int limboPrint(MessageType m, const char *format,...)
formatted print with prefix
int limboVPrintStream(MessageType m, FILE *stream, const char *format, va_list args)
formatted print with prefix to stream
int limboSPrintPrefix(MessageType m, char *prefix)
print prefix message to buffer
int limboVSPrint(MessageType m, char *buf, const char *format, va_list args)
formatted print with prefix to buffer