home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume20 / gperf / part01 / cperf / src / listnode.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-10-18  |  1.8 KB  |  45 lines

  1. /* Data and function members for defining values and operations of a list node.
  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. #ifndef _listnode_h
  23. #define _listnode_h
  24. #include "prototype.h"
  25.  
  26. #define ALPHABET_SIZE 128
  27.  
  28. typedef struct list_node 
  29.   char      *key;               /* Key string. */
  30.   char      *rest;              /* Additional information for building hash function. */
  31.   char      *key_set;           /* Set of characters to hash, specified by user. */
  32.   char      *uniq_set;          /* The unique set of the previous characters. */
  33.   int        length;            /* Length of the key. */
  34.   int        hash_value;        /* Hash value for the key. */
  35.   int        occurrence;        /* A metric for frequency of key set occurrences. */
  36.   int        index;             /* Position of this node relative to other nodes. */
  37.   struct list_node *link;       /* TRUE if key has an identical KEY_SET as another key. */
  38.   struct list_node *next;       /* Points to next element on the list. */  
  39. } LIST_NODE;
  40.  
  41. extern LIST_NODE *make_list_node P ((char *k, int len));
  42.  
  43. #endif _listnode_h
  44.