aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_configuration_lib.h
diff options
context:
space:
mode:
authorSafey A.Halim <safey.allah@gmail.com>2009-11-09 17:56:54 +0000
committerSafey A.Halim <safey.allah@gmail.com>2009-11-09 17:56:54 +0000
commit8518be376f51fc3e682597a97157914d4745d5bc (patch)
treeceed7ce24abfc7170d78f94e3dc31e8ccddaeb28 /src/include/gnunet_configuration_lib.h
parenta6ed6706bc790380caabdde179877f1589867e0b (diff)
downloadgnunet-8518be376f51fc3e682597a97157914d4745d5bc.tar.gz
gnunet-8518be376f51fc3e682597a97157914d4745d5bc.zip
* test_peer.c is a test case for peer.c
* Changes in configuration.c and gnunet_configuration_lib.h for dumping configuration diffs between the default configuration object and an edited configuration.
Diffstat (limited to 'src/include/gnunet_configuration_lib.h')
-rw-r--r--src/include/gnunet_configuration_lib.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h
index f05d29421..5510ad095 100644
--- a/src/include/gnunet_configuration_lib.h
+++ b/src/include/gnunet_configuration_lib.h
@@ -45,6 +45,17 @@ extern "C"
45 */ 45 */
46struct GNUNET_CONFIGURATION_Handle; 46struct GNUNET_CONFIGURATION_Handle;
47 47
48
49/**
50 * Used for diffing a configuration object against
51 * the default one
52 */
53typedef struct {
54 struct GNUNET_CONFIGURATION_Handle* cfgNew;
55 struct GNUNET_CONFIGURATION_Handle* cfgDiff;
56} GNUNNET_CONFIGURATION_Diff_Handle;
57
58
48/** 59/**
49 * Create a new configuration object. 60 * Create a new configuration object.
50 * @return fresh configuration object 61 * @return fresh configuration object
@@ -105,6 +116,18 @@ int GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg,
105int GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, 116int GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg,
106 const char *filename); 117 const char *filename);
107 118
119/**
120 * Write only configuration entries that have been changed to configuration file
121 * @param cfgDefault default configuration
122 * @param cfgNew new configuration
123 * @param filename where to write the configuration diff between default and new
124 * @return GNUNET_OK on success, GNUNET_SYSERR on error
125 */
126int
127GNUNET_CONFIGURATION_write_diffs(
128 struct GNUNET_CONFIGURATION_Handle *cfgDefault,
129 struct GNUNET_CONFIGURATION_Handle *cfgNew,
130 const char* filename);
108 131
109/** 132/**
110 * Test if there are configuration options that were 133 * Test if there are configuration options that were