|
|
|
@ -1,14 +1,18 @@
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#ifdef NO_GC
|
|
|
|
|
#include <gc.h>
|
|
|
|
|
#define malloc(n) GC_malloc(n)
|
|
|
|
|
#else
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "color.h"
|
|
|
|
|
|
|
|
|
|
void info(char* ustr, ...) {
|
|
|
|
|
char* tstr = GRN "INFO: " CRESET;
|
|
|
|
|
char* str = GC_MALLOC(strlen(tstr) + strlen(ustr) + 1);
|
|
|
|
|
char* str = malloc(strlen(tstr) + strlen(ustr) + 1);
|
|
|
|
|
sprintf(str, "%s%s", tstr, ustr);
|
|
|
|
|
//strcat(str, ustr);
|
|
|
|
|
|
|
|
|
@ -19,7 +23,7 @@ void info(char* ustr, ...) {
|
|
|
|
|
|
|
|
|
|
void warn(char* ustr, ...) {
|
|
|
|
|
char* tstr = YEL "WARN: " CRESET;
|
|
|
|
|
char* str = GC_MALLOC(strlen(tstr) + strlen(ustr) + 1);
|
|
|
|
|
char* str = malloc(strlen(tstr) + strlen(ustr) + 1);
|
|
|
|
|
sprintf(str, "%s%s", tstr, ustr);
|
|
|
|
|
|
|
|
|
|
va_list lst;
|
|
|
|
@ -29,7 +33,7 @@ void warn(char* ustr, ...) {
|
|
|
|
|
|
|
|
|
|
void error(char* ustr, ...) {
|
|
|
|
|
char* tstr = RED "ERR: " CRESET;
|
|
|
|
|
char* str = GC_MALLOC(strlen(tstr) + strlen(ustr) + 1);
|
|
|
|
|
char* str = malloc(strlen(tstr) + strlen(ustr) + 1);
|
|
|
|
|
sprintf(str, "%s%s", tstr, ustr);
|
|
|
|
|
|
|
|
|
|
va_list lst;
|
|
|
|
@ -39,7 +43,7 @@ void error(char* ustr, ...) {
|
|
|
|
|
|
|
|
|
|
void reqlog(char* ustr, ...) {
|
|
|
|
|
char* tstr = WHT "REQ: " CRESET;
|
|
|
|
|
char* str = GC_MALLOC(strlen(tstr) + strlen(ustr) + 1);
|
|
|
|
|
char* str = malloc(strlen(tstr) + strlen(ustr) + 1);
|
|
|
|
|
sprintf(str, "%s%s", tstr, ustr);
|
|
|
|
|
|
|
|
|
|
va_list lst;
|
|
|
|
|