Show
Ignore:
Timestamp:
05/28/04 01:16:10 (9 years ago)
Author:
benoitg
Message:

2004-05-27 Benoit Gr�goire <bock@…>

  • Massive Doxygen update in all files. IMPORTANT: The new convention is: @brief in the .h, long description and parameters in the .c
  • Cleaned up some more issues in my notes taken at the formal review
  • client_list.c,h: Make client_list_free_node() private, define and document client_list_mutex here
  • config.c: Start the hunt for evil globals: Get rid of the config global
  • doc/doxygen.cfg.in: Enable generation of internal doc, a few other tweaks
  • Documentation now generates a TODO list and DEPRECATED list, please look at them
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog/src/conf.c

    r135 r136  
    2020 
    2121/* $Header$ */ 
    22 /** @internal 
    23   @file conf.c 
     22/** @file conf.c 
    2423  @brief Config file parsing 
    2524  @author Copyright (C) 2004 Philippe April <papril777@yahoo.com> 
     
    4140#include "auth.h" 
    4241 
    43 s_config config; 
     42/** @internal 
     43 * Holds the current configuration of the gateway */ 
     44static s_config config; 
     45 
     46/** @internal 
     47 * A flag.  If set to 1, there are missing or empty mandatory parameters in the config 
     48 */ 
    4449static int missing_parms; 
    4550 
     51/** @internal 
     52 The different configuration options */ 
    4653typedef enum { 
    4754        oBadOption, 
     
    6471} OpCodes; 
    6572 
    66 static struct { 
     73/** @internal 
     74 The config file keywords for the different configuration options */ 
     75static const struct { 
    6776        const char *name; 
    6877        OpCodes opcode; 
     
    9099static void config_notnull(void *parm, char *parmname); 
    91100static 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 */ 
     105s_config * 
     106config_get_config(void) 
     107{ 
     108    return &config; 
     109} 
     110 
     111/** Sets the default config parameters and initialises the configuration system */ 
    94112void 
    95113config_init(void) 
     
    117135 
    118136/** 
    119  * @brief Initialize the variables we override with the command line 
    120  * 
    121137 * If the command-line didn't provide a config, use the default. 
    122138 */ 
     
    127143} 
    128144 
     145/** @internal 
     146Parses a single token from the config file 
     147*/ 
    129148static OpCodes 
    130149config_parse_token(const char *cp, const char *filename, int linenum) 
     
    141160} 
    142161 
     162/** 
     163@param filename Full path of the configuration file to be read  
     164*/ 
    143165void 
    144166config_read(char *filename) 
     
    247269} 
    248270 
     271/** @internal 
     272Parses a boolean value from the config file 
     273*/ 
    249274static int 
    250275parse_boolean_value(char *line) 
     
    266291} 
    267292 
     293/** Verifies if the configuration is complete and valid.  Terminates the program if it isn't */ 
    268294void 
    269295config_validate(void) 
     
    283309} 
    284310 
     311/** @internal 
     312    Verifies that a required parameter is not a null pointer 
     313*/ 
    285314static void 
    286315config_notnull(void *parm, char *parmname)