home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / language / perl / Source / H / Hash < prev    next >
Encoding:
Text File  |  1990-11-06  |  2.3 KB  |  77 lines

  1. /* $Header: hash.h,v 3.0.1.2 90/10/15 17:33:58 lwall Locked $
  2.  *
  3.  *    Copyright (c) 1989, Larry Wall
  4.  *
  5.  *    You may distribute under the terms of the GNU General Public License
  6.  *    as specified in the README file that comes with the perl 3.0 kit.
  7.  *
  8.  * $Log:    hash.h,v $
  9.  * Revision 3.0.1.2  90/10/15  17:33:58  lwall
  10.  * patch29: the debugger now understands packages and evals
  11.  * 
  12.  * Revision 3.0.1.1  90/08/09  03:51:34  lwall
  13.  * patch19: various MSDOS and OS/2 patches folded in
  14.  * 
  15.  * Revision 3.0  89/10/18  15:18:39  lwall
  16.  * 3.0 baseline
  17.  * 
  18.  */
  19.  
  20. #define FILLPCT 80        /* don't make greater than 99 */
  21. #define DBM_CACHE_MAX 63    /* cache 64 entries for dbm file */
  22.                 /* (resident array acts as a write-thru cache)*/
  23.  
  24. #define COEFFSIZE (16 * 8)    /* size of coeff array */
  25.   
  26. typedef struct hentry HENT;
  27.  
  28. struct hentry {
  29.     HENT    *hent_next;
  30.     char    *hent_key;
  31.     STR        *hent_val;
  32.     int        hent_hash;
  33.     int        hent_klen;
  34. };
  35.  
  36. struct htbl {
  37.     HENT    **tbl_array;
  38.     int        tbl_max;    /* subscript of last element of tbl_array */
  39.     int        tbl_dosplit;    /* how full to get before splitting */
  40.     int        tbl_fill;    /* how full tbl_array currently is */
  41.     int        tbl_riter;    /* current root of iterator */
  42.     HENT    *tbl_eiter;    /* current entry of iterator */
  43.     SPAT     *tbl_spatroot;    /* list of spats for this package */
  44.     char    *tbl_name;    /* name, if a symbol table */
  45. #ifdef SOME_DBM
  46. #ifdef GDBM
  47.     DBM        *tbl_dbm;
  48. #else
  49. #ifdef NDBM
  50.     DBM        *tbl_dbm;
  51. #else
  52.     int        tbl_dbm;
  53. #endif
  54. #endif
  55. #endif
  56.     unsigned char tbl_coeffsize;    /* is 0 for symbol tables */
  57. };
  58.  
  59. extern STR *hfetch PROTO((HASH *, char *, unsigned int, int));
  60. extern bool hstore PROTO((HASH *, char *, unsigned int, STR *, int));
  61. extern STR *hdelete PROTO((HASH *, char *, unsigned int));
  62. extern HASH *hnew PROTO((unsigned int));
  63. extern void hclear PROTO((HASH *, int));
  64. extern void hentfree PROTO((HENT *));
  65. extern int hiterinit PROTO((HASH *));
  66. extern HENT *hiternext PROTO((HASH *));
  67. extern char *hiterkey PROTO((HENT *, int *));
  68. extern STR *hiterval PROTO((HASH *, HENT *));
  69. extern bool hdbmopen PROTO((HASH *, char *, int));
  70. extern void hdbmclose PROTO((HASH *));
  71. extern bool hdbmstore PROTO((HASH *, char *, unsigned int, STR *));
  72. extern void hsplit PROTO((HASH *));
  73. extern void hfree PROTO((HASH *, int));
  74. extern void hentdelayfree PROTO((HENT *));
  75.  
  76.  
  77.