home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / BBS / MISC / XSRC_117.ZIP / MSG.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-10  |  42.0 KB  |  1,012 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*                                                                          */
  3. /*   XBBS SOURCE CODE copyright (c) 1990 by M. Kimes                        */
  4. /*   All Rights Reserved                                                    */
  5. /*                                                                          */
  6. /*    For complete details of the licensing restrictions, please refer      */
  7. /*    to the License agreement, which is published in its entirety in       */
  8. /*    the in the file LICENSE.XBS.                                          */
  9. /*                                                                          */
  10. /*    USE OF THIS FILE IS SUBJECT TO THE RESTRICTIONS CONTAINED IN THE      */
  11. /*    XBBS LICENSING  AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF            */
  12. /*    THIS AGREEMENT IN ANY OF THE AFOREMENTIONED FILES, OR IF YOU DO       */
  13. /*    NOT HAVE THESE FILES, YOU SHOULD IMMEDIATELY CONTACT M. KIMES         */
  14. /*    AT THE ADDRESS LISTED BELOW.  IN NO EVENT SHOULD YOU PROCEED TO USE   */
  15. /*    THIS FILE WITHOUT HAVING ACCEPTED THE TERMS OF THE XBBS LICENSING     */
  16. /*    AGREEMENT, OR SUCH OTHER AGREEMENT AS YOU ARE ABLE TO REACH WITH      */
  17. /*    M. KIMES                                                              */
  18. /*                                                                          */
  19. /*                                                                          */
  20. /* You can contact M. Kimes at the following address:                       */
  21. /*                                                                          */
  22. /* M. Kimes                         1:380/16.0@FidoNet                      */
  23. /* 542 Merrick                      (318)222-3455 data                      */
  24. /* Shreveport, LA  71104                                                    */
  25. /*                                                                          */
  26. /*                                                                          */
  27. /* Please feel free to contact me at any time to share your comments about  */
  28. /* my software and/or licensing policies.                                   */
  29. /*                                                                          */
  30. /*--------------------------------------------------------------------------*/
  31. /* MSG.H file -- Header info, structures, etc.  Big mess. */
  32.  
  33. #include "mem.h"
  34. #include "setjmp.h"
  35. #include "errno.h"
  36. #include "io.h"
  37. #include "fcntl.h"
  38. #include "dos.h"
  39. #include "dir.h"
  40. #include "stdio.h"
  41. #include "string.h"
  42. #include "stdlib.h"
  43. #include "ctype.h"
  44. #include "time.h"
  45. #include "stddef.h"
  46. #include "process.h"
  47. #include "share.h"
  48. #include "alloc.h"
  49. #include "stdarg.h"
  50. #include "conio.h"
  51. #include "limits.h"
  52.  
  53. #if __STDC__
  54. #define _Cdecl
  55. #else
  56. #define _Cdecl  cdecl
  57. #endif
  58.  
  59. unsigned int   cdecl  BitOff(char *a,unsigned int x);
  60. unsigned int   cdecl  BitOn(char *a,unsigned int x);
  61. unsigned int   cdecl  IsBit(char *a,unsigned int x);
  62.  
  63. #define BitOff(a,x)           ((void)((a)[(x)/CHAR_BIT] &= ~(1 << ((x) % \
  64. CHAR_BIT))))
  65. #define BitOn(a,x)            ((void)((a)[(x)/CHAR_BIT] |= (1 << ((x) % \
  66. CHAR_BIT))))
  67. #define IsBit(a,x)            ((a)[(x)/CHAR_BIT] & (1 << ((x) % CHAR_BIT)))
  68.  
  69. #define begin        {
  70. #define end          }
  71.  
  72. #define true         0
  73. #define false        -1
  74.  
  75. #define shl          <<
  76. #define shr          >>
  77. #define xor          ^
  78. #define and          &&
  79. #define or           ||
  80. #define not          !
  81. #define mod          %
  82. #define BACKSPACE    "\b \b"
  83.  
  84. typedef unsigned       bit;
  85. typedef unsigned int  word;
  86. typedef unsigned char byte;
  87. typedef unsigned long ulong;
  88.  
  89. #include "dos.h"
  90. #include "errno.h"
  91.  
  92. #define MY_CREATE         1024
  93. #define MY_TRUNC        512
  94. #define MY_READ            0
  95. #define MY_WRITE        1
  96. #define MY_RDWR            2
  97. #define MY_DENYALL        64
  98. #define MY_NOINHERIT    128
  99. #define MY_DENYWRITE    32
  100. #define MY_DENYREAD        (32+64)
  101. #define MY_DENYNONE        16
  102.  
  103. #define S_IFMT      0170000         /* file type mask */
  104. #define S_IFDIR     0040000         /* directory */
  105. #define S_IFCHR     0020000         /* character special */
  106. #define S_IFREG     0100000         /* regular */
  107. #define S_IREAD     0000400         /* read permission, owner */
  108. #define S_IWRITE    0000200         /* write permission, owner */
  109. #define S_IEXEC     0000100         /* execute/search permission, owner */
  110.  
  111.   struct bitword {
  112.     bit        bit1:    1;
  113.     bit        bit2:    1;
  114.     bit        bit3:    1;
  115.     bit        bit4:    1;
  116.     bit        bit5:    1;
  117.     bit        bit6:   1;
  118.     bit        bit7:   1;
  119.     bit        bit8:   1;
  120.     bit        bit9:   1;
  121.     bit        bit10:  1;
  122.     bit        bit11:  1;
  123.     bit        bit12:  1;
  124.     bit        bit13:  1;
  125.     bit        bit14:  1;
  126.     bit        bit15:  1;
  127.     bit        bit16:  1;
  128.   };
  129.  
  130.   union flag_word {
  131.     word    x;
  132.     struct  bitword    b;
  133.   };
  134.  
  135.  
  136. /*-------------------------------------------------------------------------*/
  137. /*                                                                         */
  138. /* MESSAGES.............                                                   */
  139. /*                                                                         */
  140. /*-------------------------------------------------------------------------*/
  141.  
  142.  
  143. /*-------------------------------------------------------------------------*/
  144. /* FIDO Message header                                                     */
  145. /*-------------------------------------------------------------------------*/
  146. struct _msg {
  147.       char from[36];
  148.       char to[36];
  149.       char subj[72];
  150.       char date[20];
  151.       word times;          /* FIDO<tm>: Number of times read               */
  152.       word dest;           /* Destination node                             */
  153.       word orig;           /* Origination node number                      */
  154.       word cost;           /* Unit cost charged to send the message        */
  155.       word orig_net;       /* Origination network number                   */
  156.       word dest_net;       /* Destination network number                   */
  157.       int  msg_filler[4];
  158.       word reply;          /* Current msg is a reply to this msg number    */
  159.       word attr;           /* Attribute (behavior) of the message          */
  160.       word up;             /* Next message in the thread                   */
  161. };
  162.  
  163.  
  164.  
  165. /*-------------------------------------------------------------------------*/
  166. /* FIDO Message attributes  (attr)                                         */
  167. /*-------------------------------------------------------------------------*/
  168. #define MSGPRIVATE 0x0001  /* private message,          0000 0000 0000 0001*/
  169. #define MSGCRASH   0x0002  /* accept for forwarding     0000 0000 0000 0010*/
  170. #define MSGREAD    0x0004  /* read by addressee         0000 0000 0000 0100*/
  171. #define MSGSENT    0x0008  /* sent OK (remote)          0000 0000 0000 1000*/
  172. #define MSGFILE    0x0010  /* file attached to msg      0000 0000 0001 0000*/
  173. #define MSGFWD     0x0020  /* being forwarded           0000 0000 0010 0000*/
  174. #define MSGORPHAN  0x0040  /* unknown dest node         0000 0000 0100 0000*/
  175. #define MSGKILL    0x0080  /* kill after mailing        0000 0000 1000 0000*/
  176. #define MSGLOCAL   0x0100  /* FidoNet vs. local         0000 0001 0000 0000*/
  177. #define MSGXX1     0x0200  /*                           0000 0010 0000 0000*/
  178. #define MSGXX2     0x0400  /* STRIPPED by FidoNet<tm>   0000 0100 0000 0000*/
  179. #define MSGFRQ     0x0800  /* file request              0000 1000 0000 0000*/
  180. #define MSGRRQ     0x1000  /* receipt requested         0001 0000 0000 0000*/
  181. #define MSGCPT     0x2000  /* is a return receipt       0010 0000 0000 0000*/
  182. #define MSGARQ     0x4000  /* audit trail requested     0100 0000 0000 0000*/
  183. #define MSGURQ     0x8000  /* update request            1000 0000 0000 0000*/
  184.  
  185.  
  186.  
  187. /*-------------------------------------------------------------------------*/
  188. /* XBBS Message header                                                     */
  189. /*-------------------------------------------------------------------------*/
  190. struct _xmsg {
  191.       char from[36];
  192.       char to[36];
  193.       char subj[64];
  194.       word o_point;
  195.       word length;         /* Length of message */
  196.      ulong start;          /* Starting postition in text file              */
  197.       char date[20];
  198.       word times;          /* Number of times read                         */
  199.       word dest;           /* Destination node                             */
  200.       word orig;           /* Origination node number                      */
  201.       word cost;           /* Unit cost charged to send the message        */
  202.       word orig_net;       /* Origination network number                   */
  203.       word dest_net;       /* Destination network number                   */
  204.       char indate[4];      /* import date  (YMD(null))                     */
  205.       word m_attr;         /* Extra attributes                             */
  206.       word d_zone;         /* Destination zone                             */
  207.       word o_zone;         /* Origination zone                             */
  208.       word attr;           /* Attribute (behavior) of the message          */
  209.       word d_point;
  210. };
  211.  
  212.  
  213. /* These apply to m_attr */
  214.  
  215. #define MSGDELETED 0x0001  /* deleted message,          0000 0000 0000 0001*/
  216. #define MSGANON    0x0002  /* anonymous message         0000 0000 0000 0010*/
  217. #define MSGECHO    0x0004  /* unmoved echo message      0000 0000 0000 0100*/
  218. #define MSGNET     0x0008  /* unmoved net message       0000 0000 0000 1000*/
  219. #define MSGHOLD    0x0010  /* file attached to msg      0000 0000 0001 0000*/
  220. #define MSGHOST    0x0020  /* being forwarded           0000 0000 0010 0000*/
  221. #define MSGSCANNED 0x0040  /* already scanned           0000 0000 0100 0000*/
  222. #define MSGKEEP    0x0080  /* don't delete              0000 0000 1000 0000*/
  223. #define MSGTREATED 0x0100  /* soft cr's & lf's removed  0000 0001 0000 0000*/
  224. #define MSGPACKED  0x0200  /* message LZSS compressed   0000 0010 0000 0000*/
  225. /*#define    0x0400  /*  0000 0100 0000 0000*/
  226. /*#define    0x0800  /*  0000 1000 0000 0000*/
  227. /*#define    0x1000  /*  0001 0000 0000 0000*/
  228. /*#define    0x2000  /*  0010 0000 0000 0000*/
  229. /*#define    0x4000  /*  0100 0000 0000 0000*/
  230. #define MSGTAGGED  0x8000  /* used by offline readers   1000 0000 0000 0000*/
  231.  
  232.  
  233. /*-------------------------------------------------------------------------*/
  234. /* User record structure                                                   */
  235. /*-------------------------------------------------------------------------*/
  236.  
  237.   struct _user {
  238.       char           name[36];
  239.       char           handle[36];
  240.       struct date    birthdate;
  241.       char           password[12];
  242.       char           city[24];
  243.       char           state[3];
  244.       char           zip[6];
  245.       char           phone1[11];
  246.       char           phone2[11];
  247.       bit length:     7;
  248.       bit cold:      1;
  249.       char              width;
  250.         bit graphics: 1;
  251.         bit fullscreen: 1;
  252.         bit scrnclr: 1;
  253.         bit commodore: 1;
  254.         bit expert: 1;
  255.         bit more: 1;
  256.         bit ignorehrs: 1;
  257.         bit ignorerat: 1;
  258.         bit nokill: 1;
  259.         bit deleted: 1;
  260.         bit arq: 1;
  261.         bit twit: 1;
  262.         bit ansimenus: 1;
  263.         bit gen1: 1;
  264.         bit gen2: 1;
  265.         bit gen3: 1;
  266.       word           attr2;
  267.       word           stat[10];
  268.       unsigned long  upk;
  269.       unsigned long  downk;
  270.       word           upno;
  271.       word           downno;
  272.       word           posts;
  273.       int            credit;
  274.       char           violations;
  275.       struct date    lastdate;
  276.       struct time    lasttime;
  277.       struct date    logondate;
  278.       struct time    logontime;
  279.       unsigned long  times;
  280.       word           callsperday;
  281.       word           timepercall;
  282.       word           totaltime;
  283.       word           callstoday;
  284.       word           timetoday;
  285.       char           variable[5][76]; /* Strings vars saved w/ user record */
  286.       word           numvars[10];     /* Numeric vars saved w/ user record */
  287.       char           comptype;        /* # designating user's computer type */
  288.       word           uktoday;
  289.       word           dktoday;
  290.        bit            hiok: 1;        /* Hi ASCII (>127) OK */
  291.        bit            lastmsgarea: 10;
  292.        bit            reserved: 5;
  293.       word            pointid;        /* If he's a mailerless point */
  294.       unsigned long  id;
  295.       char           node;
  296.   };
  297.  
  298.  
  299.  
  300. /*-------------------------------------------------------------------------*/
  301. /* User attributes                                                         */
  302. /*-------------------------------------------------------------------------*/
  303. #define GRAPHICS   0x0001  /* ANSI                      0000 0000 0000 0001*/
  304. #define FULLSCREEN 0x0002  /* full screen editor        0000 0000 0000 0010*/
  305. #define SCRNCLR    0x0004  /* screen clearing?          0000 0000 0000 0100*/
  306. #define COMMODORE  0x0008  /* GP Special flag           0000 0000 0000 1000*/
  307. #define EXPERT     0x0010  /* help level                0000 0000 0001 0000*/
  308. #define MORE       0x0020  /* More? pause               0000 0000 0010 0000*/
  309. #define IGNOREHRS  0x0040  /* Ignore u/d hours          0000 0000 0100 0000*/
  310. #define IGNORERAT  0x0080  /* Ignore ratio enforcement  0000 0000 1000 0000*/
  311. #define NOKILL     0x0100  /* Don't kill user           0000 0001 0000 0000*/
  312. #define DELETED    0x0200  /* User is deleted           0000 0010 0000 0000*/
  313. #define ARQ        0x0400  /* Reliable connect          0000 0100 0000 0000*/
  314. #define TWIT       0x0800  /* Twit or whatever          0000 1000 0000 0000*/
  315. #define ANSIMENUS  0x1000  /* Use ANSI Menus?           0001 0000 0000 0000*/
  316. #define GEN1       0x2000  /* No use by system          0010 0000 0000 0000*/
  317. #define GEN2       0x4000  /* No use by system          0100 0000 0000 0000*/
  318. #define GEN3       0x8000  /* No use by system          1000 0000 0000 0000*/
  319.  
  320.  
  321. /* struct _mboard mboard;  Default message board setup
  322.    struct _fboard fboard;  Default file board setup                      */
  323.  
  324. /*-------------------------------------------------------------------------*/
  325. /* Message area record                                                     */
  326. /*-------------------------------------------------------------------------*/
  327.  
  328. struct _mboard {
  329.   char       name[48];
  330.   char       forceto[36];
  331.   word       attr;
  332.   word       max;
  333.   word       number;
  334.   word       substat1;
  335.   word       substat2;
  336.   signed char age;
  337.   word       flags;
  338.   word       minwrite;
  339. };
  340.  
  341. /*-------------------------------------------------------------------------*/
  342. /* MBoard attributes                                                       */
  343. /*-------------------------------------------------------------------------*/
  344. #define NOORIG     0x0001  /* No * Origin or Tear     0000 0000 0000 0001 */
  345. #define ANSI       0x0002  /* ANSI                    0000 0000 0000 0010 */
  346. #define PRIVATE    0x0004  /* Obvious                 0000 0000 0000 0100 */
  347. #define PUBLIC     0x0008  /*   "                     0000 0000 0000 1000 */
  348. #define ECHO       0x0010  /*   "                     0000 0000 0001 0000 */
  349. #define NET        0x0020  /*   "                     0000 0000 0010 0000 */
  350. #define MCI        0x0040  /*   "                     0000 0000 0100 0000 */
  351. #define READONLY   0x0080  /*   "                     0000 0000 1000 0000 */
  352. #define ALTERNATE  0x0100  /*   "                     0000 0001 0000 0000 */
  353. #define ALTECHO    0x0200  /*   "                     0000 0010 0000 0000 */
  354. #define ANON       0x0400  /*   "                     0000 0100 0000 0000 */
  355. #define REAL       0x0800  /*   "                     0000 1000 0000 0000 */
  356. #define ASSOC      0x1000  /* Msg area allows assoc   0001 0000 0000 0000 */
  357. #define EXTERN     0x2000  /* Activates [E] prompt    0010 0000 0000 0000 */
  358. #define FORCE      0x4000  /* Always force            0100 0000 0000 0000 */
  359. #define COMPRESS   0x8000  /* Allow LZSS comp here    1000 0000 0000 0000 */
  360.  
  361.  
  362. /*-------------------------------------------------------------------------*/
  363. /* File area record                                                        */
  364. /*-------------------------------------------------------------------------*/
  365.  
  366. struct _fboard {
  367.   char       name[47];
  368.   char       flags;
  369.   char       dpath[79];
  370.   char       upath[79];
  371.   signed char age;
  372.   word       userflags;
  373.   char       leechpercent;
  374. };
  375.  
  376.  
  377. /*-------------------------------------------------------------------------*/
  378. /* FBoard flags                                                            */
  379. /*-------------------------------------------------------------------------*/
  380. #define COUNTDLS   0x0001  /* Use timestamp as #dls   0000 0000 0000 0001 */
  381. #define FREEFILES  0x0002  /* Don't inc downloads     0000 0000 0000 0010 */
  382. #define FILEASSOC  0x0004  /* File area allows assoc  0000 0000 0000 0100 */
  383. #define FREEUP     0x0008  /* Don't inc uploads       0000 0000 0000 1000 */
  384. /*#define        0x0010  /*                           0000 0000 0001 0000 */
  385. /*#define        0x0020  /*                           0000 0000 0010 0000 */
  386. /*#define        0x0040  /*                             0000 0000 0100 0000 */
  387. /*#define        0x0080  /*                             0000 0000 1000 0000 */
  388. /*#define        0x0100  /*                             0000 0001 0000 0000 */
  389. /*#define        0x0200  /*                             0000 0010 0000 0000 */
  390. /*#define        0x0400  /*                             0000 0100 0000 0000 */
  391. /*#define        0x0800  /*                           0000 1000 0000 0000 */
  392. /*#define        0x1000  /*                           0001 0000 0000 0000 */
  393. /*#define        0x2000  /*                           0010 0000 0000 0000 */
  394. /*#define        0x4000  /*                           0100 0000 0000 0000 */
  395. /*#define        0x8000  /*                           1000 0000 0000 0000 */
  396.  
  397. #define STOPDL "\x0b\x03\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18"
  398.  
  399. /*-------------------------------------------------------------------------*/
  400. /* Protocol record                                                         */
  401. /*-------------------------------------------------------------------------*/
  402.  
  403.   struct   protocol {
  404.     char   name[25];
  405.     char   key;
  406.     int    adj;
  407.     char   spawndn[119];
  408.     char   spawnup[119];
  409.     char   abort[48];
  410.     unsigned wild:         1;
  411.     unsigned multi:        1;
  412.     unsigned simul:        1;
  413.     unsigned list:        1;
  414.     unsigned opus:        1;
  415.     unsigned noname:    1;
  416.     unsigned dszlog:    1;
  417.     unsigned reserved:    1;
  418.     char   pad1;
  419.     char   pad2;
  420.   };
  421.  
  422. /*-------------------------------------------------------------------------*/
  423. /*                                                                         */
  424. /* CONFIGURATION.............                                              */
  425. /*                                                                         */
  426. /*-------------------------------------------------------------------------*/
  427.  
  428. struct _config {
  429.    char   commport;       /* Commport to use...0=COM1,1=COM2,etc.          */
  430.    word   node;           /* Our node number                               */
  431.    char   mailpath[79];   /* Path for incoming messages                    */
  432.    char   filepath[79];   /* Path for incoming files                       */
  433.    word   net;            /* Our network number                            */
  434.    word   alt_node;       /* Alternate node number (mainly for HOSTS)      */
  435.    word   alt_net;        /* Alternate net number (mainly for HOSTS)       */
  436.    byte   zone;           /* Our zone number                               */
  437.    byte   alt_zone;       /* Alternate zone number                         */
  438.    char   homepath[79];   /* Path to BBS Files                             */
  439.    char   outpath[79];    /* Path for outbound messages                    */
  440.    char   menupath[79];   /* Path to system menu files                     */
  441.    char   messpath[79];   /* Path to system message files                  */
  442.    char   sysop[36];      /* SysOp's name                                  */
  443.    char   system[64];     /* BBS's name                                    */
  444.    char   logfile[79];    /* System logfile                                */
  445.    word   idleseconds;    /* Seconds user can be idle before disconnect    */
  446.    char   pages;          /* Number of times user can page sysop           */
  447.    bit    sysopin:    1;  /* Is he? 0 or 1                                 */
  448.    bit    touchup:    1;  /* Touchup uploaded file dates? 0 or 1           */
  449.    bit    uptime:     1;  /* 1=Return upload time                          */
  450.    bit    downtime:   1;  /* 1=Return download time                        */
  451.    bit    dvideo:     1;  /* Use direct video for some output?             */
  452.    bit    bvideo:     1;  /* If not, use BIOS?                               */
  453.    bit    bioswrites: 1;  /* Write through BIOS for ANSI?                  */
  454.    bit    debug:      1;  /* Debug on or off (0 or 1)                      */
  455.    bit    ansiavail:  1;  /* Is ANSI available? 0 or 1                       */
  456.    bit    whichstat:  2;  /* Default status line (0-3)                     */
  457.    bit    promptsay:  1;
  458.    char   edansi[79];     /* External ANSI editor DOS string               */
  459.    char   edline[79];     /* External line editor DOS string               */
  460.    char   edlocal[79];    /* Local message editor DOS string               */
  461.    word   ansibaud;       /* Minimum baud for ANSI                         */
  462.    char   quotestring[4]; /* String to put before quotes in reply          */
  463.    ulong  callcount;      /* Number of System calls                        */
  464.    char   lastcaller[36]; /* Last caller to system                         */
  465.    word   netmailboard;   /* Net Mail Board #                              */
  466.    word   altnetboard;    /* Net Mail Board # for alternate zone:net/node  */
  467.    struct _mboard mboard; /* Default message board setup                   */
  468.    struct _fboard fboard; /* Default file board setup                      */
  469.    char   origin[59];     /* Default origin line                           */
  470.    char   carbons;          /* Number of carbons to allow (0-9)               */
  471.    char      jumpfile[10][13];  /* Jump filenames                               */
  472.    char   jumpkey[10][2]; /*    Jump keys                                   */
  473.    char   subfile[10][13];/*    Sub filenames                               */
  474.    char   subkey[10][2];  /*    Sub keys                                   */
  475.    word      nolmrs;          /* Number of areas to keep LMRs for               */
  476.    long      quote_pos;      /* Start of next sequential quote in quotefile   */
  477.    char   quote_file[13]; /* Name of quotefile                               */
  478.    char   domain[37];
  479.    char   alt_domain[37];
  480.    bit    forcefilemsg: 1;
  481.    bit    trace: 1;
  482.    bit    RBBSorQBBS: 1;  /* Type of DORINFO?.DEF to make                  */
  483.    bit    reservedbits: 5;
  484.    ulong  nextid;
  485.    word   packsize;          /* Size at which to compress msgs                   */
  486.    char   helpkey;
  487.    int    version;
  488.    long   lastcall;
  489.    char   reserved1[94]; /*                                               */
  490.    char   startat;        /* Start u/d enforcement after # d/l's           */
  491.    char   numcomps;       /* How many computer types you are tracking      */
  492.    char   edgraph[79];    /* "Real" ANSI editor                            */
  493.    char   comments;       /* Number of comment lines for upload            */
  494.    word   purgebaud;      /* Maximum baud rate to purge outbound with      */
  495.    bit      genphone:       1; /* Use generic phone input?                      */
  496.    bit    genstatezip: 1; /* Use state & zip as generic field?               */
  497.    bit       share:       1; /* Are we running SHARE.EXE?                       */
  498.    bit    fastANSI:    1; /* Use INT 29h for ANSI output?                  */
  499.    bit    logmenu:       1;
  500.    bit       logfiles:       1;
  501.    bit    logmsg:       1;
  502.    bit      logtext:       1;
  503.    char      nodelist[79];   /* Path to nodelist files                           */
  504.    word   lastusernum;      /* Last user's record #                           */
  505.    char   useswapdisk;      /* Disk drive to use for swapping                   */
  506.    char   LIMEMS;          /* Use LIMEMS for swapping?                       */
  507.    char   swap;              /* Swap or not?                                   */
  508.    int    available[41];  /* For third party apps...see notes              */
  509.    char   reserved2;      /* Extra byte                                    */
  510. };
  511.  
  512. /*
  513.      Notes on available[] area in _config structure.   These ints may be
  514.      allocated by a third-party program so long as the app first makes
  515.      sure the int is not 0!  Apps should always use the highest
  516.      available slot.  Do not use a slot unless it (the two-byte int) is
  517.      0!  Even XBBS might use a slot someday following this convention,
  518.      so you'll avoid system crashes someday if you play by the rules
  519.      today.
  520. */
  521.  
  522. /*-------------------------------------------------------------------------*/
  523. /* Logon Configuration                                                     */
  524. /*-------------------------------------------------------------------------*/
  525.  
  526. struct _logconfig {
  527.   bit name;
  528.   bit handle;
  529.   bit phone1;
  530.   bit phone2;
  531.   bit graphics;
  532.   bit ansiedit;
  533.   bit scrnclr;
  534.   bit pagepause;
  535.   bit commflag;
  536.   bit zipcode;
  537.   bit city;
  538.   bit state;
  539.   bit pass;
  540.   bit birth;
  541.   bit length;
  542.   bit width;
  543.   bit locallog;          /* Automatic logon in local mode? */
  544.   char   loglimit;       /* How long to give user for login (mins)        */
  545.   char   nameattempts;   /* How many times user can try to enter name     */
  546.   char   passattempts;   /* How many times user can try to enter pword    */
  547.   word   minbaud;        /* Minimum baud rate                             */
  548.   char   reserved[24];
  549.  end;
  550.  
  551.  
  552. struct _events {      /* Structure for XBBS online events */
  553.     char filename[13];
  554.     ulong secsleft;
  555. };
  556.  
  557. /*-------------------------------------------------------------------------*/
  558. /* Message packet header                                                   */
  559. /*-------------------------------------------------------------------------*/
  560. #define PKTVER       2      /* Current packet version */
  561.  
  562. #define isFIDO       0x00   /* Fido<tm>'s product code                    */
  563. #define isCONF         0x01    /* Confmail's product code                    */
  564. #define isSEADOG     0x02   /* Seadog<tm>'s product code                */
  565. #define isSLICK         0x04    /* Slick/150's product code                 */
  566. #define isOPUS       0x05   /* Opus<no_tm>'s product code               */
  567. #define isDUTCH         0x06    /* Dutchie's product code                     */
  568. #define    isTABBY         0x08    /* Tabby's product code                        */
  569. #define isHOLSTER     0x09    /* Holster's product code                    */
  570. #define isWOLF         0x0a    /* Wolf/68k's product code                     */
  571. #define isQMM         0x0b    /* QNX product code                            */
  572. #define isFD         0x0c    /* Frontdoor                                */
  573. #define isMAILMAN     0x11    /* MailMan                                    */
  574. #define isOOPS         0x12    /* OOPS                                        */
  575. #define    isGS         0x13    /* GS-Point                                    */
  576. #define isBG         0x14    /* Ray Gwinn                                */
  577. #define    isCB         0x15    /* Crossbow                                    */
  578. #define isSTOD         0x19    /* Shawn Stoddard                            */
  579. #define isBRIDGE     0x1a    /* D'Bridge                                    */
  580. #define isBINK         0x1b    /* BinkleyTerm                                */
  581. #define isYANK         0x1c    /* Yankee                                    */
  582. #define isFGET         0x1d    /* FGet/FSend                                */
  583.  
  584. /*
  585.  
  586.  
  587. 1Eh  Daisy MAILER (Apple ][ packer/mailer), Raymond & Ken Lo, 3:700/1
  588. 1Fh  Polar Bear (bbs/packer/mailer), Kenneth McLeod, 1:101/190
  589. 20h  The-Box (Atari ST packer/mailer), Jac Kersing, 2:508/17
  590. 21h  Warlock (OS/2 packer/mailer), Leonard Thornton, 1:362/101
  591. 22h  TMail (packer/echomail processor), Larry Lewis, 3:713/606
  592. 23h  TCOMMail (packer/mailer for TComm BBS), Mike Ratledge, 1:372/888
  593. 24h  Bananna (Binkley on a Mac, packer/mailer), Joe Keenan, 1:109/401
  594. 25h  RBBSMail (RBBS echomail processor), Jan Terpstra, 2:512/101
  595. 26h  Apple-netmail (Apple?? packer/mailer), Bill Fenner, 1:129/87
  596. 27h  Chameleon Point Mailer (Amiga), Juergen Hermann, 2:241/2.12
  597. 28h  Majik Board (MS-DOS bbs/packer/mailer), Dale Barnes, 1:375/11
  598. 29h  QMail (MS-DOS packer), Greg Dawson, 1:106/111
  599. 2Ah  Point And Click (Amiga packer), Rob Tillotson, 1:201/40.302
  600. 2Bh  Aurora Three Bundler (MS-DOS packer), Oliver McDonald, 1:342/1
  601. 2Ch  FourDog version (MS-DOS packer for WWIV), Shay Walters, 1:376/12
  602. 2Dh  MSG-PACK (MS-DOS packer), Tom Hendricks, 1:261/662
  603. 2Eh  AMAX (MS-DOS outbound manager), Alan Applegate, 1:104/36
  604. 2Fh  Domain Communication System, Hal Duprie, 1:101/106
  605. 30h  LesRobot (FidoNet ARPANET Gateway), Lennart Svensonn, 2:501/2
  606. 31h  Rose (MS-DOS packer/mailer), Glen Jackson, 1:100/617
  607. 32h  Paragon (Amiga bbs/packer/mailer), Jon Radoff, 1:322/545
  608. 33h  BinkleyTerm/oMMM/ST/ (Atari-ST mailer/packer), Peter Glasmacher, 1:143/9
  609. 34h  StarNet (Atari-ST mailer/bbs), Eric Drewry, 1:322/566
  610. 35h  ZzyZx (MS-DOS packer), Claude Warren, 1:104/62
  611. 36h  QuickBBS (MS-DOS bbs), Adam Hudson, 1:104/24
  612. 37h  BOOM (MS-DOS outbound manager), Andrew Farmer, 1:163/115
  613. 38h  PBBS (Amiga packer/mailer), Todd Kover, 1:261/1028
  614. 39h  TrapDoor (Amiga mailer), Maximilian Hantsch, 2:310/3.24
  615. 3Ah  Welmat (Amiga mailer), Michael Richardson, 1:163/109.10
  616.  
  617. */
  618.  
  619. struct _pkthdr {
  620.     word
  621.         orig_node,             /* originating node */
  622.         dest_node,             /* destination node */
  623.         year,                  /* 1989 - nnnnn */
  624.         month,
  625.         day,
  626.         hour,
  627.         minute,
  628.         second,
  629.         rate,                  /* unused */
  630.         ver,                   /* 2 */
  631.         orig_net,              /* originating net */
  632.         dest_net;              /* destination net */
  633.     byte
  634.         product,
  635.         rev_lev,               /* revision level */
  636.         password[8];
  637.      word
  638.         qm_orig_zone,
  639.         qm_dest_zone;
  640.      byte
  641.         domain[8];
  642.      word
  643.         orig_zone,             /* originating zone */
  644.         dest_zone,             /* destination zone */
  645.         orig_point,            /* originating point */
  646.         dest_point;            /* destination point */
  647.      long
  648.         pr_data;
  649. };
  650.  
  651. /*      PakdMessage  = 02H 00H         message type, old type-1 is
  652.                                        obsolete
  653.                      origNode          of message
  654.                      destNode          of message
  655.                      origNet           of message
  656.                      destNet           of message
  657.                      AttributeWord
  658.                      cost              in lowest unit of originator's
  659.                                        currency
  660.                      DateTime          message body was last edited
  661.                      toUserName{36}    Null terminated
  662.                      fromUserName{36}  Null terminated
  663.                      subject{72}       Null terminated
  664.                      text{unbounded}   Null terminated          /*
  665.  
  666. /*=====================================================================*/
  667. /* FOSSIL definitions                                                  */
  668. /*=====================================================================*/
  669.  
  670. #define FOSSILINT  0x14
  671. #define SETBAUD    0
  672. #define TRANSWAIT  1
  673. #define RECVWAIT   2
  674. #define GETSTAT    3
  675. #define INIT       4
  676. #define DEINIT     5
  677. #define DTR        6
  678.   #define UP         1
  679.   #define DOWN       0
  680. #define FLUSHOUT   8
  681. #define PURGEOUT   9
  682. #define PURGEIN    10
  683. #define TRANSMIT   11
  684. #define PEEK       12
  685. #define KEYNOWAIT  13
  686. #define KEYWAIT    14
  687. #define FLOW       15
  688. #define ONOFF      16
  689.   #define ON         0
  690.   #define OFF        2
  691. #define SETCRSR    17
  692. #define READCRSR   18
  693. #define ONEANSI    19
  694.   #define CARRIER    128
  695.   #define INITOK     0x1954
  696. #define WATCHDOG   20
  697. #define REBOOT     23
  698.   #define COLD       0
  699.   #define WARM       1
  700. #define BLOCKREAD  24
  701. #define BLOCKWRITE 25
  702.  
  703. /*-------------------------------------------------------------------------*/
  704. /* Nodelist structures for QuickNodeList                                   */
  705. /*-------------------------------------------------------------------------*/
  706.  
  707. /*------------------------------------------------------------------------*/
  708. /* Values for the `flags1' field                                          */
  709. /*------------------------------------------------------------------------*/
  710. #define B_hub      0x0001  /* node is a net hub       0000 0000 0000 0001 */
  711. #define B_host     0x0002  /* node is a net host      0000 0000 0000 0010 */
  712. #define B_region   0x0004  /* node is region coord    0000 0000 0000 0100 */
  713. #define B_zone     0x0008  /* node is a zone coord    0000 0000 0000 1000 */
  714. #define B_CM       0x0010  /* runs continuous mail    0000 0000 0001 0000 */
  715. #define B_ores1    0x0020  /* reserved for Opus       0000 0000 0010 0000 */
  716. #define B_ores2    0x0040  /* reserved for Opus       0000 0000 0100 0000 */
  717. #define B_ores3    0x0080  /* reserved for Opus       0000 0000 1000 0000 */
  718. #define B_ores4    0x0100  /* reserved for Opus       0000 0001 0000 0000 */
  719. #define B_ores5    0x0200  /* reserved for Opus       0000 0010 0000 0000 */
  720. #define B_res1     0x0400  /* reserved for non-Opus   0000 0100 0000 0000 */
  721. #define B_res2     0x0800  /* reserved for non-Opus   0000 1000 0000 0000 */
  722. #define B_res3     0x1000  /* reserved for non-Opus   0001 0000 0000 0000 */
  723. #define B_res4     0x2000  /* reserved for non-Opus   0010 0000 0000 0000 */
  724. #define B_res5     0x4000  /* reserved for non-Opus   0100 0000 0000 0000 */
  725. #define B_res6     0x8000  /* reserved for non-Opus   1000 0000 0000 0000 */
  726.  
  727. struct nodeidx {
  728.     word  zone;
  729.     word  net;
  730.     word  node;
  731.     char  type;
  732. };
  733.  
  734. struct nodeinfo {
  735.     char type;
  736.     word zone;
  737.     word net;
  738.     word node;
  739.     char name[21];
  740.     char city[41];
  741.     char phone[41];
  742.     char password[9];
  743.     word flags;
  744.     word baud;
  745.     int  cost;
  746. };
  747.  
  748. /* Symbols for SPAWNIT */
  749.  
  750. #define SPAWN  0
  751. #define EXEC   1
  752. #define BATCH  2
  753. #define DOS    3
  754. #define EXIT   4
  755. #define PRINT  5
  756. #define HOT    6
  757. #define SWAP   7
  758. #define SPAWNR 8
  759. #define DOSR   9
  760. #define WRITE  10
  761.  
  762. /* Symbols for GPRINTF */
  763.  
  764. #define MODEMONLY 1
  765. #define LOCALONLY 2
  766. #define ANSIONLY  4
  767. #define ASCIIONLY 8
  768. #define LOGONLY      16
  769. #define BOFEM      128
  770.  
  771. /* Symbols for GENIN */
  772.  
  773. #define ALLL     1
  774. #define ALPHA    2
  775. #define NUM      3
  776. #define ALPHANUM 4
  777. #define YESNO    5
  778. #define FLE      6
  779. #define FLEP     7
  780. #define FLEW     8
  781. #define FLEPW    9
  782. #define NAME     10
  783. #define NEAT     11
  784. #define PHONE    12
  785. #define DATE     13
  786. #define SUBJECT  14
  787. #define YESNOM   15
  788. #define FLEX     16
  789. #define ARROWS   17
  790. #define ANSIIN   18
  791. #define ANSISET  19
  792. #define FBATCH   20
  793. #define FBATCHW  21
  794. #define FBATCHWP 22
  795. #define FBATCHP  23
  796. #define TRUEANSI 24
  797. #define WORD     25
  798. #define WORDNUM     26
  799. #define BITS     27
  800. #define ANY         28
  801. #define ANYNOECHO 29
  802. #define HYPER     30
  803. #define THRU     31
  804. #define FORWINDOW 32
  805. #define YESNOQ   65
  806.  
  807. /* EQUATES for ANSI directions */
  808.  
  809. #define    UPP        0
  810. #define DOWNN   1
  811. #define FORWARD    2
  812. #define BACK    3
  813.  
  814. /* These should match...VERSION is version # * 10
  815.    XBBS makes a check on the config file version and complains if
  816.    it doesn't match this when loading config file. */
  817.  
  818. #define XVERSION "1.17"
  819. #define VERSION 117
  820.  
  821.  
  822. /* Function prototypes */
  823.  
  824. void   pascal cls (void);
  825. char   pascal inkey (void);
  826. char   pascal carrchk (void);
  827. char   pascal readfile (char *filename, char abort, char pause,char imbed);
  828. char   pascal fossil (char function, char arg);
  829. char   pascal printm (char *text);
  830. char   pascal lprint (char *text);
  831. void   pascal mprint (char *text);
  832. void   cdecl  deinitialize (void);
  833. char * pascal genin (char length,char password,char caps,char hot,char type);
  834. char * pascal addtolog (char *text);
  835. char * pascal getdttm (void);
  836. void   pascal left(char *a,char *b,int x);
  837. void   pascal right(char *a,char *b,int x);
  838. void   pascal mid(char *a,char *b,int x,int y);
  839. void   pascal mids(char *a,int x,int y,char *b);
  840. char * pascal rstrip (char *a);
  841. char * pascal lstrip (char *a);
  842. void   pascal userlist (word);
  843. void   pascal readconfig (void);
  844. void   pascal saveconfig (void);
  845. void   pascal logoff(void);
  846. void   pascal prepare (void);
  847. char   pascal specialkey(char);
  848. char   pascal specialmod(void);
  849. char * pascal ansimenu(char,char,char *);
  850. char   pascal spawnit (char *,char,char);
  851. void   pascal assignvar (char *,char);
  852. void   pascal chat(void);
  853. void   pascal update(void);
  854. ulong  pascal getxbbstime(void);
  855. void   pascal userinfo(word,char);
  856. void   pascal usertoggle(word);
  857. void   pascal usertoggle2(word,char);
  858. void   pascal city(void);
  859. void   pascal state(void);
  860. void   pascal phone1(void);
  861. void   pascal phone2(void);
  862. void   pascal length(void);
  863. void   pascal width(void);
  864. void   pascal password (void);
  865. void   pascal handler(void);
  866. void   pascal zip(void);
  867. char   pascal filesbbs (char *,char,char *,char *);
  868. void   pascal getonline(void);
  869. char * pascal saydate(struct date *);
  870. char * pascal saytime(struct time *);
  871. char * pascal convertstring (char *);
  872. void   pascal trashcan(char *);
  873. void   pascal hitreturn(void);
  874. char * pascal fidodate(void);
  875. word   pascal readamessage(char,word);
  876. word   pascal writemessage(char);
  877. int    pascal askwrite(char);
  878. void   pascal readany(char *,char *,char);
  879. void   pascal readnew(char *,char);
  880. void   pascal readtext(char *);
  881. void   pascal rawdir(char *,char);
  882. int    pascal nodelist (struct nodeidx *,char);
  883. char * pascal split (char *,char *);
  884. void   pascal spit(char,char *);
  885. void   pascal pauseit(void);
  886. word   pascal scanmessage(char,word);
  887. word   pascal download(char *,struct protocol *,char);
  888. void   pascal add_one(char *);
  889. word   pascal askdl(char *,char,char *,char);
  890. word   pascal upload(char *,char);
  891. char * pascal replace(char *,char *);
  892. void   pascal adjust_time(char);
  893. word   pascal getentry (char *,struct protocol *);
  894. void   pascal backup(char *);
  895. void   pascal backupnum(int);
  896. word   pascal tellabout(char);
  897. void   pascal redraw_stat(char *);
  898. void   pascal blank_stat(void);
  899. void   pascal comptype(void);
  900. int    cdecl  break_handler(void);
  901. char   pascal printg(char *);
  902. word   pascal thread (word,word,char,char,char *);
  903. void   pascal printheader(char,word,char,word);
  904. void   pascal checkpos(void);
  905. char * pascal stripcr(char *);
  906. char * pascal getstuff (struct protocol *, char);
  907. void   pascal gothere (char adjust,char *s,char which,struct protocol *);
  908. void   pascal autolog(void);
  909. word   pascal makemessage(char);
  910. char * pascal mci (char *);
  911. void   pascal load_areas(char *);
  912. char   pascal find_area (word,char);
  913. void   pascal dobulls(char *,char);
  914. void   pascal getline (char *);
  915. char * pascal say_prompt (word);
  916. ulong  pascal check_dls (char *, word *, char);
  917. void   pascal user_func(char *);
  918. word   pascal find_msgarea(char *,char *,int);
  919. word   pascal find_filearea(char *,char *,word);
  920. ulong  pascal transfer_time(ulong,int);
  921. int    pascal doswap (char far *, char far *);
  922. char * pascal readfromlist(char *,char);
  923. long   pascal findlabel(char *,int);
  924. char   cdecl  gprintf(char,char *,...);
  925. int       pascal get_mess(word);
  926. int    pascal put_mess(word messno);
  927. char * pascal get_text(word messno);
  928. void   pascal ffree(void *);
  929. void * pascal mmalloc(unsigned int);
  930. int       pascal oopen(char *,int);
  931. int    pascal ccreat(char *,int);
  932. void   pascal cclose(int);
  933. void   pascal ccloseall(void);
  934. void   pascal ffreeall(void);
  935. void   pascal save_lastread(void);
  936. void   pascal load_lastread(void);
  937. char   pascal verify_user(char *);
  938. void   pascal do_dls(char *,long);
  939. void   pascal do_dszlog(struct protocol *,char);
  940. void   pascal strip_seenbys(char *);
  941. char * pascal write_line (char **text,word linelen,char ctla);
  942. void   pascal strip_blanklines (char *hold);
  943. void   pascal xijit (void);
  944. char   pascal check4more (void);
  945. word   pascal next_filearea (char *filename,word seclvl);
  946. char   pascal find_protocol (struct protocol *proto,char key);
  947. int       cdecl  ffprintf(int,char *,...);
  948. word   pascal get_abunch (word messno,char type,int direction,char *str);
  949. char * pascal fgetsx(char *,int,int);
  950. int    pascal load_topics(char *tn);
  951. int    pascal display_topic(word secl,char **b);
  952. void   pascal getlinet(char *lineh,int fp);
  953. int    pascal set_topic(char *s);
  954. char * pascal stristr(char *target,char *findme);
  955. char   pascal ansimenu2 (char tcolor, char color, char *title, char *line, char top, char down, char *hyperhelp);
  956. void   cdecl  xdoor (char *fname,char statnum);
  957. void   cdecl  xfile (char *fname,char statnum);
  958. char   pascal skip_blanks (int fp);
  959. char * pascal unpack_msg (char **hold);
  960. char * pascal pack_msg (char *hold);
  961. char   pascal first_non_white (char *a);
  962. void   pascal user_param (char a);
  963. char   pascal change_parm (char a, word secl, long fsize, long totalbytes, word nofiles, char *b);
  964. char   pascal system_parms (char a, char b);
  965. void   pascal make_list (char *file,char *mask,char *includepath,char overwrite);
  966. char * pascal ansimenu3 (char *title, char *file, char *color);
  967. void   pascal ansimenu4 (char *title, char *file, char *color, char *fileout, char *prepend, char overwrite);
  968. int    pascal find_help (char *hn,char *topic,char usewindow);
  969. char * pascal lookup_var (char *name);
  970. void   pascal delete_var (char *name);
  971. void   pascal assign_var (char *name,char *str);
  972. void   pascal free_vars (void);
  973. char * pascal mystrdup (char *str);
  974. word   pascal next_msgarea (char *filename);
  975. /* char * pascal avatar2ansi (int av);  */
  976. void   pascal export_mail(word areano,word messno);
  977. int    pascal do_all_msg_areas (char *msgareas,char type,char newonly,char abortok,word startat);
  978. char * pascal sysval (char *rest);
  979. void   pascal setsystem (char *rest);
  980. char * pascal var_trans (char *str);
  981. word   pascal finduser (char type, char *users_name);
  982. word   pascal load_user (word num);
  983. word   pascal save_user (word num);
  984. void   pascal do_picks (char arg,char *b,word *lastlevel);
  985. int    pascal isleech (char percent);
  986. void   pascal xmenu (char *menuname);
  987. word   pascal chk_scroll_lock (void);
  988. char * pascal r_just (char *str, int size);
  989. char * pascal center (char *line, int linlen);
  990. char * pascal ansi_interface (char *b);
  991. char   pascal magazine_input (char *text);
  992. void   pascal edit_user(char);
  993. void   pascal sysop_shell(void);
  994. void   pascal other_options(char);
  995. char * pascal do_input (char *title, char *prompt, char *mask, char *deflt, int fore, int back, int x, int y, char type);
  996. void   pascal do_hangup(int handle);
  997. void   pascal setup_file(char *);
  998. void   pascal setup_msg(char *);
  999. char * pascal write_exit(char *);
  1000. void   pascal do_request(char *);
  1001. void   pascal do_list(char *);
  1002. void   pascal do_quote(char *);
  1003. void   pascal do_special_ANSI_input(char *);
  1004. void   pascal do_pulldowns(char *,word *);
  1005. void   pascal do_alt_addr(char *);
  1006. void   pascal change_msgpath(char *);
  1007. char * pascal do_hyper(char *);
  1008. void   pascal do_readloop(char *);
  1009. char * pascal do_macro_buffer(char *);
  1010.  
  1011. /* END OF FILE: msg.h */
  1012.