summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-11 16:36:24 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-11 16:36:24 -0300
commit53f1d782d0bb369da3bd7e2e3d09cd78c959ac9c (patch)
tree85e88b200dd52f9a7d7b824bab4f991243039d54
parent1687f1d3cc34221c0262f3ed257ab40d7a3f0c19 (diff)
downloadeeshow-53f1d782d0bb369da3bd7e2e3d09cd78c959ac9c.tar.gz
eeshow-53f1d782d0bb369da3bd7e2e3d09cd78c959ac9c.tar.bz2
eeshow-53f1d782d0bb369da3bd7e2e3d09cd78c959ac9c.zip
eeshow/main.c (verbose): move to new file diag.c
In preparation of a more flexible diagnostics system.
-rw-r--r--Makefile2
-rw-r--r--diag.c16
-rw-r--r--diag.h25
-rw-r--r--file.c2
-rw-r--r--git-file.c2
-rw-r--r--git-hist.c2
-rw-r--r--main.c4
-rw-r--r--main.h13
8 files changed, 46 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 2e340f4..7ec7c1f 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ NAME = eeshow
OBJS = main.o sch-parse.o sch-render.o lib-parse.o lib-render.o \
gui.o gui-over.o gui-style.o gui-aoi.o fmt-pango.o \
file.o git-util.o git-file.o git-hist.o delta.o \
- style.o fig.o record.o cro.o diff.o gfx.o dwg.o text.o misc.o
+ style.o fig.o record.o cro.o diff.o gfx.o dwg.o text.o misc.o diag.o
CFLAGS = -g -Wall -Wextra -Wno-unused-parameter -Wshadow \
-Wmissing-prototypes -Wmissing-declarations \
diff --git a/diag.c b/diag.c
new file mode 100644
index 0000000..c50b227
--- /dev/null
+++ b/diag.c
@@ -0,0 +1,16 @@
+/*
+ * diag.h - Diagnostics
+ *
+ * Written 2016 by Werner Almesberger
+ * Copyright 2016 by Werner Almesberger
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include "diag.h"
+
+
+int verbose = 0;
diff --git a/diag.h b/diag.h
new file mode 100644
index 0000000..8f22af4
--- /dev/null
+++ b/diag.h
@@ -0,0 +1,25 @@
+/*
+ * diag.h - Diagnostics
+ *
+ * Written 2016 by Werner Almesberger
+ * Copyright 2016 by Werner Almesberger
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef DIAG_H
+#define DIAG_H
+
+/*
+ * 0: no progress indications
+ * 1: reasonable progress indications
+ * 2: verbose output
+ * > 2: go wild !
+ */
+
+extern int verbose;
+
+#endif /* !DIAG_H */
diff --git a/file.c b/file.c
index 6910899..233b1d1 100644
--- a/file.c
+++ b/file.c
@@ -17,7 +17,7 @@
#include <string.h>
#include "util.h"
-#include "main.h"
+#include "diag.h"
#include "git-file.h"
#include "file.h"
diff --git a/git-file.c b/git-file.c
index 6d52020..74f26c3 100644
--- a/git-file.c
+++ b/git-file.c
@@ -21,7 +21,7 @@
#include <git2.h>
#include "util.h"
-#include "main.h"
+#include "diag.h"
#include "file.h"
#include "git-util.h"
#include "git-file.h"
diff --git a/git-hist.c b/git-hist.c
index 57c886d..6581542 100644
--- a/git-hist.c
+++ b/git-hist.c
@@ -17,7 +17,7 @@
#include <alloca.h>
#include "util.h"
-#include "main.h"
+#include "diag.h"
#include "fmt-pango.h" /* for vcs_long_for_pango */
#include "git-util.h"
#include "git-file.h"
diff --git a/main.c b/main.c
index 6583e3f..d104b14 100644
--- a/main.c
+++ b/main.c
@@ -20,6 +20,7 @@
#include <gtk/gtk.h>
#include "util.h"
+#include "diag.h"
#include "fig.h"
#include "cro.h"
#include "diff.h"
@@ -33,9 +34,6 @@
#include "main.h"
-int verbose = 0;
-
-
static struct gfx_ops const *ops_list[] = {
&fig_ops,
&cro_png_ops,
diff --git a/main.h b/main.h
index 4a3bdc1..eb3587c 100644
--- a/main.h
+++ b/main.h
@@ -13,19 +13,6 @@
#ifndef MAIN_H
#define MAIN_H
-#include <stdbool.h>
-
-
-/*
- * 0: no progress indications
- * 1: reasonable progress indications
- * 2: verbose output
- * > 2: go wild !
- */
-
-extern int verbose;
-
-
void usage(const char *name);
#endif /* !MAIN_H */