Main Page | Data Structures | Directories | File List | Data Fields | Globals

cupl.h

Go to the documentation of this file.
00001 /*
00002  *  Copyright (C) 2006  Baris Simsek, http://www.enderunix.org/simsek
00003  *
00004  *  This library is free software; you can redistribute it and/or
00005  *  modify it under the terms of the GNU Lesser General Public
00006  *  License as published by the Free Software Foundation; either
00007  *  version 2.1 of the License, or (at your option) any later version.
00008  *
00009  *  This library is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  *  Lesser General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU Lesser General Public
00015  *  License along with this library; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00017  *
00018  *  $Id: cupl_8h-source.html,v 1.4 2006/08/26 09:35:02 simsek Exp $
00019  *
00020  *  CUPL library header file.
00021  *
00022  */
00023 
00024 #ifndef CUPL_CUPL_H
00025 #define CUPL_CUPL_H
00026 
00027 #define CUPL_VERSION "0.8"
00028 #define CFG_VAR_LEN 32
00029 #define CFG_VAL_LEN 512
00030 
00031 typedef struct cfg_array {
00032     char var[CFG_VAR_LEN]; /* Variable */
00033     char val[CFG_VAL_LEN]; /* Value */
00034     struct cfg_array *next; /* Next variable */
00035 } cfg_array;
00036 
00037 typedef struct cfg_data {
00038     int nov;  /* Number of variable parsed */
00039     FILE *cfd;  /* Config file descriptor */
00040     cfg_array *vars;  /* Parsed variables */
00041 } cfg_data;
00042 
00043 /* Library functions */
00044 extern void cupl_print_info();
00045 
00046 /* Common Config Parser */
00047 extern cfg_data *cupl_init_cfg(char *path);
00048 extern char *cupl_get_var(char *var, cfg_data *cfg);
00049 extern int cupl_release_cfg(cfg_data *cfg);
00050 extern void cupl_print_items(cfg_data *cfg);
00051 
00052 /* Data structures */
00053 extern unsigned int cupl_hash_get(char *buf, unsigned int len, int tbl_size);
00054 
00055 /* String processing */
00056 extern int cupl_match_regex(char *buffer, char *pattern);
00057 
00058 #endif
00059 
00060 

Generated on Sat Aug 26 12:34:54 2006 for CUPL (Common UNIX Programming Library) by  doxygen 1.3.9.1