aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/log.h
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-08-22 13:40:27 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2022-08-23 21:44:04 +0200
commit1ce4acb85a3bcb953c0f9cc91d2edc855969948b (patch)
treec06abb52fef74d375c87a7bdf39e7777bbf1b3b1 /src/log.h
parentadd doc/rationale.md (diff)
downloadcimple-1ce4acb85a3bcb953c0f9cc91d2edc855969948b.tar.gz
cimple-1ce4acb85a3bcb953c0f9cc91d2edc855969948b.zip
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.
Diffstat (limited to 'src/log.h')
-rw-r--r--src/log.h20
1 files changed, 20 insertions, 0 deletions
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 <netdb.h>
+#include <stdio.h>
+#include <string.h>
+
+#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