home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / sqdev200.zip / features / msgtrack.h < prev    next >
C/C++ Source or Header  |  1994-05-23  |  5KB  |  132 lines

  1. #ifndef __TYPEDEFS_H_DEFINED
  2. #define __TYPEDEFS_H_DEFINED
  3.  
  4. /* Handle the special defines for 32-bit flat model compilers */
  5.  
  6. #if defined(__386__) || defined(__FLAT__)
  7.   typedef unsigned      bit;
  8.  
  9.   typedef unsigned char byte;
  10.   typedef signed char   sbyte;
  11.  
  12.   typedef unsigned short word;
  13.   typedef signed short   sword;
  14.  
  15.   typedef unsigned int  dword;
  16.   typedef signed int    sdword;
  17.  
  18.   typedef unsigned short ushort;
  19.   typedef   signed short sshort;
  20.  
  21.   typedef unsigned long  ulong;
  22.   typedef   signed long  slong;
  23. #else
  24.   typedef unsigned      bit;
  25.  
  26.   typedef unsigned char byte;
  27.   typedef signed char   sbyte;
  28.  
  29.   typedef unsigned short word;
  30.   typedef signed short  sword;
  31.  
  32.   typedef unsigned long dword;
  33.   typedef signed long   sdword;
  34.  
  35.   typedef unsigned short ushort;
  36.   typedef   signed short sshort;
  37.  
  38.   typedef unsigned long  ulong;
  39.   typedef   signed long  slong;
  40. #endif
  41.  
  42. #endif
  43.  
  44.  
  45.  
  46. /*--------------------------------------------------------------------------*/
  47. /* nodex.ndx                                                                */
  48. /*                                                                          */
  49. /* Version 7 Nodelist Index structure.  This is a 512-byte record, which    */
  50. /* is defined by three structures:  Record 0 is the Control Record, then    */
  51. /* some number of Leaf Node (LNode) Records, then the Index Node (INode)    */
  52. /* Records.  This defines an unbalanced binary tree.                        */
  53. /*                                                                          */
  54. /* This description is based on Scott Samet's CBTREE.PAS program.           */
  55. /*                                                                          */
  56. /*--------------------------------------------------------------------------*/
  57.  
  58. struct _ndx {
  59.     union
  60.     {
  61.         struct _CtlBlk {
  62.             word    CtlBlkSize; /* Blocksize of Index Blocks   */
  63.             sdword  CtlRoot;    /* Block number of Root        */
  64.             sdword  CtlHiBlk;   /* Block number of last block  */
  65.             sdword  CtlLoLeaf;  /* Block number of first leaf  */
  66.             sdword  CtlHiLeaf;  /* Block number of last leaf   */
  67.             sdword  CtlFree;    /* Head of freelist            */
  68.             sdword  CtlLvls;    /* Number of index levels      */
  69.             word    CtlParity;  /* XOR of above fields         */
  70.         } CtlBlk;
  71.  
  72.         struct _INodeBlk {
  73.             sdword  IndxFirst;  /* Pointer to next lower level */
  74.             sdword  IndxBLink;  /* Pointer to previous link    */
  75.             sdword  IndxFLink;  /* Pointer to next link        */
  76.             sword   IndxCnt;    /* Count of Items in block     */
  77.             word    IndxStr;    /* Offset in block of 1st str  */
  78.             /* If IndxFirst is NOT -1, this is INode:          */
  79.             struct _IndxRef {
  80.                 word   IndxOfs; /* Offset of string into block */
  81.                 word   IndxLen; /* Length of string            */
  82.                 sdword IndxData;/* Record number of string     */
  83.                 sdword IndxPtr; /* Block number of lower index */
  84.             } IndxRef[20];
  85.         } INodeBlk;
  86.  
  87.         struct _LNodeBlk {
  88.                                 /* IndxFirst is -1 in LNodes   */
  89.             sdword  IndxFirst;  /* Pointer to next lower level */
  90.             sdword  IndxBLink;  /* Pointer to previous link    */
  91.             sdword  IndxFLink;  /* Pointer to next link        */
  92.             sword   IndxCnt;    /* Count of Items in block     */
  93.             word    IndxStr;    /* Offset in block of 1st str  */
  94.             struct _LeafRef {
  95.                 word   KeyOfs;  /* Offset of string into block */
  96.                 word   KeyLen;  /* Length of string            */
  97.                 sdword KeyVal;  /* Pointer to data block       */
  98.             } LeafRef[30];
  99.         } LNodeBlk;
  100.  
  101.         char RawNdx[512];
  102.  
  103.     } ndx;
  104. };
  105.  
  106. /*--------------------------------------------------------------------------*/
  107. /*                                                                          */
  108. /* OPUS 1.20 Version 7 Nodelist structure. Copyright 1991 Wynn Wagner III   */
  109. /* and Doug Boone. Used by permission.                                      */
  110. /*                                                                          */
  111. /*--------------------------------------------------------------------------*/
  112.  
  113. struct _vers7 {
  114.         sword  Zone;
  115.         sword  Net;
  116.         sword  Node;
  117.         sword  HubNode;        /* If node is a point, this is point number. */
  118.         word CallCost;         /* phone company's charge */
  119.         word MsgFee;           /* Amount charged to user for a message */
  120.         word NodeFlags;        /* set of flags (see below) */
  121.         byte ModemType;        /* RESERVED for modem type */
  122.         byte Phone_len;
  123.         byte Password_len;
  124.         byte Bname_len;
  125.         byte Sname_len;
  126.         byte Cname_len;
  127.         byte pack_len;
  128.         byte BaudRate;         /* baud rate divided by 300 */
  129. };
  130.  
  131.  
  132.