chore: add basic utilities
This commit is contained in:
@@ -1,2 +1,7 @@
|
||||
#include "arguments.h"
|
||||
|
||||
int main(int argc, char **argv) { return 0; }
|
||||
int main(int argc, char **argv) {
|
||||
struct arguments arguments = {};
|
||||
argp_parse(&argp, argc, argv, ARGP_NO_HELP, 0, &arguments);
|
||||
return 0;
|
||||
}
|
||||
|
20
src/utils.c
Normal file
20
src/utils.c
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
#include "utils.h"
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void log_info(const char *fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
fprintf(stdout, "[INFO] ");
|
||||
vfprintf(stdout, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void log_error(const char *fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
fprintf(stderr, "[ERROR] ");
|
||||
vfprintf(stderr, fmt, args);
|
||||
va_end(args);
|
||||
}
|
Reference in New Issue
Block a user