Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / sources / mbkspice / spi_hash.h
1 /*
2 * This file is part of the Alliance CAD System
3 * Copyright (C) Laboratoire LIP6 - Département ASIM
4 * Universite Pierre et Marie Curie
5 *
6 * Home page : http://www-asim.lip6.fr/alliance/
7 * E-mail support : mailto:alliance-support@asim.lip6.fr
8 *
9 * This library is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Library General Public License as published
11 * by the Free Software Foundation; either version 2 of the License, or (at
12 * your option) any later version.
13 *
14 * Alliance VLSI CAD System is distributed in the hope that it will be
15 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
17 * Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with the GNU C Library; see the file COPYING. If not, write to the Free
21 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24
25 /*******************************************************************************
26 * *
27 * Tool : Spice parser / driver v 7.00 *
28 * Author(s) : Gregoire AVOT *
29 * Updates : March, 18th 1998 *
30 * *
31 *******************************************************************************/
32
33 #ifndef SPI_HASH
34 #define SPI_HASH
35
36 typedef struct shashelem
37 {
38 struct shashelem *suivant;
39 char *mot;
40 void *ptr;
41 } hashelem;
42
43 typedef struct sthash
44 {
45 int entree; /* Nombre d'entrées dans la table de hash 2^n */
46 int nbelem; /* Nombre d'element dans les liste */
47 hashelem **table; /* informations dans la table */
48 hashelem *tete; /* Blocs libre pour allocation par tat */
49 chain_list *libere; /* Pointeurs pour les libérations */
50 } thash;
51
52 thash* creatthash __P(( ));
53 /*
54 Crée une nouvelle table de hash. Le parametre d'entrée est le nombre
55 d'entrees de la nouvelle table
56 */
57
58 void freethash __P(( thash *pt ));
59 /*
60 Libère une table de hash précédement allouée
61 */
62
63 void addthashelem __P(( char *nouveau, void *ptr, thash *table ));
64 /*
65 Ajoute un élément dans la table de hash. Le premier parametre est
66 la chaine identifiant l'élément, le second est l'élément que l'on place dans
67 la table et finalement le troisième est l'élément vers la table de hash
68 */
69
70 void* getthashelem __P(( char *elem, thash *table, int *status ));
71 /*
72 Récupère un élément dans la table de hash à partir de son identificateur
73 passé en premier paramètre. Le second argument est la table de hash sur laquelle
74 la recherche est effectuée. Si le troisième élément est différent de NULL,
75 la valeur 1 est plcée à cette adresse si l'élément est trouvé, 0 sinon. La
76 valeur renvoyée est celle de l'élément recherché.
77 */
78
79 int thashsignature __P(( char *c, int l ));
80 /*
81 Utilisé en interne
82 */
83
84 void resizetable __P(( thash*, int ));
85 hashelem* nouvhashelem __P(( thash* ));
86 void liberehashelem __P(( thash*, hashelem* ));
87 #endif