From 1ce4acb85a3bcb953c0f9cc91d2edc855969948b Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 22 Aug 2022 13:40:27 +0200 Subject: add some code A basic client-server app, the client sends commands as an array of strings. Hopefully I didn't mess up, and hopefully it'll be useful. --- src/log.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/log.h (limited to 'src/log.h') diff --git a/src/log.h b/src/log.h new file mode 100644 index 0000000..f050048 --- /dev/null +++ b/src/log.h @@ -0,0 +1,20 @@ +#ifndef __LOG_H__ +#define __LOG_H__ + +#include +#include +#include + +#define print_errno(s) \ + { \ + fprintf(stderr, "%s(%d): ", basename(__FILE__), __LINE__); \ + perror(s); \ + } + +#define print_error(...) \ + { \ + fprintf(stderr, "%s(%d): ", basename(__FILE__), __LINE__); \ + fprintf(stderr, __VA_ARGS__); \ + } + +#endif -- cgit v1.2.3