home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / MAXMAILP.ZIP / MAXMAIL.H < prev    next >
C/C++ Source or Header  |  1990-12-24  |  5KB  |  161 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 <time.h>
  21. #include <share.h>
  22. #include <sys\locking.h>
  23.  
  24. #include "compiler.h"
  25. #include "prog.h"
  26. #include "max.h"
  27. #include "foslib.h"
  28. #include "swap.h"
  29.  
  30. /* Packer information linked list structure */
  31.  
  32. struct packer_st {
  33.    char   *packname;        /* Sysop defined description string for packer */
  34.    char   *packexe;        /* Actual 12 character filename for packer */
  35.    char   *packstring;    /* Command line for executing packer */
  36.    char   *packpname;    /* 12 char filename for packed file */
  37.    char   *viewstring;    /* COmmand line for viewing packed file */
  38.    struct packer_st *next;
  39. };
  40.  
  41. struct proto_st {
  42.    char   *protoname;    /* Sysop defined description string for protocol */
  43.    char   *protoexe;        /* Actual 12 character filename for portocol */
  44.    char   *protostring;    /* Command line for executing protocol */
  45.    struct proto_st *next;
  46. };
  47.  
  48.  
  49. /* Message update linked list structure */
  50. struct msgupd_st {        /* Maximus uses this to update lastuser file */
  51.    word             areano;
  52.    byte             msgpath[80];
  53.    word             msgcount;
  54.    word             startmsg;
  55.    word             himsg;
  56.    int              update;
  57.    word             readmsgs;
  58.    long             areaindex;
  59.    struct msgupd_st *next;
  60. };
  61.  
  62. /* Message header structure */
  63. struct msghead {
  64.    byte        from[36];
  65.    byte        ourname[36];
  66.    byte        subject[72];
  67.    word        ourmail;
  68.    int         *answers;
  69. };
  70.  
  71. /* User configuration structure */
  72.  
  73.  
  74. struct user_cfg {
  75.    byte  name[36];      /* Same as in User file */
  76.    byte  isused;          /* 1 if used, 0 if not */
  77.    word  msgarea1[64]; /* Bitmap for active user areas, allows for 1000 areas! */
  78.                           /* If bit is set, area should be scanned,
  79.                           1st bit = area 1, etc */
  80.    char  cfgname1[13]; /* User defined name for configuration */
  81.                        /* User must have some 12 character name for this
  82.                           set, he can recall it later, If name is NULL
  83.                           force a reconfiguration */
  84.    word  msgarea2[64]; /* Alternate bitmap for active user areas */
  85.    char  cfgname2[13]; /* User defined name for configuration */
  86.    byte  lastpack[19]; /* ASCII date of last time we used this */
  87.   time_t lasttime;      /* Unix compat time of last logon */
  88.    word  packcount;    /* How many times we have used this */
  89.    byte  protocol;      /* Default protocol type, if 0 always ask */
  90.                        /* This is index into proto types in config file */
  91.    byte  packer;          /* Packer type: If 0, no packing */
  92.                        /* This is index into packer types in config file */
  93.    word  flags;        /* Various user flags */
  94.    word  calls;        /* # of times we have called */
  95.    word  msgfrmt;      /* Message format, 0: Text, 1: QWK */
  96.    word  totareas;      /* Total possible areas */
  97.    word  resvd[29];       /* Reserved for future */
  98. };
  99.  
  100.  
  101. /* Global definitions */
  102.  
  103. #define Version 1.00
  104.  
  105. #define HEAP_SIZE 0x2000
  106.  
  107. #define  TEST  1          /* Disconnect some things for test mode */
  108.  
  109. #define  IDLETIME 3        /* # of minutes to allow for idle input */
  110.  
  111.  
  112. /* Log Modes */
  113.  
  114. #define  TERSE       1
  115. #define  VERBOSE     2
  116.  
  117. /* Error codes */
  118. #define  BADALLOC    1
  119. #define  BADEXEC     2
  120. #define  FILEOPEN    3
  121. #define  FILECREATE  4
  122. #define  FILEWRITE   5
  123. #define  DROPCARRIER 6
  124. #define  USERIDLE    7
  125.  
  126. /* Some default MESSAGE definitions */
  127.  
  128. #define MAXFMSGS  999        /* Maximum # of Fido messages to scan for */
  129. #define MAXFMSGSIZ  1024 * 32         /* Maximum message size, 32K */
  130. #define SOFT  '\215'
  131. #define SEEN "SEEN-BY:"
  132. #define ESC '\033'
  133.  
  134. /* Message flags */
  135. #define     PRIVATE     0x0002
  136. #define     SCREEN      0x0004
  137. #define     KILL        0x0008
  138. #define     KLUDGE      0x0010
  139. #define     JUNK        0x0020
  140. #define     RANGING     0x1000
  141. #define     HIGH        0x2000
  142. #define     LASTREAD    0x4000
  143.  
  144. #define     LASTREAD_UPD 0x0001
  145. #define     USRCFG_UPD   0x0002
  146. #define     USRCFG_FUPD  0x0004
  147.  
  148. /* Error definitions */
  149. #define NOT_INITIALIZED  -1
  150. #define MEMORY_ALLOC_ERR -2
  151. #define FILE_READ_ERR    -3
  152. #define FILE_SRCH_ERR    -4
  153. #define FILE_OPEN_ERR    -5
  154. #define FILE_WRITE_ERR   -6
  155. #define PVTMSG_ERR       -7
  156.  
  157.  
  158.  
  159. #include "globals.h"
  160. #include "protos.h"
  161.