home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / lora299s.zip / JAM.H < prev    next >
C/C++ Source or Header  |  1993-07-01  |  7KB  |  195 lines

  1. /*
  2. **  JAM(mbp) - The Joaquim-Andrew-Mats Message Base Proposal
  3. **
  4. **  C API
  5. **
  6. **  Written by Joaquim Homrighausen.
  7. **
  8. **  ----------------------------------------------------------------------
  9. **
  10. **  jam.h (JAMmb)
  11. **
  12. **  Prototypes and definitions for the JAM message base format
  13. **
  14. **  Copyright 1993 Joaquim Homrighausen, Andrew Milner, Mats Birch, and
  15. **  Mats Wallin. ALL RIGHTS RESERVED.
  16. **
  17. **  93-06-28    JoHo
  18. **  Initial coding.
  19. */
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23.  
  24. #ifndef __JAM_H__
  25. #define __JAM_H__
  26.  
  27. #ifndef __JAMSYS_H__
  28. #include "jamsys.h"
  29. #endif
  30.  
  31. /*
  32. **  File extensions
  33. */
  34. #define EXT_HDRFILE     ".jhr"
  35. #define EXT_TXTFILE     ".jdt"
  36. #define EXT_IDXFILE     ".jdx"
  37. #define EXT_LRDFILE     ".jlr"
  38.  
  39. /*
  40. **  Revision level and header signature
  41. */
  42. #define CURRENTREVLEV   1
  43. #define HEADERSIGNATURE "JAM"
  44.  
  45. /*
  46. **  Header file information block, stored first in all .JHR files
  47. */
  48. typedef struct
  49.     {
  50.     CHAR8   Signature[4];              /* <J><A><M> followed by <NUL> */
  51.     UINT32  DateCreated;               /* Creation date */
  52.     UINT32  ModCounter;                /* Last processed counter */
  53.     UINT32  ActiveMsgs;                /* Number of active (not deleted) msgs */
  54.     UINT32  PasswordCRC;               /* CRC-32 of password to access */
  55.     UINT32  BaseMsgNum;                /* Lowest message number in index file */
  56.     CHAR8   RSRVD[1000];               /* Reserved space */
  57.     }
  58.     JAMHDRINFO, _JAMDATA * JAMHDRINFOptr;
  59.  
  60. /*
  61. **  Message status bits
  62. */
  63. #define MSG_LOCAL       0x00000001L    /* Msg created locally */
  64. #define MSG_INTRANSIT   0x00000002L    /* Msg is in-transit */
  65. #define MSG_PRIVATE     0x00000004L    /* Private */
  66. #define MSG_READ        0x00000008L    /* Read by addressee */
  67. #define MSG_SENT        0x00000010L    /* Sent to remote */
  68. #define MSG_KILLSENT    0x00000020L    /* Kill when sent */
  69. #define MSG_ARCHIVESENT 0x00000040L    /* Archive when sent */
  70. #define MSG_HOLD        0x00000080L    /* Hold for pick-up */
  71. #define MSG_CRASH       0x00000100L    /* Crash */
  72. #define MSG_IMMEDIATE   0x00000200L    /* Send Msg now, ignore restrictions */
  73. #define MSG_DIRECT      0x00000400L    /* Send directly to destination */
  74. #define MSG_GATE        0x00000800L    /* Send via gateway */
  75. #define MSG_FILEREQUEST 0x00001000L    /* File request */
  76. #define MSG_FILEATTACH  0x00002000L    /* File(s) attached to Msg */
  77. #define MSG_TRUNCFILE   0x00004000L    /* Truncate file(s) when sent */
  78. #define MSG_KILLFILE    0x00008000L    /* Delete file(s) when sent */
  79. #define MSG_RECEIPTREQ  0x00010000L    /* Return receipt requested */
  80. #define MSG_CONFIRMREQ  0x00020000L    /* Confirmation receipt requested */
  81. #define MSG_ORPHAN      0x00040000L    /* Unknown destination */
  82. #define MSG_ENCRYPT     0x00080000L    /* Msg text is encrypted */
  83. #define MSG_COMPRESS    0x00100000L    /* Msg text is compressed */
  84. #define MSG_ESCAPED     0x00200000L    /* Msg text is seven bit ASCII */
  85. #define MSG_FPU         0x00400000L    /* Force pickup */
  86. #define MSG_TYPELOCAL   0x00800000L    /* Msg is for local use only (not for export) */
  87. #define MSG_TYPEECHO    0x01000000L    /* Msg is for conference distribution */
  88. #define MSG_TYPENET     0x02000000L    /* Msg is direct network mail */
  89. #define MSG_NODISP      0x20000000L    /* Msg may not be displayed to user */
  90. #define MSG_LOCKED      0x40000000L    /* Msg is locked, no editing possible */
  91. #define MSG_DELETED     0x80000000L    /* Msg is deleted */
  92.  
  93. /*
  94. **  Message header
  95. */
  96. typedef struct
  97.     {
  98.     CHAR8   Signature[4];              /* <J><A><M> followed by <NUL> */
  99.     UINT16  Revision;                  /* CURRENTREVLEV */
  100.     UINT16  ReservedWord;              /* Reserved */
  101.     UINT32  SubfieldLen;               /* Length of subfields */
  102.     UINT32  TimesRead;                 /* Number of times message read */
  103.     UINT32  MsgIdCRC;                  /* CRC-32 of MSGID line */
  104.     UINT32  ReplyCRC;                  /* CRC-32 of REPLY line */
  105.     UINT32  ReplyTo;                   /* This msg is a reply to.. */
  106.     UINT32  Reply1st;                  /* First reply to this msg */
  107.     UINT32  ReplyNext;                 /* Next msg in reply chain */
  108.     UINT32  DateWritten;               /* When msg was written */
  109.     UINT32  DateReceived;              /* When msg was received/read */
  110.     UINT32  DateProcessed;             /* When msg was processed by packer */
  111.     UINT32  MsgNum;                    /* Message number (1-based) */
  112.     UINT32  Attribute;                 /* Msg attribute, see "Status bits" */
  113.     UINT32  Attribute2;                /* Reserved for future use */
  114.     UINT32  TxtOffset;                 /* Offset of text in text file */
  115.     UINT32  TxtLen;                    /* Length of message text */
  116.     UINT32  PasswordCRC;               /* CRC-32 of password to access msg */
  117.     UINT32  Cost;                      /* Cost of message */
  118.     }
  119.     JAMHDR, _JAMDATA * JAMHDRptr;
  120.  
  121. /*
  122. **  Message header subfield types
  123. */
  124. #define JAMSFLD_OADDRESS    0
  125. #define JAMSFLD_DADDRESS    1
  126. #define JAMSFLD_SENDERNAME  2
  127. #define JAMSFLD_RECVRNAME   3
  128. #define JAMSFLD_MSGID       4
  129. #define JAMSFLD_REPLYID     5
  130. #define JAMSFLD_SUBJECT     6
  131. #define JAMSFLD_PID         7
  132. #define JAMSFLD_TRACE       8
  133. #define JAMSFLD_ENCLFILE    9
  134. #define JAMSFLD_ENCLFWALIAS 10
  135. #define JAMSFLD_ENCLFREQ    11
  136. #define JAMSFLD_ENCLFILEWC  12
  137. #define JAMSFLD_ENCLINDFILE 13
  138. #define JAMSFLD_EMBINDAT    1000
  139. #define JAMSFLD_FTSKLUDGE   2000
  140. #define JAMSFLD_SEENBY2D    2001
  141. #define JAMSFLD_PATH2D      2002
  142. #define JAMSFLD_FLAGS       2003
  143. #define JAMSFLD_TZUTCINFO   2004
  144. #define JAMSFLD_UNKNOWN     0xffff
  145.  
  146. /*
  147. **  Message header subfield
  148. */
  149. typedef struct
  150.     {
  151.     UINT16  LoID;                      /* Field ID, 0 - 0xffff */
  152.     UINT16  HiID;                      /* Reserved for future use */
  153.     UINT32  DatLen;                    /* Length of buffer that follows */
  154.     CHAR8   Buffer[1];                 /* DatLen bytes of data */
  155.     }
  156.     JAMSUBFIELD, _JAMDATA * JAMSUBFIELDptr;
  157.  
  158. typedef struct
  159.     {
  160.     UINT16  LoID;                      /* Field ID, 0 - 0xffff */
  161.     UINT16  HiID;                      /* Reserved for future use */
  162.     UINT32  DatLen;                    /* Length of buffer that follows */
  163.     }
  164.     JAMBINSUBFIELD, _JAMDATA * JAMBINSUBFIELDptr;
  165.  
  166. /*
  167. **  Message index record
  168. */
  169. typedef struct
  170.     {
  171.     UINT32  UserCRC;                   /* CRC-32 of destination username */
  172.     UINT32  HdrOffset;                 /* Offset of header in .JHR file */
  173.     }
  174.     JAMIDXREC, _JAMDATA * JAMIDXRECptr;
  175.  
  176. /*
  177. **  Lastread structure, one per user
  178. */
  179. typedef struct
  180.     {
  181.     UINT32  UserCRC;                   /* CRC-32 of user name (lowercase) */
  182.     UINT32  UserID;                    /* Unique UserID */
  183.     UINT32  LastReadMsg;               /* Last read message number */
  184.     UINT32  HighReadMsg;               /* Highest read message number */
  185.     }
  186.     JAMLREAD, _JAMDATA * JAMLREADptr;
  187.  
  188. #endif /* __JAM_H__ */
  189.  
  190. #ifdef __cplusplus
  191. }
  192. #endif
  193.  
  194. /* end of file "jam.h" */
  195.