"Fossies" - the Fresh Open Source Software Archive

Member "fusesmb-0.8.7/configfile.h" (4 May 2006, 1986 Bytes) of package /linux/privat/old/fusesmb-0.8.7.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "configfile.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * The MIT License
    3  *
    4  * Copyright (c) 2006 Vincent Wagelaar
    5  *
    6  * Permission is hereby granted, free of charge, to any person obtaining a
    7  * copy of this software and associated documentation files (the
    8  * "Software"), to deal in the Software without restriction, including
    9  * without limitation the rights to use, copy, modify, merge, publish,
   10  * distribute, sublicense, and/or sell copies of the Software, and to
   11  * permit persons to whom the Software is furnished to do so, subject to
   12  * the following conditions:
   13  *
   14  * The above copyright notice and this permission notice shall be included
   15  * in all copies or substantial portions of the Software.
   16  *
   17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
   18  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   20  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
   21  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
   22  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
   23  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   24  */
   25 
   26 #ifndef CONFIGFILE_H
   27 #define CONFIGFILE_H
   28 #include <sys/param.h>
   29 #include "stringlist.h"
   30 
   31 typedef struct {
   32    stringlist_t *lines;
   33    time_t mtime;
   34    char file[MAXPATHLEN+1];
   35 } config_t;
   36 
   37 int config_init(config_t *cf, const char *file);
   38 void config_free(config_t *cf);
   39 int config_reload_ifneeded(config_t *cf);
   40 int config_has_section(config_t *cf, const char *section);
   41 int config_read_string(config_t *cf, const char *section, const char *key, char **value);
   42 int config_read_int(config_t *cf, const char *section, const char *key, int *value);
   43 int config_read_bool(config_t *cf, const char *section, const char *key, int *value);
   44 int config_read_stringlist(config_t *cf, const char *section, const char *key, stringlist_t **value, char sep);
   45 int config_read_section_keys(config_t *cf, const char *section, stringlist_t **value);
   46 
   47 #endif