about summary refs log tree commit diff
path: root/common.c
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2016-01-04 16:09:12 +0100
committerQuentin Rameau <quinq@fifth.space>2018-10-08 11:38:03 +0200
commit1901359efa10fe2e18794df34fc33b81da03a6f5 (patch)
tree5f0267eb93763156d9b4348db7b62056bb064c12 /common.c
parentCommunicate with webextension via a pipe (diff)
downloadsurf-1901359efa10fe2e18794df34fc33b81da03a6f5.tar.gz
surf-1901359efa10fe2e18794df34fc33b81da03a6f5.tar.bz2
surf-1901359efa10fe2e18794df34fc33b81da03a6f5.zip
Add a file for shared functions
New common.[hc] files where shared functions between surf and
webkitextension will be put. First addition is die().
Diffstat (limited to 'common.c')
-rw-r--r--common.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/common.c b/common.c
new file mode 100644
index 0000000..42662ed
--- /dev/null
+++ b/common.c
@@ -0,0 +1,15 @@
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+void
+die(const char *errstr, ...)
+{
+	va_list ap;
+
+	va_start(ap, errstr);
+	vfprintf(stderr, errstr, ap);
+	va_end(ap);
+	exit(1);
+}
+