diff options
| author | biouman <biouman> | 2001-04-27 04:12:25 +0000 | 
|---|---|---|
| committer | biouman <biouman> | 2001-04-27 04:12:25 +0000 | 
| commit | 4db12b8121c0b32df8b8671045013c857beb191f (patch) | |
| tree | 15489f56132610576bd5cd860d38d8b759f64482 /hash.h | |
Diffstat (limited to 'hash.h')
| -rw-r--r-- | hash.h | 45 | 
1 files changed, 45 insertions, 0 deletions
| @@ -0,0 +1,45 @@ +#ifndef __HASH_H__ +#define __HASH_H__ + +#define TAILLECHAINEHACHAGE (26*2+1) + +#ifdef HAVE_CONFIG_H +typedef void *_TypeVariable; +#else +typedef int _TypeVariable; +#endif + +typedef struct { +	char *NomVar; +	_TypeVariable Variable; +} _Element; + +typedef struct _LstChn { +	_Element Elem; +	struct _LstChn *Suivant; +} *_ListeChaine; + +typedef _ListeChaine *_TableauVariable; + +/*	Initialise une table de hachage */ +int Initialise(_TableauVariable * t); + +/*	Crée un élement à insérer dans la table de hachage */ +_Element CreerElement(char *Nom, _TypeVariable Var); + +/*	Insert un element(Nom de la variable,variable) dans une table de hachage +	la fonction renvoit 0 en cas d'erreur */ +char InsererVarDansTab(_TableauVariable * t, _Element e); + +/*	Renvoie la variable de la table de hachage qui porte le nom Nom +	si la variable n'existe pas trouve est égal à 0 */ +_TypeVariable NomVarToVar(char *Nom, _TableauVariable t, char *trouve); + +/*      Supprime la variable de nom Nom +	la fonction renvoit 0 en cas d'erreur */ +char SupprimerDansTab(_TableauVariable * t, char *Nom); + +/*	Detruit le tableau */ +void DetruitTab(_TableauVariable * t); + +#endif | 
