aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util/Makefile.am9
-rw-r--r--src/util/gnunet-config-diff.c28
2 files changed, 37 insertions, 0 deletions
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index bbe00cb2d..7371faf2e 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -25,6 +25,15 @@ if USE_COVERAGE
25 XLIB = -lgcov 25 XLIB = -lgcov
26endif 26endif
27 27
28noinst_PROGRAMS = \
29 gnunet-config-diff
30
31gnunet_config_diff_SOURCES = \
32 gnunet-config-diff.c
33gnunet_config_diff_LDADD = \
34 $(top_builddir)/src/util/libgnunetutil.la
35
36
28lib_LTLIBRARIES = libgnunetutil.la 37lib_LTLIBRARIES = libgnunetutil.la
29 38
30libgnunetutil_la_SOURCES = \ 39libgnunetutil_la_SOURCES = \
diff --git a/src/util/gnunet-config-diff.c b/src/util/gnunet-config-diff.c
new file mode 100644
index 000000000..3c0af8f24
--- /dev/null
+++ b/src/util/gnunet-config-diff.c
@@ -0,0 +1,28 @@
1#include "platform.h"
2#include <gnunet_util_lib.h>
3
4int main(int argc,
5 char **argv)
6{
7 struct GNUNET_CONFIGURATION_Handle *i1;
8 struct GNUNET_CONFIGURATION_Handle *i2;
9
10 if (argc != 3)
11 {
12 fprintf (stderr,
13 "Invoke using `%s DEFAULTS-IN DIFFS'\n",
14 argv[0]);
15 return 1;
16 }
17 i1 = GNUNET_CONFIGURATION_create ();
18 i2 = GNUNET_CONFIGURATION_create ();
19 if ( (GNUNET_OK !=
20 GNUNET_CONFIGURATION_load (i1, argv[1])) ||
21 (GNUNET_OK !=
22 GNUNET_CONFIGURATION_load (i2, argv[2])) )
23 return 1;
24 if (GNUNET_OK !=
25 GNUNET_CONFIGURATION_write_diffs (i1, i2, argv[2]))
26 return 2;
27 return 0;
28}