home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / cperf-2.1 / src / boolarray.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-11  |  1.7 KB  |  49 lines

  1. /* Simple lookup table abstraction implemented as a Guilmette Array.
  2.  
  3.    Copyright (C) 1989 Free Software Foundation, Inc.
  4.    written by Douglas C. Schmidt (schmidt@ics.uci.edu)
  5.  
  6. This file is part of GNU GPERF.
  7.  
  8. GNU GPERF is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 1, or (at your option)
  11. any later version.
  12.  
  13. GNU GPERF is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. GNU General Public License for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with GNU GPERF; see the file COPYING.  If not, write to
  20. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  21.  
  22. /* Define and implement a simple boolean array abstraction,
  23.    uses a Guilmette array implementation to save on initialization time. */ 
  24.  
  25. #ifndef _boolarray_h
  26. #define _boolarray_h
  27. #include "prototype.h"
  28.  
  29. #ifdef LO_CAL
  30. /* If we are on a memory diet then we'll only make these use a limited
  31.    amount of storage space. */
  32. typedef unsigned short STORAGE_TYPE;
  33. #else
  34. typedef int STORAGE_TYPE;
  35. #endif
  36. typedef struct bool_array 
  37. {
  38.   STORAGE_TYPE *storage_array;    /* Initialization of the index space. */
  39.   STORAGE_TYPE  iteration_number; /* Keep track of the current iteration. */
  40.   int  size;                      /* Size of the entire array (dynamically initialized). */
  41. } BOOL_ARRAY;
  42.  
  43. extern void bool_array_init P ((int size));
  44. extern void bool_array_destroy P ((void));
  45. extern bool lookup P ((int hash_value));
  46. extern void bool_array_reset P ((void));
  47.  
  48. #endif /* _boolarray_h */
  49.