Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

dictionary.h

Go to the documentation of this file.
00001 
00002 /*-------------------------------------------------------------------------*/
00014 /*--------------------------------------------------------------------------*/
00015 
00016 /*
00017         $Id: dictionary.h,v 1.11 2002/06/17 09:30:46 ndevilla Exp $
00018         $Author: ndevilla $
00019         $Date: 2002/06/17 09:30:46 $
00020         $Revision: 1.11 $
00021 */
00022 
00023 #ifndef _DICTIONARY_H_
00024 #define _DICTIONARY_H_
00025 
00026 /*---------------------------------------------------------------------------
00027                                                                 Includes
00028  ---------------------------------------------------------------------------*/
00029 
00030 #include <stdio.h>
00031 #include <stdlib.h>
00032 #include <string.h>
00033 #include <unistd.h>
00034 
00035 /*---------------------------------------------------------------------------
00036                                                                 New types
00037  ---------------------------------------------------------------------------*/
00038 
00039 
00040 /*-------------------------------------------------------------------------*/
00049 /*-------------------------------------------------------------------------*/
00050 typedef struct _dictionary_ {
00051         int                             n ;             
00052         int                             size ;  
00053         char            **      val ;   
00054         char            **  key ;       
00055         unsigned         *      hash ;  
00056 } dictionary ;
00057 
00058 
00059 /*---------------------------------------------------------------------------
00060                                                         Function prototypes
00061  ---------------------------------------------------------------------------*/
00062 
00063 /*-------------------------------------------------------------------------*/
00074 /*--------------------------------------------------------------------------*/
00075 unsigned dictionary_hash(char * key);
00076 
00077 /*-------------------------------------------------------------------------*/
00087 /*--------------------------------------------------------------------------*/
00088 dictionary * dictionary_new(int size);
00089 
00090 /*-------------------------------------------------------------------------*/
00098 /*--------------------------------------------------------------------------*/
00099 void dictionary_del(dictionary * vd);
00100 
00101 /*-------------------------------------------------------------------------*/
00114 /*--------------------------------------------------------------------------*/
00115 char * dictionary_get(dictionary * d, char * key, char * def);
00116 
00117 
00118 /*-------------------------------------------------------------------------*/
00129 /*--------------------------------------------------------------------------*/
00130 char dictionary_getchar(dictionary * d, char * key, char def) ;
00131 
00132 /*-------------------------------------------------------------------------*/
00144 /*--------------------------------------------------------------------------*/
00145 int dictionary_getint(dictionary * d, char * key, int def);
00146 
00147 /*-------------------------------------------------------------------------*/
00159 /*--------------------------------------------------------------------------*/
00160 double dictionary_getdouble(dictionary * d, char * key, double def);
00161 
00162 /*-------------------------------------------------------------------------*/
00185 /*--------------------------------------------------------------------------*/
00186 void dictionary_set(dictionary * vd, char * key, char * val);
00187 
00188 /*-------------------------------------------------------------------------*/
00198 /*--------------------------------------------------------------------------*/
00199 void dictionary_unset(dictionary * d, char * key);
00200 
00201 
00202 /*-------------------------------------------------------------------------*/
00213 /*--------------------------------------------------------------------------*/
00214 void dictionary_setint(dictionary * d, char * key, int val);
00215 
00216 /*-------------------------------------------------------------------------*/
00227 /*--------------------------------------------------------------------------*/
00228 void dictionary_setdouble(dictionary * d, char * key, double val);
00229 
00230 /*-------------------------------------------------------------------------*/
00241 /*--------------------------------------------------------------------------*/
00242 void dictionary_dump(dictionary * d, FILE * out);
00243 
00244 #endif
00245 

Generated on Tue Oct 25 10:24:10 2005 for CFCFD by  doxygen 1.4.4