Changeset 136 for trunk/wifidog/src/conf.c
- Timestamp:
- 05/28/04 01:16:10 (9 years ago)
- Files:
-
- 1 modified
-
trunk/wifidog/src/conf.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog/src/conf.c
r135 r136 20 20 21 21 /* $Header$ */ 22 /** @internal 23 @file conf.c 22 /** @file conf.c 24 23 @brief Config file parsing 25 24 @author Copyright (C) 2004 Philippe April <papril777@yahoo.com> … … 41 40 #include "auth.h" 42 41 43 s_config config; 42 /** @internal 43 * Holds the current configuration of the gateway */ 44 static s_config config; 45 46 /** @internal 47 * A flag. If set to 1, there are missing or empty mandatory parameters in the config 48 */ 44 49 static int missing_parms; 45 50 51 /** @internal 52 The different configuration options */ 46 53 typedef enum { 47 54 oBadOption, … … 64 71 } OpCodes; 65 72 66 static struct { 73 /** @internal 74 The config file keywords for the different configuration options */ 75 static const struct { 67 76 const char *name; 68 77 OpCodes opcode; … … 90 99 static void config_notnull(void *parm, char *parmname); 91 100 static int parse_boolean_value(char *); 92 static OpCodes config_parse_token(const char *, const char *, int); 93 101 102 /** Accessor for the current gateway configuration 103 @return: A pointer to the current config. The pointer isn't opaque, but should be treated as READ-ONLY 104 */ 105 s_config * 106 config_get_config(void) 107 { 108 return &config; 109 } 110 111 /** Sets the default config parameters and initialises the configuration system */ 94 112 void 95 113 config_init(void) … … 117 135 118 136 /** 119 * @brief Initialize the variables we override with the command line120 *121 137 * If the command-line didn't provide a config, use the default. 122 138 */ … … 127 143 } 128 144 145 /** @internal 146 Parses a single token from the config file 147 */ 129 148 static OpCodes 130 149 config_parse_token(const char *cp, const char *filename, int linenum) … … 141 160 } 142 161 162 /** 163 @param filename Full path of the configuration file to be read 164 */ 143 165 void 144 166 config_read(char *filename) … … 247 269 } 248 270 271 /** @internal 272 Parses a boolean value from the config file 273 */ 249 274 static int 250 275 parse_boolean_value(char *line) … … 266 291 } 267 292 293 /** Verifies if the configuration is complete and valid. Terminates the program if it isn't */ 268 294 void 269 295 config_validate(void) … … 283 309 } 284 310 311 /** @internal 312 Verifies that a required parameter is not a null pointer 313 */ 285 314 static void 286 315 config_notnull(void *parm, char *parmname)
