home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume14 / rn-comments / part01 / stb.h < prev   
Encoding:
C/C++ Source or Header  |  1990-09-15  |  871 b   |  34 lines

  1. /* stb.h - declarations for symbol-table package stb.c. */
  2.  
  3. /* By Eamonn McManus <em@dce.ie>.  This file is not copyrighted.
  4.  * $Id: stb.h,v 1.2 90/09/11 23:38:07 em Exp $
  5.  */
  6.  
  7. #ifndef MAXCHAR
  8. # define MAXCHAR 256
  9. #endif
  10.  
  11. typedef struct stb_node {
  12.     struct stb_node *link[2], *parent;
  13.     char *name;
  14.     datum datum;        /* datum must be typedef'd first. */
  15. } stb_node;
  16.  
  17. typedef stb_node *stb[MAXCHAR];
  18.  
  19. #ifndef ARGS
  20. # ifndef __STDC__
  21. #  define ARGS(x) ()
  22. # else
  23. #  define ARGS(x) x
  24. # endif
  25. #endif
  26.  
  27. stb *stb_new_table ARGS((void));
  28. int stb_free_table ARGS((stb *table, int (*datumfree)()));
  29. stb_node *stb_lookup ARGS((stb *table, char *name));
  30. stb_node *stb_insert ARGS((stb *table, char *name, datum *newdatum));
  31. stb_node *stb_first ARGS((stb *table));
  32. stb_node *stb_next ARGS((stb *table, stb_node *node));
  33. int stb_delete ARGS((stb *table, stb_node *node, int (*datumfree)()));
  34.