GNUnet  0.11.x
Data Structures | Macros | Functions
configuration.c File Reference

configuration management More...

#include "platform.h"
#include "gnunet_crypto_lib.h"
#include "gnunet_strings_lib.h"
#include "gnunet_configuration_lib.h"
#include "gnunet_disk_lib.h"
Include dependency graph for configuration.c:

Go to the source code of this file.

Data Structures

struct  ConfigEntry
 configuration entry More...
 
struct  ConfigSection
 configuration section More...
 
struct  GNUNET_CONFIGURATION_Handle
 configuration data More...
 
struct  DiffHandle
 Used for diffing a configuration object against the default one. More...
 

Macros

#define LOG(kind, ...)   GNUNET_log_from (kind, "util", __VA_ARGS__)
 
#define LOG_STRERROR_FILE(kind, syscall, filename)   GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
 

Functions

struct GNUNET_CONFIGURATION_HandleGNUNET_CONFIGURATION_create ()
 Create a GNUNET_CONFIGURATION_Handle. More...
 
void GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg)
 Destroy configuration object. More...
 
int GNUNET_CONFIGURATION_parse_and_run (const char *filename, GNUNET_CONFIGURATION_Callback cb, void *cb_cls)
 Parse a configuration file filename and run the function cb with the resulting configuration object. More...
 
int GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg, const char *mem, size_t size, const char *basedir)
 De-serializes configuration. More...
 
int GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename)
 Parse a configuration file, add all of the options in the file to the configuration environment. More...
 
int GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg)
 Test if there are configuration options that were changed since the last save. More...
 
char * GNUNET_CONFIGURATION_serialize (const struct GNUNET_CONFIGURATION_Handle *cfg, size_t *size)
 Serializes the given configuration. More...
 
int GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename)
 Write configuration file. More...
 
void GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CONFIGURATION_Iterator iter, void *iter_cls)
 Iterate over all options in the configuration. More...
 
void GNUNET_CONFIGURATION_iterate_section_values (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, GNUNET_CONFIGURATION_Iterator iter, void *iter_cls)
 Iterate over values of a section in the configuration. More...
 
void GNUNET_CONFIGURATION_iterate_sections (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CONFIGURATION_Section_Iterator iter, void *iter_cls)
 Iterate over all sections in the configuration. More...
 
void GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg, const char *section)
 Remove the given section and all options in it. More...
 
static void copy_entry (void *cls, const char *section, const char *option, const char *value)
 Copy a configuration value to the given target configuration. More...
 
struct GNUNET_CONFIGURATION_HandleGNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *cfg)
 Duplicate an existing configuration object. More...
 
static struct ConfigSectionfind_section (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section)
 Find a section entry from a configuration. More...
 
static struct ConfigEntryfind_entry (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *key)
 Find an entry from a configuration. More...
 
static void compare_entries (void *cls, const char *section, const char *option, const char *value)
 A callback function, compares entries from two configurations (default against a new configuration) and write the diffs in a diff-configuration object (the callback object). More...
 
struct GNUNET_CONFIGURATION_HandleGNUNET_CONFIGURATION_get_diff (const struct GNUNET_CONFIGURATION_Handle *cfg_default, const struct GNUNET_CONFIGURATION_Handle *cfg_new)
 Compute configuration with only entries that have been changed. More...
 
int GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle *cfg_default, const struct GNUNET_CONFIGURATION_Handle *cfg_new, const char *filename)
 Write only configuration entries that have been changed to configuration file. More...
 
void GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, const char *value)
 Set a configuration value that should be a string. More...
 
void GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long number)
 Set a configuration value that should be a number. More...
 
int GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long *number)
 Get a configuration value that should be a number. More...
 
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 floating point number. More...
 
int GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, struct GNUNET_TIME_Relative *time)
 Get a configuration value that should be a relative time. More...
 
int GNUNET_CONFIGURATION_get_value_size (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long *size)
 Get a configuration value that should be a size in bytes. More...
 
int GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
 Get a configuration value that should be a string. More...
 
int GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, const char *const *choices, const char **value)
 Get a configuration value that should be in a set of predefined strings. More...
 
int GNUNET_CONFIGURATION_get_data (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, void *buf, size_t buf_size)
 Get crockford32-encoded fixed-size binary data from a configuration. More...
 
int GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option)
 Test if we have a value for a particular option. More...
 
static char * expand_dollar (const struct GNUNET_CONFIGURATION_Handle *cfg, char *orig, unsigned int depth)
 Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" where either in the "PATHS" section or the environtment "FOO" is set to "DIRECTORY". More...
 
char * GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle *cfg, char *orig)
 Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" where either in the "PATHS" section or the environtment "FOO" is set to "DIRECTORY". More...
 
int GNUNET_CONFIGURATION_get_value_filename (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
 Get a configuration value that should be a string. More...
 
int GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option)
 Get a configuration value that should be in a set of "YES" or "NO". More...
 
int GNUNET_CONFIGURATION_iterate_value_filenames (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, GNUNET_FileNameCallback cb, void *cb_cls)
 Iterate over the set of filenames stored in a configuration value. More...
 
static char * escape_name (const char *value)
 FIXME. More...
 
static int test_match (void *cls, const char *fn)
 FIXME. More...
 
int GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, const char *value)
 Append a filename to a configuration value that represents a list of filenames. More...
 
int GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, const char *value)
 Remove a filename from a configuration value that represents a list of filenames. More...
 
static int parse_configuration_file (void *cls, const char *filename)
 Wrapper around GNUNET_CONFIGURATION_parse. More...
 
int GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg, const char *defaults_d)
 Load default configuration. More...
 

Detailed Description

configuration management

Author
Christian Grothoff

Definition in file configuration.c.

Macro Definition Documentation

◆ LOG

#define LOG (   kind,
  ... 
)    GNUNET_log_from (kind, "util", __VA_ARGS__)

◆ LOG_STRERROR_FILE

#define LOG_STRERROR_FILE (   kind,
  syscall,
  filename 
)    GNUNET_log_from_strerror_file (kind, "util", syscall, filename)

Definition at line 35 of file configuration.c.

Function Documentation

◆ copy_entry()

static void copy_entry ( void *  cls,
const char *  section,
const char *  option,
const char *  value 
)
static

Copy a configuration value to the given target configuration.

Overwrites existing entries.

Parameters
clsthe destination configuration (struct GNUNET_CONFIGURATION_Handle *)
sectionsection for the value
optionoption name of the value
valuevalue to copy

Definition at line 684 of file configuration.c.

References GNUNET_CONFIGURATION_set_value_string().

Referenced by GNUNET_CONFIGURATION_dup().

688 {
689  struct GNUNET_CONFIGURATION_Handle *dst = cls;
690 
692 }
static char * section
Name of the section.
Definition: gnunet-config.c:33
static char * value
Value of the record to add/remove.
static char * option
Name of the option.
Definition: gnunet-config.c:38
void GNUNET_CONFIGURATION_set_value_string(struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, const char *value)
Set a configuration value that should be a string.
configuration data
Definition: configuration.c:85
Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_section()

static struct ConfigSection* find_section ( const struct GNUNET_CONFIGURATION_Handle cfg,
const char *  section 
)
static

Find a section entry from a configuration.

Parameters
cfgconfiguration to search in
sectionname of the section to look for
Returns
matching entry, NULL if not found

Definition at line 720 of file configuration.c.

References ConfigSection::name, ConfigSection::next, and GNUNET_CONFIGURATION_Handle::sections.

Referenced by find_entry(), and GNUNET_CONFIGURATION_set_value_string().

722 {
723  struct ConfigSection *pos;
724 
725  pos = cfg->sections;
726  while ((pos != NULL) && (0 != strcasecmp (section, pos->name)))
727  pos = pos->next;
728  return pos;
729 }
static char * section
Name of the section.
Definition: gnunet-config.c:33
char * name
name of the section
Definition: configuration.c:78
struct ConfigSection * sections
Configuration sections.
Definition: configuration.c:90
configuration section
Definition: configuration.c:63
struct ConfigSection * next
This is a linked list.
Definition: configuration.c:68
Here is the caller graph for this function:

◆ find_entry()

static struct ConfigEntry* find_entry ( const struct GNUNET_CONFIGURATION_Handle cfg,
const char *  section,
const char *  key 
)
static

Find an entry from a configuration.

Parameters
cfghandle to the configuration
sectionsection the option is in
keythe option
Returns
matching entry, NULL if not found

Definition at line 741 of file configuration.c.

