diff options
Diffstat (limited to 'src/ckerrlog.c')
-rw-r--r-- | src/ckerrlog.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/ckerrlog.c b/src/ckerrlog.c index a023521..cfafb39 100644 --- a/src/ckerrlog.c +++ b/src/ckerrlog.c @@ -31,7 +31,7 @@ char *get_time() { return buf; } -void log_command(int argc, char* argv[]) { +void log_command(int argc,const char* argv[]) { char tmp[STR_L] = ""; for(int i = 0; i < argc; i++) { strcat(tmp, argv[i]); @@ -41,7 +41,8 @@ void log_command(int argc, char* argv[]) { } #define X(stream) \ - void add_ ## stream ## _with_delim(char *delim, char *txt, \ + void add_ ## stream ## _with_delim(const char *delim, \ + const char *txt, \ va_list args) { \ char tmp[STR_L]; \ vsprintf(tmp, txt, args); \ @@ -56,22 +57,22 @@ void log_command(int argc, char* argv[]) { CK_STREAMS #undef X -#define X(stream) \ - void ck## stream(char *txt, ...) { \ - va_list args; \ - va_start(args, txt); \ - add_## stream ##_with_delim("\n", txt, args); \ - va_end(args); \ +#define X(stream) \ + void ck## stream(const char *txt, ...) { \ + va_list args; \ + va_start(args, txt); \ + add_## stream ##_with_delim("\n", txt, args); \ + va_end(args); \ } CK_STREAMS #undef X -#define X(stream) \ - void ck## stream ##_with_delim(char *d, char *txt, ...) { \ - va_list args; \ - va_start(args, txt); \ - add_## stream ##_with_delim(d, txt, args); \ - va_end(args); \ +#define X(stream) \ + void ck## stream ##_with_delim(const char *d, const char *txt, ...) { \ + va_list args; \ + va_start(args, txt); \ + add_## stream ##_with_delim(d, txt, args); \ + va_end(args); \ } CK_STREAMS #undef X @@ -123,7 +124,7 @@ extern void errlog_set_verbose(int level) { } -void initialize_errlog(int argc, char* argv[]) { +void initialize_errlog(int argc, const char** argv) { #define X(stream) stream = NULL; CK_STREAMS #undef X |