home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / editors / mutt / me2s_pl7.zoo / mu_edit2 / util / dtable.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-05  |  1.0 KB  |  40 lines

  1. /* $Id: dtable.h,v 1.1 1992/09/06 19:31:32 mike Exp $ */
  2.  
  3. /* $Log: dtable.h,v $
  4.  * Revision 1.1  1992/09/06  19:31:32  mike
  5.  * Initial revision
  6.  *
  7.  */
  8.  
  9. /* dtable.h : dynamic tables header file.
  10.  * See dtable.c for more info.
  11.  * All routines, macros, etc use pointers to dTables.
  12.  *
  13.  * C Durland    Public Domain
  14.  */
  15.  
  16. #ifndef __DTABLE_H_INCLUDED
  17. #define __DTABLE_H_INCLUDED
  18.  
  19. #define declare_dTable_of(blob) struct { DTABLE(blob); }
  20. #define declare_and_init_dTable(name,blob)    \
  21.     struct { DTABLE(blob); } name = initial_dTable_data(name)
  22.  
  23. #define sizeof_dTable(dtable)    (dtable)->num_items
  24. #define reset_dTable(dtable)    sizeof_dTable(dtable) = 0
  25.  
  26.  
  27. #define INIT_dTable(dtable)            \
  28.     initialize_dTable(dtable,dTable_BLOBSIZE(dtable))
  29.  
  30.  
  31.  
  32. #define initial_dTable_data(name) { 0,0, dTable_BLOBSIZE(&name) }
  33.  
  34. #define dTable_BLOBSIZE(dtable) sizeof((dtable)->table[0])
  35.  
  36. #define DTABLE(blob) int num_items, max_items, blob_size; blob *table
  37. typedef struct { DTABLE(char); } dTable;
  38.  
  39. #endif /* __DTABLE_H_INCLUDED */
  40.