1 /* This may look like C code, but it is really -*- C++ -*- */
3 /* Simple lookup table abstraction implemented as an Iteration Number Array.
5 Copyright (C) 1989-1998 Free Software Foundation, Inc.
6 written by Douglas C. Schmidt (schmidt@ics.uci.edu)
8 This file is part of GNU GPERF.
10 GNU GPERF is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 1, or (at your option)
15 GNU GPERF is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with GNU GPERF; see the file COPYING. If not, write to the Free
22 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
24 /* Define and implement a simple boolean array abstraction,
25 uses an Iteration Numbering implementation to save on initialization time. */
28 #define bool_array_h 1
33 /* If we are on a memory diet then we'll only make these use a limited
34 amount of storage space. */
35 typedef unsigned short STORAGE_TYPE;
37 typedef unsigned int STORAGE_TYPE;
43 static STORAGE_TYPE *storage_array; /* Initialization of the index space. */
44 static STORAGE_TYPE iteration_number; /* Keep track of the current iteration. */
45 static unsigned int size; /* Keep track of array size. */
50 static void init (STORAGE_TYPE *buffer, unsigned int s);
51 static int find (int hash_value);
52 static void reset (void);
55 #ifdef __OPTIMIZE__ /* efficiency hack! */
61 #include "bool-array.icc"