home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume20 / gperf / part01 / cperf / src / boolarray.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-10-18  |  1.5 KB  |  42 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. typedef struct bool_array 
  30. {
  31.   int *storage_array;           /* Initialization of the index space. */
  32.   int  iteration_number;        /* Keep track of the current iteration. */
  33.   int  size;                    /* Size of the entire array (dynamically initialized). */
  34. } BOOL_ARRAY;
  35.  
  36. extern void bool_array_init P ((int size));
  37. extern void bool_array_destroy P ((void));
  38. extern bool lookup P ((int hash_value));
  39. extern void bool_array_reset P ((void));
  40.  
  41. #endif /* _boolarray_h */
  42.