Logo Search packages:      
Sourcecode: likewise-open version File versions

dictionary.h File Reference

Detailed Description

Implements a dictionary for string variables.

N. Devillard
Aug 2000
This module implements a simple dictionary object, i.e. a list of string/string associations. This object is useful to store e.g. informations retrieved from a configuration file (ini files).

Definition in file dictionary.h.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

Go to the source code of this file.


struct  _dictionary_
 Dictionary object. More...


typedef struct _dictionary_ dictionary
 Dictionary object.


void dictionary_del (dictionary *vd)
 Delete a dictionary object.
void dictionary_dump (dictionary *d, FILE *out)
 Dump a dictionary to an opened file pointer.
char * dictionary_get (dictionary *d, char *key, char *def)
 Get a value from a dictionary.
char dictionary_getchar (dictionary *d, char *key, char def)
 Get a value from a dictionary, as a char.
double dictionary_getdouble (dictionary *d, char *key, double def)
 Get a value from a dictionary, as a double.
int dictionary_getint (dictionary *d, char *key, int def)
 Get a value from a dictionary, as an int.
unsigned dictionary_hash (char *key)
 Compute the hash key for a string.
dictionarydictionary_new (int size)
 Create a new dictionary object.
void dictionary_set (dictionary *vd, char *key, char *val)
 Set a value in a dictionary.
void dictionary_setdouble (dictionary *d, char *key, double val)
 Set a key in a dictionary, providing a double.
void dictionary_setint (dictionary *d, char *key, int val)
 Set a key in a dictionary, providing an int.
void dictionary_unset (dictionary *d, char *key)
 Delete a key in a dictionary.

Generated by  Doxygen 1.6.0   Back to index