Changeset - 4186f3b04f1c
[Not reviewed]
default
0 2 0
Nathan Brink (binki) - 16 years ago 2009-06-29 22:34:43
ohnobinki@ohnopublishing.net
attempted to make the config's include function global
2 files changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/client/libdistren_config.c
Show inline comments
 
@@ -31,13 +31,12 @@ int _distren_getoptions(distren_t handle
 
{
 
  cfg_t *cfg;
 

	
 
  cfg_opt_t cfg_opts[] =
 
    {
 
      CFG_STR("server", NULL, 0),
 
      CFG_FUNC("include", &cfg_include), /*< @todo this should be added by the lidistrencommon.so rather then individually */
 
      CFG_END()
 
    };
 
  
 
  if(options_init(0, NULL, &cfg, cfg_opts, "client", &handle->options))
 
    {
 
      fprintf(stderr, "error getting configuration\n");
src/common/options.c
Show inline comments
 
@@ -74,36 +74,38 @@ int options_init(int argc, char *argv[],
 
  
 
  /* Conf File Parser */
 
  cfg_opt_t common_opts[] =
 
    {
 
      CFG_END()
 
    };
 

	
 
  
 
  /*
 
    In these arrays, I should replace NULL with a pointer to a string in the struct which should hold the result of confuse processing an option. This is partially because confuse will not free the values it parses.
 
   */
 
  cfg_opt_t server_opts[] = 
 
    {
 
      CFG_STR("username", NULL, CFGF_NONE),
 
      CFG_STR("hostname", NULL, CFGF_NONE),
 
      CFG_STR("method", "ssh", CFGF_NONE),
 
      CFG_STR_LIST("types", NULL, CFGF_NONE),
 
      CFG_END()
 
    };
 
  
 

	
 
  cfg_opt_t opts[] =
 
    {
 
      CFG_SEC("common",
 
	      common_opts,
 
	      CFGF_NONE),
 
      CFG_SEC("server",
 
	      server_opts,
 
	      CFGF_MULTI | CFGF_TITLE),
 
      CFG_SEC(myname,
 
	      myopts,
 
	      0),
 
      CFG_FUNC("include",
 
	       &cfg_include),
 
      CFG_END()
 
    };
 

	
 

	
 

	
 
  (*allopts)->data->cfg = cfg_init(opts, 0);
0 comments (0 inline, 0 general)