introducing GNUNET_CRYPTO_ecdhe_create2() to avoid malloc nonsense
[oweals/gnunet.git] / src / include / gnunet_configuration_lib.h
index 0448a5865813b23d6db8edda535095f6ce85c9fb..746dea61fe77b20fc0f4b4ef3d3ae7353a46915b 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2006, 2008, 2009 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2006, 2008, 2009 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 
 /**
- * @file include/gnunet_configuration_lib.h
- * @brief configuration API
  * @author Christian Grothoff
- * @defgroup configuration Configuration management
+ *
+ * @file
+ * Configuration API
+ *
+ * @defgroup configuration  Configuration library
+ * Configuration management
  * @{
  */
 #ifndef GNUNET_CONFIGURATION_LIB_H
 #define GNUNET_CONFIGURATION_LIB_H
 
+#include "gnunet_time_lib.h"
 
 #ifdef __cplusplus
 extern "C"
@@ -85,7 +89,7 @@ GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg,
 
 /**
  * Load default configuration.  This function will parse the
- * defaults from the given defaults_d directory.
+ * defaults from the given @a defaults_d directory.
  *
  * @param cfg configuration to update
  * @param defaults_d directory with the defaults
@@ -136,7 +140,7 @@ GNUNET_CONFIGURATION_serialize (const struct GNUNET_CONFIGURATION_Handle *cfg,
 int
 GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg,
                                  const char *mem,
-                                 const size_t size,
+                                 size_t size,
                                  int allow_inline);
 
 
@@ -267,6 +271,22 @@ GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle
                                        unsigned long long *number);
 
 
+/**
+ * Get a configuration value that should be a floating point number.
+ *
+ * @param cfg configuration to inspect
+ * @param section section of interest
+ * @param option option of interest
+ * @param number where to store the floating value of the option
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
+ */
+int
+GNUNET_CONFIGURATION_get_value_float  (const struct GNUNET_CONFIGURATION_Handle
+                                       *cfg, const char *section,
+                                       const char *option,
+                                       float *number);
+
+
 /**
  * Get a configuration value that should be a relative time.
  *
@@ -414,6 +434,29 @@ GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle *
                                       const char *option);
 
 
+/**
+ * Get Crockford32-encoded fixed-size binary data from a configuration.
+ *
+ * @param cfg configuration to access
+ * @param section section to access
+ * @param option option to access
+ * @param buf where to store the decoded binary result
+ * @param buf_size exact number of bytes to store in @a buf
+ * @return #GNUNET_OK on success
+ *         #GNUNET_NO is the value does not exist
+ *         #GNUNET_SYSERR on decoding error
+ */
+int
+GNUNET_CONFIGURATION_get_data (const struct GNUNET_CONFIGURATION_Handle *cfg,
+                               const char *section,
+                               const char *option,
+                               void *buf,
+                               size_t buf_size);
+
+
+
+
+
 /**
  * Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR"
  * where either in the "PATHS" section or the environtment "FOO" is
@@ -500,8 +543,6 @@ GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle *
                                             const char *option,
                                             const char *value);
 
-/** @} */ /* end of group configuration */
-
 #if 0                           /* keep Emacsens' auto-indent happy */
 {
 #endif
@@ -510,3 +551,5 @@ GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle *
 #endif
 
 #endif
+
+/** @} */ /* end of group configuration */