home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / MXMS_160.LZH / MAXMAIL.H < prev    next >
C/C++ Source or Header  |  1991-06-23  |  6KB  |  196 lines

  1. /****************************************************************************/
  2. /*                                                                          */
  3. /*    Maxmail.h   : Main include file                                       */
  4. /*                   MaxMail, a message utility for Maximus CBBCS           */
  5. /*                   ARCHIVE current new messages for users download        */
  6. /*                                                                          */
  7. /****************************************************************************/
  8.  
  9. #include <string.h>
  10. #include <stdlib.h>
  11. #include <ctype.h>
  12. #include <stdio.h>
  13. #include <dos.h>
  14. #include <fcntl.h>
  15. #include <errno.h>
  16. #include <malloc.h>
  17. #include <memory.h>
  18. #include <direct.h>
  19. #include <process.h>
  20. #include <io.h>
  21. #include <time.h>
  22. #include <share.h>
  23. #include <sys\types.h>
  24. #include <sys\stat.h>
  25. #include <sys\locking.h>
  26.  
  27.  
  28. #include "compiler.h"
  29. #include "prog.h"
  30. #include "max.h"
  31. #include "swap.h"
  32.  
  33. /* Packer information linked list structure */
  34.  
  35. struct packer_st {
  36.    char   *packname;        /* Sysop defined description string for packer */
  37.    char   *packexe;        /* Actual 12 character filename for packer */
  38.    char   *packstring;    /* Command line for executing packer */
  39.    char   *packpname;    /* 12 char filename for packed file */
  40.    char   *viewstring;    /* COmmand line for viewing packed file */
  41.    struct packer_st *next;
  42. };
  43.  
  44. struct proto_st {
  45.    char   *protoname;    /* Sysop defined description string for protocol */
  46.    char   *protoexe;        /* Actual 12 character filename for portocol */
  47.    char   *protostring;    /* Command line for executing protocol */
  48.    struct proto_st *next;
  49. };
  50.  
  51. struct repupl_st {
  52.    char   *protoname;    /* Sysop defined description string for protocol */
  53.    char   *protoexe;        /* Actual 12 character filename for protocol */
  54.    char   *protostring;    /* Command line for executing protocol */
  55.    struct repupl_st *next;
  56. };
  57.  
  58. struct reparc_st {
  59.    char   *packexe;        /* Actual 12 character filename for protocol */
  60.    char   *packstring;    /* Command line for executing protocol */
  61. };
  62.  
  63. /* Message update linked list structure */
  64. struct msgupd_st {        /* MaxMail uses this to update lastuser file */
  65.    word             areano;
  66.    word             attribute;
  67.    byte             msgpath[80];
  68.    word             msgcount;
  69.    word             startmsg;
  70.    word             himsg;
  71.    word             flags;
  72.    int              update;
  73.    word             readmsgs;
  74.    long             areaindex;
  75.    struct msgupd_st *next;
  76. };
  77.  
  78. /* Special msgupd flags */
  79. #define  AREA_FORCED 0x0001
  80.  
  81. /* Message header structure */
  82. struct msghead {
  83.    byte        from[36];
  84.    byte        ourname[36];
  85.    byte        subject[72];
  86.    word        ourmail;
  87.    int         *answers;
  88. };
  89.  
  90. /* User configuration structure */
  91.  
  92.  
  93. struct user_cfg {
  94.    byte  name[36];      /* Same as in User file */
  95.    byte  rsvd1;         /* 1 if used, 0 if not */
  96.    word  msgarea[64];  /* Bitmap for active user areas, allows for 1000 areas! */
  97.                           /* If bit is set, area should be scanned,
  98.                           1st bit = 1st area, etc */
  99.   time_t lasttime;      /* Unix compat time of last logon */
  100.    word  packcount;    /* How many times we have used this */
  101.    byte  protocol;      /* Default protocol type, if 0 always ask */
  102.                        /* This is 1 based index into proto types in config file */
  103.    byte  packer;          /* Packer type: If 0, no packing */
  104.                        /* This is 1 based index into packer types in config file */
  105.    word  flags;        /* Various user flags */
  106.    word  calls;        /* # of times we have called */
  107.    word  msgfrmt;      /* Message format, 0: Text, 1: QWK */
  108.    word  totareas;      /* Total possible areas */
  109.    word  totprotos;      /* Total possible protocols */
  110.    word  totpackers;      /* Total possible packers */
  111.    byte  dailycount;        /* Times called today */
  112.    word  maxareamsgs;    /* Max # of messages per area to pack */
  113.    word  totselareas;        /* Total # of selected message areas */
  114.    byte  rsvd[27];
  115. };
  116.  
  117.  
  118. /* Global definitions */
  119.  
  120. #define Version 1.60
  121.  
  122. #define HEAP_SIZE 0x2000
  123.  
  124. #define  TEST  1          /* Disconnect some things for test mode */
  125.  
  126. #define  IDLETIME 3        /* # of minutes to allow for idle input */
  127.  
  128.  
  129. /* Log Modes */
  130.  
  131. #define  TERSE       1
  132. #define  VERBOSE     2
  133.  
  134. /* Error codes */
  135. #define  BADALLOC    1
  136. #define  BADEXEC     2
  137. #define  FILEOPEN    3
  138. #define  FILECREATE  4
  139. #define  FILEWRITE   5
  140. #define  DROPCARRIER 6
  141. #define  USERIDLE    7
  142. #define  DEADMODEM   8
  143.  
  144. /* Some default MESSAGE definitions */
  145.  
  146. #define MAXFMSGS  9999        /* Maximum # of Fido messages to scan for */
  147. #define MAXFMSGSIZ  1024 * 15 /* Maximum message size, 20K */
  148. #define SOFT  '\215'
  149. #define SEEN "SEEN-BY:"
  150. #define ESC '\033'
  151.  
  152. /* Message flags */
  153. #define     PRIVATE     0x0002
  154. #define     SCREEN      0x0004
  155. #define     KILL        0x0008
  156. #define     KLUDGE      0x0010
  157. #define     JUNK        0x0020
  158. #define     RANGING     0x1000
  159. #define     HIGH        0x2000
  160. #define     LASTREAD    0x4000
  161.  
  162. /* MaxMail user flags */
  163.  
  164. #define     LASTREAD_UPD   0x0001
  165. #define     USRCFG_UPD     0x0002
  166. #define     USRCFG_FUPD    0x0004
  167. #define     NEWFILES_INC   0x0008
  168. #define     DLHANGUP       0x0010
  169. #define     USRCFG_MSGUPD  0x0012
  170.  
  171. /* Error definitions */
  172. #define NOT_INITIALIZED  -1
  173. #define MEMORY_ALLOC_ERR -2
  174. #define FILE_READ_ERR    -3
  175. #define FILE_SRCH_ERR    -4
  176. #define FILE_OPEN_ERR    -5
  177. #define FILE_WRITE_ERR   -6
  178. #define PVTMSG_ERR       -7
  179. #define FILE_SIZE_ERR    -8
  180.  
  181. /* Text style attribute defines */
  182.  
  183. #define STD_TEXT        0
  184. #define HILITE_TEXT     1
  185. #define MENU_KEY        2
  186. #define TIME_LEFT       3
  187. #define PROMPT_TEXT     4
  188. #define ATTN_TEXT       5
  189. #define VIEW_TEXT       6
  190.  
  191. #define TOTALCOLORS     7
  192.           
  193. #include "globals.h"
  194. #include "protos.h"
  195.  
  196.