home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / source / util2src / bmtbl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-12  |  3.1 KB  |  74 lines

  1. /*============================================================================*
  2.  * bmtbl.h - Definitions used by bmtbl utility.
  3.  *
  4.  * (C)Copyright IBM Corporation, 1991.  All rights reserved. Brian Yoder
  5.  *
  6.  * The table is defined by the TROW structure.  This structure contains
  7.  * a linked list of COL structures, one COL structure for each column
  8.  * in the table.  Once bmtbl has determined how many columns there are,
  9.  * the order and number of COL structures never changes.
  10.  *
  11.  * While processing a row, a number of CELL structures are added to each
  12.  * COL structure to define the text lines for that cell (a cell is a
  13.  * specific row and column within the table).  Before a row is processed,
  14.  * the CELL structures for the previous row are deleted (cleared).
  15.  *
  16.  * 09/11/91 - Created.
  17.  * 09/11/91 - Initial version (OS/2).
  18.  *============================================================================*/
  19.  
  20. #ifndef _h_BMTBL /* else we've already been included */
  21. #define _h_BMTBL
  22.  
  23. #define  MAX_LINE  1024             /* Maximum input text file line width */
  24.  
  25. /*----------------------------------------------------------------------------*
  26.  * Structure that defines a line of text for a cell (specific row and column)
  27.  * in a table.  The CELL structures are linked together to a COL structure
  28.  * to define all of the lines of text for that particular cell in the table.
  29.  *----------------------------------------------------------------------------*/
  30.  
  31. typedef struct _cell {
  32.  
  33.      char      *text;               /* Pointer to line of text */
  34.      uint       textlen;            /* Length of the line of text */
  35.  
  36.      struct _cell *next;            /* Pointer to next CELL for this cell */
  37.  
  38. } CELL;
  39.  
  40. /*----------------------------------------------------------------------------*
  41.  * Structure that defines each column of the table
  42.  *----------------------------------------------------------------------------*/
  43.  
  44. typedef struct _col {
  45.  
  46.      uint       start;              /* Starting offset of column (0=1st) */
  47.      uint       width;              /* Width of column, in spaces */
  48.  
  49.      CELL      *first;              /* Pointer to first text line's CELL */
  50.      CELL      *last;               /* Pointer to last text line's CELL */
  51.  
  52.      struct _col *next;             /* Pointer to COL for next column */
  53.  
  54. } COL;
  55.  
  56. /*----------------------------------------------------------------------------*
  57.  * Structure that defines a row in the table.  It contains a linked list of
  58.  * COL structures: one for each column in the table.  Each COL structure
  59.  * contains a linked list of CELL structures: one for each line of text for
  60.  * that cell (column, row).
  61.  *----------------------------------------------------------------------------*/
  62.  
  63. typedef struct {
  64.  
  65.      COL       *first;              /* Pointer to first text line's CELL */
  66.      COL       *last;               /* Pointer to last text line's CELL */
  67.  
  68.      uint       cols;               /* No. of columns in the table */
  69.      uint       twidth;             /* Total width of all columns in the table */
  70.  
  71. } TROW;
  72.  
  73. #endif /* _h_BMTBL */
  74.