home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / msgapi38.zip / INCLUDE / API_SQ.H < prev    next >
C/C++ Source or Header  |  1995-05-03  |  5KB  |  154 lines

  1. /***************************************************************************
  2.  *                                                                         *
  3.  *  MSGAPI Source Code, Version 2.00                                       *
  4.  *  Copyright 1989-1991 by Scott J. Dudley.  All rights reserved.          *
  5.  *                                                                         *
  6.  *  Main Squish-format header file                                         *
  7.  *                                                                         *
  8.  *  For complete details of the licensing restrictions, please refer to    *
  9.  *  the licence agreement, which is published in its entirety in           *
  10.  *  README.1ST.                                                            *
  11.  *                                                                         *
  12.  *  USE OF THIS FILE IS SUBJECT TO THE RESTRICTIONS CONTAINED IN THE       *
  13.  *  MSGAPI LICENSING AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF THIS       *
  14.  *  AGREEMENT IN ANY OF THE AFOREMENTIONED FILES, OR IF YOU DO NOT HAVE    *
  15.  *  THESE FILES, YOU SHOULD IMMEDIATELY CONTACT THE AUTHOR AT ONE OF THE   *
  16.  *  ADDRESSES LISTED BELOW.  IN NO EVENT SHOULD YOU PROCEED TO USE THIS    *
  17.  *  FILE WITHOUT HAVING ACCEPTED THE TERMS OF THE MSGAPI LICENSING         *
  18.  *  AGREEMENT, OR SUCH OTHER AGREEMENT AS YOU ARE ABLE TO REACH WITH THE   *
  19.  *  AUTHOR.                                                                *
  20.  *                                                                         *
  21.  *  You can contact the author at one of the address listed below:         *
  22.  *                                                                         *
  23.  *  Scott Dudley           FidoNet  1:249/106                              *
  24.  *  777 Downing St.        Internet f106.n249.z1.fidonet.org               *
  25.  *  Kingston, Ont.         BBS      (613) 389-8315   HST/14.4k, 24hrs      *
  26.  *  Canada - K7M 5N3                                                       *
  27.  *                                                                         *
  28.  ***************************************************************************/
  29.  
  30. /* $Id: api_sq.h_v 1.0 1991/11/16 16:16:51 sjd Rel sjd $ */
  31.  
  32. #ifndef __API_SQ_H_DEFINED
  33. #define __API_SQ_H_DEFINED
  34.  
  35. struct _sqhdr;
  36. struct _sqidx;
  37.  
  38. typedef struct _sqidx SQIDX;
  39. typedef struct _sqhdr SQHDR;
  40. typedef long FOFS;
  41.  
  42.  
  43. #define NULL_FRAME      ((FOFS)0L)
  44. #define FRAME_normal    0x00
  45. #define FRAME_free      0x01
  46. #define FRAME_rle       0x02  /* not implemented */
  47. #define FRAME_lzw       0x03  /* not implemented */
  48.  
  49. #define EVERYTHING      0xffffu
  50.  
  51. #define SFB_LEN         2048
  52. #define IFB_LEN         1024
  53.  
  54. #define EXTRA_BUF       16
  55.  
  56. struct _sqhdr
  57. {
  58.  
  59.   #define SQHDRID       0xafae4453UL
  60.  
  61.   dword id;             /* sqhdr.id must always equal SQHDRID */
  62.  
  63.   FOFS next_frame;
  64.   FOFS prev_frame;
  65.  
  66.   dword frame_length;
  67.   dword msg_length;
  68.   dword clen;
  69.  
  70.   word frame_type;
  71.   word rsvd;
  72. };
  73.  
  74.  
  75.  
  76. struct _msgh
  77. {
  78.   MSG *sq;
  79.   dword id;  /* Must always equal MSGH_ID */
  80.  
  81.   dword bytes_written;
  82.   dword cur_pos;
  83.  
  84.   /* For SQUISH only! */
  85.  
  86.   dword cur_len;
  87.   dword clen;
  88.   dword msgnum;
  89.   dword totlen;
  90.  
  91.   SQHDR *hdr;
  92.  
  93.   FOFS seek_frame;
  94.  
  95.   word mode;
  96. };
  97.  
  98.  
  99.  
  100.  
  101.  
  102. struct _sqidx
  103. {
  104.   FOFS ofs;
  105. /*  dword attr;*/
  106.   UMSGID umsgid;
  107.   dword hash;
  108. /*  byte to[20];*/
  109. };
  110.  
  111.  
  112. /* Used for buffering index writes within API_SQ.C */
  113. struct _bufidx
  114. {
  115.   struct _sqidx ix;
  116.   dword idx_ofs;
  117. };
  118.  
  119.  
  120. struct _sqbase
  121. {
  122.   word len;               /* LENGTH OF THIS STRUCTURE! */           /*   0 */
  123.   word rsvd1;             /* reserved */                            /*   2 */
  124.  
  125.   dword num_msg;          /* Number of messages in area */          /*   4 */
  126.   dword high_msg;         /* Highest msg in area. Same as num_msg*/ /*   8 */
  127.   dword skip_msg;         /* Skip killing first x msgs in area */   /*  12 */
  128.   dword high_water;       /* Msg# (not umsgid) of HWM */            /*  16 */
  129.  
  130.   dword uid;              /* Number of the next UMSGID to use */    /*  20 */
  131.  
  132.   byte base[80];          /* Base name of SquishFile */             /*  24 */
  133.  
  134.   FOFS begin_frame;       /* Offset of first frame in file */       /* 104 */
  135.   FOFS last_frame;        /* Offset to last frame in file */        /* 108 */
  136.   FOFS free_frame;        /* Offset of first FREE frame in file */  /* 112 */
  137.   FOFS last_free_frame;   /* Offset of last free frame in file */   /* 116 */
  138.   FOFS end_frame;         /* Pointer to end of file */              /* 120 */
  139.  
  140.   dword max_msg;          /* Max # of msgs to keep in area */       /* 124 */
  141.   word keep_days;         /* Max age of msgs in area (SQPack) */    /* 128 */
  142.   word sz_sqhdr;          /* sizeof(SQHDR) */                       /* 130 */
  143.   byte rsvd2[124];        /* Reserved by Squish for future use*/    /* 132 */
  144.  
  145.                                                              /* total: 256 */
  146. };
  147.  
  148. #define SF_STATIC 0x0001  /* Perform static (not dynamic) renumbering */
  149.  
  150. #include "api_sqd.h"
  151.  
  152. #endif /* __API_SQ_H_DEFINED */
  153.  
  154.