GNUnet  0.10.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 702 of file configuration.c.

References GNUNET_CONFIGURATION_set_value_string().

Referenced by GNUNET_CONFIGURATION_dup().

706 {
707  struct GNUNET_CONFIGURATION_Handle *dst = cls;
708 
710 }
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 738 of file configuration.c.

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

Referenced by find_entry(), and GNUNET_CONFIGURATION_set_value_string().

740 {
741  struct ConfigSection *pos;
742 
743  pos = cfg->sections;
744  while ((pos != NULL) && (0 != strcasecmp (section, pos->name)))
745  pos = pos->next;
746  return pos;
747 }
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 759 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().

762 {
763  struct ConfigSection *sec;
764  struct ConfigEntry *pos;
765 
766  if (NULL == (sec = find_section (cfg, section)))
767  return NULL;
768  pos = sec->entries;
769  while ((pos != NULL) && (0 != strcasecmp (key, pos->key)))
770  pos = pos->next;
771  return pos;
772 }
struct ConfigEntry * entries
entries in the section
Definition: configuration.c:73
configuration entry
Definition: configuration.c:40
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 786 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().

790 {
791  struct DiffHandle *dh = cls;
792  struct ConfigEntry *entNew;
793 
794  entNew = find_entry (dh->cfg_default, section, option);
795  if ( (NULL != entNew) &&
796  (NULL != entNew->val) &&
797  (0 == strcmp (entNew->val, value)) )
798  return;
800 }
configuration entry
Definition: configuration.c:40
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 1202 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().

1205 {
1206  int i;
1207  char *prefix;
1208  char *result;
1209  char *start;
1210  const char *post;
1211  const char *env;
1212  char *def;
1213  char *end;
1214  unsigned int lopen;
1215  char erased_char;
1216  char *erased_pos;
1217  size_t len;
1218 
1219  if (NULL == orig)
1220  return NULL;
1221  if (depth > 128)
1222  {
1224  _("Recursive expansion suspected, aborting $-expansion for term `%s'\n"),
1225  orig);
1226  return orig;
1227  }
1229  "Asked to $-expand %s\n",
1230  orig);
1231  if ('$' != orig[0])
1232  {
1234  "Doesn't start with $ - not expanding\n");
1235  return orig;
1236  }
1237  erased_char = 0;
1238  erased_pos = NULL;
1239  if ('{' == orig[1])
1240  {
1241  start = &orig[2];
1242  lopen = 1;
1243  end = &orig[1];
1244  while (lopen > 0)
1245  {
1246  end++;
1247  switch (*end)
1248  {
1249  case '}':
1250  lopen--;
1251  break;
1252  case '{':
1253  lopen++;
1254  break;
1255  case '\0':
1257  _("Missing closing `%s' in option `%s'\n"),
1258  "}",
1259  orig);
1260  return orig;
1261  default:
1262  break;
1263  }
1264  }
1265  erased_char = *end;
1266  erased_pos = end;
1267  *end = '\0';
1268  post = end + 1;
1269  def = strchr (orig, ':');
1270  if (NULL != def)
1271  {
1272  *def = '\0';
1273  def++;
1274  if ( ('-' == *def) ||
1275  ('=' == *def) )
1276  def++;
1277  def = GNUNET_strdup (def);
1278  }
1279  }
1280  else
1281  {
1282  start = &orig[1];
1283  def = NULL;
1284  i = 0;
1285  while ( (orig[i] != '/') &&
1286  (orig[i] != '\\') &&
1287  (orig[i] != '\0') &&
1288  (orig[i] != ' ') )
1289  i++;
1290  if (orig[i] == '\0')
1291  {
1292  post = "";
1293  }
1294  else
1295  {
1296  erased_char = orig[i];
1297  erased_pos = &orig[i];
1298  orig[i] = '\0';
1299  post = &orig[i + 1];
1300  }
1301  }
1303  "Split into `%s' and `%s' with default %s\n",
1304  start,
1305  post,
1306  def);
1307  if (GNUNET_OK !=
1309  "PATHS",
1310  start,
1311  &prefix))
1312  {
1313  if (NULL == (env = getenv (start)))
1314  {
1315  /* try default */
1316  def = expand_dollar (cfg, def, depth + 1);
1317  env = def;
1318  }
1319  if (NULL == env)
1320  {
1321  start = GNUNET_strdup (start);
1322  if (erased_pos)
1323  *erased_pos = erased_char;
1325  _("Failed to expand `%s' in `%s' as it is neither found in [PATHS] nor defined as an environmental variable\n"),
1326  start, orig);
1327  GNUNET_free (start);
1328  return orig;
1329  }
1330  prefix = GNUNET_strdup (env);
1331  }
1332  prefix = GNUNET_CONFIGURATION_expand_dollar (cfg, prefix);
1333  if ( (erased_pos) && ('}' != erased_char) )
1334  {
1335  len = strlen (prefix) + 1;
1336  prefix = GNUNET_realloc (prefix, len + 1);
1337  prefix[len - 1] = erased_char;
1338  prefix[len] = '\0';
1339  }
1340  result = GNUNET_malloc (strlen (prefix) + strlen (post) + 1);
1341  strcpy (result, prefix);
1342  strcat (result, post);
1343  GNUNET_free_non_null (def);
1344  GNUNET_free (prefix);
1345  GNUNET_free (orig);
1346  return result;
1347 }
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:78
#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:208
#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 1534 of file configuration.c.

References GNUNET_malloc, and value.

Referenced by GNUNET_CONFIGURATION_append_value_filename(), and GNUNET_CONFIGURATION_remove_value_filename().

1535 {
1536  char *escaped;
1537  const char *rpos;
1538  char *wpos;
1539 
1540  escaped = GNUNET_malloc (strlen (value) * 2 + 1);
1541  memset (escaped, 0, strlen (value) * 2 + 1);
1542  rpos = value;
1543  wpos = escaped;
1544  while (rpos[0] != '\0')
1545  {
1546  switch (rpos[0])
1547  {
1548  case '\\':
1549  case ' ':
1550  wpos[0] = '\\';
1551  wpos[1] = rpos[0];
1552  wpos += 2;
1553  break;
1554  default:
1555  wpos[0] = rpos[0];
1556  wpos++;
1557  }
1558  rpos++;
1559  }
1560  return escaped;
1561 }
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 1572 of file configuration.c.

References GNUNET_OK, and GNUNET_SYSERR.

Referenced by GNUNET_CONFIGURATION_append_value_filename().

1573 {
1574  const char *of = cls;
1575 
1576  return (0 == strcmp (of, fn)) ? GNUNET_SYSERR : GNUNET_OK;
1577 }
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
static char * fn
Filename of the unique file.
#define GNUNET_SYSERR
Definition: gnunet_common.h:79
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 1719 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().

1720 {
1721  struct GNUNET_CONFIGURATION_Handle *cfg = cls;
1722  char * ext;
1723  int ret;
1724 
1725  /* Examine file extension */
1726  ext = strrchr (filename, '.');
1727  if ((NULL == ext) || (0 != strcmp (ext, ".conf")))
1728  {
1730  "Skipping file `%s'\n",
1731  filename);
1732  return GNUNET_OK;
1733  }
1734 
1735  ret = GNUNET_CONFIGURATION_parse (cfg, filename);
1736  return ret;
1737 }
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
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 int ret
Final status code.
Definition: gnunet-arm.c:89
static char * filename
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:104
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: