~ubuntu-branches/ubuntu/karmic/luatex/karmic

« back to all changes in this revision

Viewing changes to src/texk/kpathsea/hash.h

  • Committer: Bazaar Package Importer
  • Author(s): Fabrice Coutadeur
  • Date: 2009-05-29 04:44:18 UTC
  • mfrom: (1.1.6 upstream) (4.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20090529044418-b4d230tscam6pgt3
Tags: 0.40.2-1ubuntu1
* Merge with Debian (LP: #381539). No changes remaining.
* debian/patches/ubuntu_libpoppler-0.11: fix a FTBFS because of unuseful
  call to GfxFont destructor (virtual and protected).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* hash.h: declarations for a hash table.
2
 
 
3
 
   Copyright 1999, 2005 Olaf Weber.
4
 
   Copyright 1994, 95 Karl Berry.
5
 
 
6
 
   This library is free software; you can redistribute it and/or
7
 
   modify it under the terms of the GNU Lesser General Public
8
 
   License as published by the Free Software Foundation; either
9
 
   version 2.1 of the License, or (at your option) any later version.
10
 
 
11
 
   This library is distributed in the hope that it will be useful,
12
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 
   Lesser General Public License for more details.
15
 
 
16
 
   You should have received a copy of the GNU Lesser General Public
17
 
   License along with this library; if not, write to the Free Software
18
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 
 
20
 
*/
21
 
 
22
 
#ifndef HASH_H
23
 
#define HASH_H
24
 
 
25
 
#include <kpathsea/c-proto.h>
26
 
#include <kpathsea/types.h>
27
 
 
28
 
 
29
 
/* A single (key,value) pair.  */
30
 
typedef struct hash_element_struct
31
 
{
32
 
  const_string key;
33
 
  const_string value;
34
 
  struct hash_element_struct *next;
35
 
} hash_element_type;
36
 
 
37
 
/* The usual arrangement of buckets initialized to null.  */
38
 
typedef struct
39
 
{
40
 
  hash_element_type **buckets;
41
 
  unsigned size;
42
 
} hash_table_type;
43
 
 
44
 
#ifdef KPSE_DEBUG
45
 
/* How to print the hash results when debugging.  */
46
 
extern KPSEDLL boolean kpse_debug_hash_lookup_int;
47
 
#endif
48
 
 
49
 
/* Create a hash table of size SIZE.  */
50
 
extern KPSEDLL hash_table_type hash_create P1H(unsigned size);
51
 
 
52
 
/* Insert the (KEY,VALUE) association into TABLE.  KEY may have more
53
 
   than one VALUE.  Neither KEY nor VALUE is copied.  */
54
 
extern KPSEDLL void hash_insert P3H(hash_table_type *table,
55
 
                                    const_string key,
56
 
                                    const_string value);
57
 
 
58
 
/* Insert the (KEY, VALUE) association into TABLE.  KEY may have more
59
 
   than one VALUE.  Neither KEY nor VALUE is copied.  Assume that KEY
60
 
   is already normalized (all lowercase) on platforms where this matters. */
61
 
extern KPSEDLL void hash_insert_normalized P3H(hash_table_type *table,
62
 
                                               const_string key,
63
 
                                               const_string value);
64
 
 
65
 
/* Remove the (KEY,VALUE) association from TABLE.  */
66
 
extern KPSEDLL void hash_remove P3H(hash_table_type *table,  const_string key,
67
 
                                    const_string value);
68
 
 
69
 
/* Look up KEY in MAP, and return NULL-terminated list of all matching
70
 
   values (not copies), in insertion order.  If none, return NULL.  */
71
 
extern KPSEDLL string *hash_lookup P2H(hash_table_type table, const_string key);
72
 
 
73
 
/* Print TABLE to stderr.  */
74
 
extern void hash_print P2H(hash_table_type table, boolean summary_only);
75
 
 
76
 
#endif /* not HASH_H */