Merge remote-tracking branch 'origin/master' into credentials
[oweals/gnunet.git] / src / util / gnunet-config-diff.c
1 #include "platform.h"
2 #include <gnunet_util_lib.h>
3
4 int
5 main (int argc, char **argv)
6 {
7   struct GNUNET_CONFIGURATION_Handle *i1;
8   struct GNUNET_CONFIGURATION_Handle *i2;
9
10   if (argc != 3)
11   {
12     fprintf (stderr, "Invoke using `%s DEFAULTS-IN DIFFS'\n", argv[0]);
13     return 1;
14   }
15   i1 = GNUNET_CONFIGURATION_create ();
16   i2 = GNUNET_CONFIGURATION_create ();
17   if ((GNUNET_OK != GNUNET_CONFIGURATION_load (i1, argv[1])) ||
18       (GNUNET_OK != GNUNET_CONFIGURATION_load (i2, argv[2])))
19     return 1;
20   if (GNUNET_OK != GNUNET_CONFIGURATION_write_diffs (i1, i2, argv[2]))
21     return 2;
22   return 0;
23 }