Changeset - 9a3a072f3fef
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 16 years ago 2009-03-31 17:47:11
ohnobinki@ohnopublishing.net
API of options subsystem
1 file changed with 14 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/common/options.h
Show inline comments
 
@@ -25,6 +25,8 @@
 
#ifndef _DISTREN_OPTIONS_H
 
#define _DISTREN_OPTIONS_H
 

	
 
#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)?
 
@@ -36,4 +38,16 @@ struct options_common
 
  struct remoteio_opts *remoteio;
 
};
 

	
 
/**
 
  This function needs to eat some of your arguments to it, just like gtk+ and other libs like to. It particularly needs to be able to find the location of the config file, which should be taken from arguments if it's there. The argument list will have members that I recognize removed.
 
  
 
  Options should be kept alive during the program's life.
 
  
 
  *mycfg will be set to the section of the configuration file specific to the caller (client or server specific section)
 
  
 
  *allopts will be set to a pointer that many functions need for operation
 
 */
 
int options_init(int argc, char *argv[], cfg_t **mycfg, struct options_common **allopts);
 

	
 
int options_free(struct options_common *allopts);
 
#endif
0 comments (0 inline, 0 general)