Add a file for shared functions

New common.[hc] files where shared functions between surf and
webkitextension will be put. First addition is die().
This commit is contained in:
Quentin Rameau
2016-01-04 16:09:12 +01:00
parent 7ea0c2f7f8
commit 1901359efa
5 changed files with 24 additions and 18 deletions
+1 -13
View File
@@ -30,10 +30,10 @@
#include <glib.h>
#include "arg.h"
#include "common.h"
#define LENGTH(x) (sizeof(x) / sizeof(x[0]))
#define CLEANMASK(mask) (mask & (MODKEY|GDK_SHIFT_MASK))
#define MSGBUFSZ 32
enum { AtomFind, AtomGo, AtomUri, AtomLast };
@@ -142,7 +142,6 @@ typedef struct {
/* Surf */
static void usage(void);
static void die(const char *errstr, ...);
static void setup(void);
static void sigchld(int unused);
static void sighup(int unused);
@@ -310,17 +309,6 @@ usage(void)
"[-r scriptfile] [-u useragent] [-z zoomlevel] [uri]\n");
}
void
die(const char *errstr, ...)
{
va_list ap;
va_start(ap, errstr);
vfprintf(stderr, errstr, ap);
va_end(ap);
exit(1);
}
void
setup(void)
{