References ConfigSection::entries, find_section(), ConfigEntry::key, and ConfigEntry::next.

Referenced by compare_entries(), GNUNET_CONFIGURATION_get_value_choice(), GNUNET_CONFIGURATION_get_value_float(), GNUNET_CONFIGURATION_get_value_number(), GNUNET_CONFIGURATION_get_value_size(), GNUNET_CONFIGURATION_get_value_string(), GNUNET_CONFIGURATION_get_value_time(), GNUNET_CONFIGURATION_have_value(), and GNUNET_CONFIGURATION_set_value_string().

744 {
745  struct ConfigSection *sec;
746  struct ConfigEntry *pos;
747 
748  if (NULL == (sec = find_section (cfg, section)))
749  return NULL;
750  pos = sec->entries;
751  while ((pos != NULL) && (0 != strcasecmp (key, pos->key)))
752  pos = pos->next;
753  return pos;
754 }
struct ConfigEntry * entries
entries in the section
Definition: configuration.c:73
configuration entry
Definition: configuration.c:41
static char * section
Name of the section.
Definition: gnunet-config.c:33
static struct ConfigSection * find_section(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section)
Find a section entry from a configuration.
struct GNUNET_HashCode key
The key used in the DHT.
struct ConfigEntry * next
This is a linked list.
Definition: configuration.c:46
configuration section
Definition: configuration.c:63
char * key
key for this entry
Definition: configuration.c:51
Here is the call graph for this function:
Here is the caller graph for this function:

◆ compare_entries()

static void compare_entries ( void *  cls,
const char *  section,
const char *  option,
const char *  value 
)
static

A callback function, compares entries from two configurations (default against a new configuration) and write the diffs in a diff-configuration object (the callback object).

Parameters
clsthe diff configuration (struct DiffHandle *)
sectionsection for the value (of the default conf.)
optionoption name of the value (of the default conf.)
valuevalue to copy (of the default conf.)

Definition at line 768 of file configuration.c.

References DiffHandle::cfg_default, DiffHandle::cfgDiff, find_entry(), GNUNET_CONFIGURATION_set_value_string(), and ConfigEntry::val.

Referenced by GNUNET_CONFIGURATION_get_diff().

772 {
773  struct DiffHandle *dh = cls;
774  struct ConfigEntry *entNew;
775 
776  entNew = find_entry (dh->cfg_default, section, option);
777  if ((NULL != entNew) && (NULL != entNew->val) &&
778  (0 == strcmp (entNew->val, value)))
779  return;
781 }
configuration entry
Definition: configuration.c:41
static struct ConfigEntry * find_entry(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *key)
Find an entry from a configuration.
struct GNUNET_CONFIGURATION_Handle * cfgDiff
static char * section
Name of the section.
Definition: gnunet-config.c:33
static char * value
Value of the record to add/remove.
static char * option
Name of the option.
Definition: gnunet-config.c:38
void GNUNET_CONFIGURATION_set_value_string(struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, const char *value)
Set a configuration value that should be a string.
Used for diffing a configuration object against the default one.
const struct GNUNET_CONFIGURATION_Handle * cfg_default
char * val
current, commited value
Definition: configuration.c:56
Here is the call graph for this function:
Here is the caller graph for this function:

◆ expand_dollar()

static char* expand_dollar ( const struct GNUNET_CONFIGURATION_Handle cfg,
char *  orig,
unsigned int  depth 
)
static

Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" where either in the "PATHS" section or the environtment "FOO" is set to "DIRECTORY".

We also support default expansion, i.e. ${VARIABLE:-default} will expand to $VARIABLE if VARIABLE is set in PATHS or the environment, and otherwise to "default". Note that "default" itself can also be a $-expression, thus "${VAR1:-{$VAR2}}" will expand to VAR1 and if that is not defined to VAR2.

Parameters
cfgconfiguration to use for path expansion
origstring to $-expand (will be freed!)
depthrecursion depth, used to detect recursive expansions
Returns
$-expanded string

Definition at line 1170 of file configuration.c.

