Changeset - dcf2a2b217f1
[Not reviewed]
default
0 2 0
Nathan Brink (binki) - 16 years ago 2009-04-07 22:17:55
ohnobinki@ohnopublishing.net
common/options: API improvements
2 files changed with 8 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/common/options.c
Show inline comments
 
@@ -23,7 +23,7 @@
 
#include <string.h>
 
#include <stdio.h>
 

	
 
int options_init(int argc, char *argv[], cfg_t **mycfg, struct options_common **allopts)
 
int options_init(int argc, char *argv[], cfg_t **mycfg, cfg_opt_t *myopts, const char *myname, struct options_common **allopts)
 
{
 
  char *configfile;
 
  
src/common/options.h
Show inline comments
 
@@ -27,15 +27,15 @@
 

	
 
#include <confuse.h>
 

	
 
/*
 
/**
 
  incomplete:
 
  maybe remoteio.h should define its own struct which is injected into this struct and have its own handlers that parse its section of the confuse config file... (it'd be more modular)?
 
 */
 
struct options_common
 
{
 
  char *remoteio_rsh;
 
  char *remoteio_user;
 
  struct remoteio_opts *remoteio;
 
  struct client_opts *client;
 
  struct daemon_opts *daemon;
 
};
 

	
 
/**
 
@@ -44,11 +44,14 @@ struct options_common
 
  Options should be kept alive during the program's life.
 
  
 
  \param mycfg will be set to the section of the configuration file specific to the caller (client or server specific section)
 
  \param myopts holds the caller's confuse option declarations
 
  \param myname holds the name of the section of the config file that refers to mycfg and myopts
 

	
 
  \param allopts will be set to a pointer that many functions need for operation
 
  \param argc the argc that was passed to main()
 
  \param argv the argv that was passed to main()
 
 */
 
int options_init(int argc, char *argv[], cfg_t **mycfg, struct options_common **allopts);
 
int options_init(int argc, char *argv[], cfg_t **mycfg, cfg_opt_t *myopts, const char *myname, struct options_common **allopts);
 

	
 
/**
 
   Frees the struct options_common. This should be run before the program exits.
0 comments (0 inline, 0 general)