Main Page | Class List | File List | Class Members | File Members | Related Pages

conf.h

Go to the documentation of this file.
00001 /* 00002 * $Id: conf.h,v 1.17 2003/10/31 13:14:23 jasta Exp $ 00003 * 00004 * Copyright (C) 2001-2003 giFT project (gift.sourceforge.net) 00005 * 00006 * This program is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU General Public License as published by the 00008 * Free Software Foundation; either version 2, or (at your option) any 00009 * later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, but 00012 * WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * General Public License for more details. 00015 */ 00016 00017 #ifndef __CONF_H 00018 #define __CONF_H 00019 00020 /*****************************************************************************/ 00021 00032 /*****************************************************************************/ 00033 00037 typedef struct 00038 { 00039 char *name; 00040 Dataset *keys; 00041 } ConfigHeader; 00042 00047 typedef struct 00048 { 00049 char *path; 00050 FILE *file; 00051 time_t mtime; 00054 int comments; 00055 List *headers; 00056 ConfigHeader *confhdr; 00057 } Config; 00058 00059 /*****************************************************************************/ 00060 00061 EXTERN_C_BEGIN 00062 00063 /*****************************************************************************/ 00064 00072 LIBGIFT_EXPORT 00073 Config *config_new (char *file); 00074 00084 LIBGIFT_EXPORT 00085 Config *config_new_ex (char *file, int comments_allowed); 00086 00092 LIBGIFT_EXPORT 00093 void config_free (Config *conf); 00094 00101 LIBGIFT_EXPORT 00102 void config_write (Config *conf); 00103 00111 LIBGIFT_EXPORT 00112 void config_set_str (Config *conf, char *keypath, char *value); 00113 00119 LIBGIFT_EXPORT 00120 void config_set_int (Config *conf, char *keypath, int value); 00121 00140 LIBGIFT_EXPORT 00141 char *config_get_str (Config *conf, char *keypath); 00142 00148 LIBGIFT_EXPORT 00149 int config_get_int (Config *conf, char *keypath); 00150 00151 /*****************************************************************************/ 00152 00163 LIBGIFT_EXPORT 00164 Config *gift_config_new (char *module); 00165 00180 LIBGIFT_EXPORT 00181 char *gift_conf_path (const char *fmt, ...); 00182 00188 LIBGIFT_EXPORT 00189 char *gift_conf_path_r (char *buf, size_t buf_size, const char *fmt, ...); 00190 00207 LIBGIFT_EXPORT 00208 char *gift_conf_pathkey (Config *conf, char *key, char *def, char *file); 00209 00210 /*****************************************************************************/ 00211 00212 EXTERN_C_END 00213 00214 /*****************************************************************************/ 00215 00216 #endif /* __CONF_H */

Generated on Sun Aug 22 08:07:10 2004 by doxygen 1.3.7