References _, end, env, getenv(), GNUNET_CONFIGURATION_expand_dollar(), GNUNET_CONFIGURATION_get_value_string(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_free_non_null, GNUNET_malloc, GNUNET_OK, GNUNET_realloc, GNUNET_strdup, len, LOG, result, and start.

Referenced by GNUNET_CONFIGURATION_expand_dollar().

1173 {
1174  char *prefix;
1175  char *result;
1176  char *start;
1177  const char *post;
1178  const char *env;
1179  char *def;
1180  char *end;
1181  unsigned int lopen;
1182  char erased_char;
1183  char *erased_pos;
1184  size_t len;
1185 
1186  if (NULL == orig)
1187  return NULL;
1188  if (depth > 128)
1189  {
1191  _ (
1192  "Recursive expansion suspected, aborting $-expansion for term `%s'\n"),
1193  orig);
1194  return orig;
1195  }
1196  LOG (GNUNET_ERROR_TYPE_DEBUG, "Asked to $-expand %s\n", orig);
1197  if ('$' != orig[0])
1198  {
1199  LOG (GNUNET_ERROR_TYPE_DEBUG, "Doesn't start with $ - not expanding\n");
1200  return orig;
1201  }
1202  erased_char = 0;
1203  erased_pos = NULL;
1204  if ('{' == orig[1])
1205  {
1206  start = &orig[2];
1207  lopen = 1;
1208  end = &orig[1];
1209  while (lopen > 0)
1210  {
1211  end++;
1212  switch (*end)
1213  {
1214  case '}':
1215  lopen--;
1216  break;
1217 
1218  case '{':
1219  lopen++;
1220  break;
1221 
1222  case '\0':
1224  _ ("Missing closing `%s' in option `%s'\n"),
1225  "}",
1226  orig);
1227  return orig;
1228 
1229  default:
1230  break;
1231  }
1232  }
1233  erased_char = *end;
1234  erased_pos = end;
1235  *end = '\0';
1236  post = end + 1;
1237  def = strchr (orig, ':');
1238  if (NULL != def)
1239  {
1240  *def = '\0';
1241  def++;
1242  if (('-' == *def) || ('=' == *def))
1243  def++;
1244  def = GNUNET_strdup (def);
1245  }
1246  }
1247  else
1248  {
1249  int i;
1250 
1251  start = &orig[1];
1252  def = NULL;
1253  i = 0;
1254  while ((orig[i] != '/') && (orig[i] != '\\') && (orig[i] != '\0') &&
1255  (orig[i] != ' '))
1256  i++;
1257  if (orig[i] == '\0')
1258  {
1259  post = "";
1260  }
1261  else
1262  {
1263  erased_char = orig[i];
1264  erased_pos = &orig[i];
1265  orig[i] = '\0';
1266  post = &orig[i + 1];
1267  }
1268  }
1270  "Split into `%s' and `%s' with default %s\n",
1271  start,
1272  post,
1273  def);
1274  if (GNUNET_OK !=
1275  GNUNET_CONFIGURATION_get_value_string (cfg, "PATHS", start, &prefix))
1276  {
1277  if (NULL == (env = getenv (start)))
1278  {
1279  /* try default */
1280  def = expand_dollar (cfg, def, depth + 1);
1281  env = def;
1282  }
1283  if (NULL == env)
1284  {
1285  start = GNUNET_strdup (start);
1286  if (erased_pos)
1287  *erased_pos = erased_char;
1289  _ (
1290  "Failed to expand `%s' in `%s' as it is neither found in [PATHS] nor defined as an environmental variable\n"),
1291  start,
1292  orig);
1293  GNUNET_free (start);
1294  return orig;
1295  }
1296  prefix = GNUNET_strdup (env);
1297  }
1298  prefix = GNUNET_CONFIGURATION_expand_dollar (cfg, prefix);
1299  if ((erased_pos) && ('}' != erased_char))
1300  {
1301  len = strlen (prefix) + 1;
1302  prefix = GNUNET_realloc (prefix, len + 1);
1303  prefix[len - 1] = erased_char;
1304  prefix[len] = '\0';
1305  }
1306  result = GNUNET_malloc (strlen (prefix) + strlen (post) + 1);
1307  strcpy (result, prefix);
1308  strcat (result, post);
1309  GNUNET_free_non_null (def);
1310  GNUNET_free (prefix);
1311  GNUNET_free (orig);
1312  return result;
1313 }
static int end
Set if we are to shutdown all services (including ARM).
Definition: gnunet-arm.c:34
static int start
Set if we are to start default services (including ARM).
Definition: gnunet-arm.c:39
char * GNUNET_CONFIGURATION_expand_dollar(const struct GNUNET_CONFIGURATION_Handle *cfg, char *orig)
Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" where either in the "PATHS" section or...
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
#define GNUNET_free_non_null(ptr)
Free the memory pointed to by ptr if ptr is not NULL.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define _(String)
GNU gettext support macro.
Definition: platform.h:181
#define GNUNET_realloc(ptr, size)
Wrapper around realloc.
static int result
Global testing status.
#define LOG(kind,...)
Definition: configuration.c:33
int GNUNET_CONFIGURATION_get_value_string(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be a string.
char * getenv()
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
static char * expand_dollar(const struct GNUNET_CONFIGURATION_Handle *cfg, char *orig, unsigned int depth)
Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" where either in the "PATHS" section or...
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...
Here is the call graph for this function:
Here is the caller graph for this function:

◆ escape_name()

static char* escape_name ( const char *  value)
static

FIXME.

Parameters
valueFIXME
Returns
FIXME

Definition at line 1505 of file configuration.c.

References GNUNET_malloc, and value.

Referenced by GNUNET_CONFIGURATION_append_value_filename(), and GNUNET_CONFIGURATION_remove_value_filename().

1506 {
1507  char *escaped;
1508  const char *rpos;
1509  char *wpos;
1510 
1511  escaped = GNUNET_malloc (strlen (value) * 2 + 1);
1512  memset (escaped, 0, strlen (value) * 2 + 1);
1513  rpos = value;
1514  wpos = escaped;
1515  while (rpos[0] != '\0')
1516  {
1517  switch (rpos[0])
1518  {
1519  case '\\':
1520  case ' ':
1521  wpos[0] = '\\';
1522  wpos[1] = rpos[0];
1523  wpos += 2;
1524  break;
1525 
1526  default:
1527  wpos[0] = rpos[0];
1528  wpos++;
1529  }
1530  rpos++;
1531  }
1532  return escaped;
1533 }
static char * value
Value of the record to add/remove.
#define GNUNET_malloc(size)
Wrapper around malloc.
Here is the caller graph for this function:

◆ test_match()

static int test_match ( void *  cls,
const char *  fn 
)
static

FIXME.

Parameters
clsstring we compare with (const char*)
fnfilename we are currently looking at
Returns
GNUNET_OK if the names do not match, GNUNET_SYSERR if they do

Definition at line 1544 of file configuration.c.

References GNUNET_OK, and GNUNET_SYSERR.

Referenced by GNUNET_CONFIGURATION_append_value_filename().

1545 {
1546  const char *of = cls;
1547 
1548  return (0 == strcmp (of, fn)) ? GNUNET_SYSERR : GNUNET_OK;
1549 }
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
static char * fn
Filename of the unique file.
#define GNUNET_SYSERR
Definition: gnunet_common.h:76
Here is the caller graph for this function:

◆ parse_configuration_file()

static int parse_configuration_file ( void *  cls,
const char *  filename 
)
static

Wrapper around GNUNET_CONFIGURATION_parse.

Called on each file in a directory, we trigger parsing on those files that end with ".conf".

Parameters
clsthe cfg
filenamefile to parse
Returns
GNUNET_OK on success

Definition at line 1697 of file configuration.c.

References cfg, GNUNET_CONFIGURATION_parse(), GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_OK, and ret.

Referenced by GNUNET_CONFIGURATION_load_from().

1698 {
1699  struct GNUNET_CONFIGURATION_Handle *cfg = cls;
1700  char *ext;
1701  int ret;
1702 
1703  /* Examine file extension */
1704  ext = strrchr (filename, '.');
1705  if ((NULL == ext) || (0 != strcmp (ext, ".conf")))
1706  {
1707  GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Skipping file `%s'\n", filename);
1708  return GNUNET_OK;
1709  }
1710 
1711  ret = GNUNET_CONFIGURATION_parse (cfg, filename);
1712  return ret;
1713 }
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static int ret
Return value of the commandline.
Definition: gnunet-abd.c:81
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
int GNUNET_CONFIGURATION_parse(struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename)
Parse a configuration file, add all of the options in the file to the configuration environment...
static char * filename
configuration data
Definition: configuration.c:85
#define GNUNET_log(kind,...)
Here is the call graph for this function:
Here is the caller graph for this function: