home *** CD-ROM | disk | FTP | other *** search
- /* MSGG.H file*/
-
- #include "mem.h"
- #include "errno.h"
- #include "io.h"
- #include "fcntl.h"
- #include "dos.h"
- #include "dir.h"
- #include "stdio.h"
- #include "string.h"
- #include "stdlib.h"
- #include "ctype.h"
- #include "time.h"
- #include "stddef.h"
- #include "process.h"
- #include "share.h"
- #include "alloc.h"
- #include "stdarg.h"
- #include "conio.h"
- #include "setjmp.h"
-
-
- #define begin {
- #define end }
-
- #define true 0
- #define false -1
-
- #define shl <<
- #define shr >>
- #define xor ^
- #define and &&
- #define or ||
- #define not !
- #define mod %
- #define BACKSPACE "\b \b"
-
- typedef unsigned bit;
- typedef unsigned int word;
- typedef unsigned char byte;
- typedef unsigned long ulong;
-
- #define S_IFMT 0170000 /* file type mask */
- #define S_IFDIR 0040000 /* directory */
- #define S_IFCHR 0020000 /* character special */
- #define S_IFREG 0100000 /* regular */
- #define S_IREAD 0000400 /* read permission, owner */
- #define S_IWRITE 0000200 /* write permission, owner */
- #define S_IEXEC 0000100 /* execute/search permission, owner */
-
-
- /*--------------------------------------------------------------------------*/
- /* */
- /* MESSAGES............. */
- /* */
- /*--------------------------------------------------------------------------*/
-
-
- /*--------------------------------------------------------------------------*/
- /* FIDO Message header */
- /*--------------------------------------------------------------------------*/
- struct _msg {
- char from[36];
- char to[36];
- char subj[63];
- char nodelist[9]; /* OPUS: Name of the nodelist used */
- char date[20];
- word times; /* FIDO<tm>: Number of times read */
- word dest; /* Destination node */
- word orig; /* Origination node number */
- word cost; /* Unit cost charged to send the message */
- word orig_net; /* Origination network number */
- word dest_net; /* Destination network number */
- int msg_filler[4];
- word reply; /* Current msg is a reply to this msg number */
- word attr; /* Attribute (behavior) of the message */
- word up; /* Next message in the thread */
- };
-
-
- /*--------------------------------------------------------------------------*/
- /* FIDO Message attributes (attr) */
- /*--------------------------------------------------------------------------*/
- #define MSGPRIVATE 0x0001 /* private message, 0000 0000 0000 0001 */
- #define MSGCRASH 0x0002 /* accept for forwarding 0000 0000 0000 0010 */
- #define MSGREAD 0x0004 /* read by addressee 0000 0000 0000 0100 */
- #define MSGSENT 0x0008 /* sent OK (remote) 0000 0000 0000 1000 */
- #define MSGFILE 0x0010 /* file attached to msg 0000 0000 0001 0000 */
- #define MSGFWD 0x0020 /* being forwarded 0000 0000 0010 0000 */
- #define MSGORPHAN 0x0040 /* unknown dest node 0000 0000 0100 0000 */
- #define MSGKILL 0x0080 /* kill after mailing 0000 0000 1000 0000 */
- #define MSGLOCAL 0x0100 /* FidoNet vs. local 0000 0001 0000 0000 */
- #define MSGXX1 0x0200 /* 0000 0010 0000 0000 */
- #define MSGXX2 0x0400 /* STRIPPED by FidoNet<tm> 0000 0100 0000 0000 */
- #define MSGFRQ 0x0800 /* file request 0000 1000 0000 0000 */
- #define MSGRRQ 0x1000 /* receipt requested 0001 0000 0000 0000 */
- #define MSGCPT 0x2000 /* is a return receipt 0010 0000 0000 0000 */
- #define MSGARQ 0x4000 /* audit trail requested 0100 0000 0000 0000 */
- #define MSGURQ 0x8000 /* update request 1000 0000 0000 0000 */
-
-
- /*-------------------------------------------------------------------------*/
- /* XBBS Message header */
- /*-------------------------------------------------------------------------*/
- struct _xmsg {
- char from[36];
- char to[36];
- char subj[64];
- word o_point;
- word length; /* Length of message */
- ulong start; /* Starting postition in text file */
- char date[20];
- word times; /* Number of times read */
- word dest; /* Destination node */
- word orig; /* Origination node number */
- word cost; /* Unit cost charged to send the message */
- word orig_net; /* Origination network number */
- word dest_net; /* Destination network number */
- char indate[4]; /* import date (YMD(null)) */
- word m_attr; /* Extra attributes */
- word d_zone; /* Destination zone */
- word o_zone; /* Origination zone */
- word attr; /* Attribute (behavior) of the message */
- word d_point;
- };
-
-
- /* These apply to m_attr */
-
- #define MSGDELETED 0x0001 /* deleted message, 0000 0000 0000 0001*/
- #define MSGANON 0x0002 /* anonymous message 0000 0000 0000 0010*/
- #define MSGECHO 0x0004 /* unmoved echo message 0000 0000 0000 0100*/
- #define MSGNET 0x0008 /* unmoved net message 0000 0000 0000 1000*/
- #define MSGHOLD 0x0010 /* file attached to msg 0000 0000 0001 0000*/
- #define MSGHOST 0x0020 /* being forwarded 0000 0000 0010 0000*/
- #define MSGSCANNED 0x0040 /* already scanned 0000 0000 0100 0000*/
- #define MSGKEEP 0x0080 /* don't delete 0000 0000 1000 0000*/
- #define MSGTREATED 0x0100 /* soft cr's & lf's removed 0000 0001 0000 0000*/
- #define MSGPACKED 0x0200 /* message LZSS compressed 0000 0010 0000 0000*/
- /*#define 0x0400 /* 0000 0100 0000 0000*/
- /*#define 0x0800 /* 0000 1000 0000 0000*/
- /*#define 0x1000 /* 0001 0000 0000 0000*/
- /*#define 0x2000 /* 0010 0000 0000 0000*/
- /*#define 0x4000 /* 0100 0000 0000 0000*/
- #define MSGTAGGED 0x8000 /* used by offline readers 1000 0000 0000 0000*/
-
-
-
- /*--------------------------------------------------------------------------*/
- /* User record structure */
- /*--------------------------------------------------------------------------*/
-
- struct _user
- begin
- char name[36];
- char handle[36];
- struct date birthdate;
- char password[12];
- char city[24];
- char state[3];
- char zip[6];
- char phone1[11];
- char phone2[11];
- bit length: 7;
- bit cold: 1;
- char width;
- bit graphics: 1;
- bit fullscreen: 1;
- bit scrnclr: 1;
- bit commodore: 1;
- bit expert: 1;
- bit more: 1;
- bit ignorehrs: 1;
- bit ignorerat: 1;
- bit nokill: 1;
- bit deleted: 1;
- bit arq: 1;
- bit twit: 1;
- bit ansimenus: 1;
- bit gen1: 1;
- bit gen2: 1;
- bit gen3: 1;
- word attr2;
- word stat[10];
- unsigned long upk;
- unsigned long downk;
- word upno;
- word downno;
- word posts;
- int credit;
- char violations;
- struct date lastdate;
- struct time lasttime;
- struct date logondate;
- struct time logontime;
- unsigned long times;
- word callsperday;
- word timepercall;
- word totaltime;
- word callstoday;
- word timetoday;
- char variable[5][76]; /* Strings vars saved w/ user record */
- word numvars[10]; /* Numeric vars saved w/ user record */
- char comptype; /* # designating user's computer type */
- word uktoday;
- word dktoday;
- bit hiok: 1;
- bit lastmsgarea: 10;
- bit reserved: 5;
- word pointid; /* If he's a mailerless point */
- unsigned long id;
- char node;
- end;
-
-
-
- /*--------------------------------------------------------------------------*/
- /* User attributes */
- /*--------------------------------------------------------------------------*/
- #define GRAPHICS 0x0001 /* ANSI 0000 0000 0000 0001 */
- #define FULLSCREEN 0x0002 /* full screen editor 0000 0000 0000 0010 */
- #define SCRNCLR 0x0004 /* screen clearing? 0000 0000 0000 0100 */
- #define COMMODORE 0x0008 /* GP Special flag 0000 0000 0000 1000 */
- #define EXPERT 0x0010 /* help level 0000 0000 0001 0000 */
- #define MORE 0x0020 /* More? pause 0000 0000 0010 0000 */
- #define IGNOREHRS 0x0040 /* Ignore u/d hours 0000 0000 0100 0000 */
- #define IGNORERAT 0x0080 /* Ignore ratio enforcement 0000 0000 1000 0000 */
- #define NOKILL 0x0100 /* Don't kill user 0000 0001 0000 0000 */
- #define DELETED 0x0200 /* User is deleted 0000 0010 0000 0000 */
- #define ARQ 0x0400 /* Reliable connect 0000 0100 0000 0000 */
- #define TWIT 0x0800 /* Twit or whatever 0000 1000 0000 0000 */
- #define ANSIMENUS 0x1000 /* Use ANSI Menus? 0001 0000 0000 0000 */
- #define GEN1 0x2000 /* No use by system 0010 0000 0000 0000 */
- #define GEN2 0x4000 /* No use by system 0100 0000 0000 0000 */
- #define GEN3 0x8000 /* No use by system 1000 0000 0000 0000 */
-
-
- /*--------------------------------------------------------------------------*/
- /* Message area record */
- /*--------------------------------------------------------------------------*/
-
- struct _mboard
- begin
- char name[48];
- char forceto[36];
- word attr;
- word max;
- word number;
- word substat1;
- word substat2;
- signed char age;
- word flags;
- word minwrite;
- end;
-
- /*-------------------------------------------------------------------------*/
- /* MBoard attributes */
- /*-------------------------------------------------------------------------*/
- #define NOORIG 0x0001 /* No Origin or tear 0000 0000 0000 0001 */
- #define ANSI 0x0002 /* ANSI 0000 0000 0000 0010 */
- #define PRIVATE 0x0004 /* Obvious 0000 0000 0000 0100 */
- #define PUBLIC 0x0008 /* " 0000 0000 0000 1000 */
- #define ECHO 0x0010 /* " 0000 0000 0001 0000 */
- #define NET 0x0020 /* " 0000 0000 0010 0000 */
- #define MCI 0x0040 /* " 0000 0000 0100 0000 */
- #define READONLY 0x0080 /* " 0000 0000 1000 0000 */
- #define ALTERNATE 0x0100 /* " 0000 0001 0000 0000 */
- #define ALTECHO 0x0200 /* " 0000 0010 0000 0000 */
- #define ANON 0x0400 /* " 0000 0100 0000 0000 */
- #define REAL 0x0800 /* " 0000 1000 0000 0000 */
- #define ASSOC 0x1000 /* Msg area allows assoc 0001 0000 0000 0000 */
- #define EXTERN 0x2000 /* Activates [E] prompt 0010 0000 0000 0000 */
- #define FORCE 0x4000 /* Always force 0100 0000 0000 0000 */
- #define COMPRESS 0x8000 /* Allow LZSS comp here 1000 0000 0000 0000 */
-
-
- /*-------------------------------------------------------------------------*/
- /* FBoard flags */
- /*-------------------------------------------------------------------------*/
- #define COUNTDLS 0x0001 /* Use timestamp as #dls 0000 0000 0000 0001 */
- #define FREEFILES 0x0002 /* Don't inc downloads 0000 0000 0000 0010 */
- #define FILEASSOC 0x0004 /* File area allows assoc 0000 0000 0000 0100 */
- #define FREEUP 0x0008 /* Don't inc uploads 0000 0000 0000 1000 */
-
- /*--------------------------------------------------------------------------*/
- /* File area record */
- /*--------------------------------------------------------------------------*/
-
- struct _fboard
- begin
- char name[47];
- char flags;
- char dpath[79];
- char upath[79];
- signed char age;
- word userflags;
- char leechpercent;
- end;
-
-
- #define STOPDL "\x0b\x03\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18"
-
- /*--------------------------------------------------------------------------*/
- /* Protocol record */
- /*--------------------------------------------------------------------------*/
-
- struct protocol {
- char name[25];
- char key;
- int adj;
- char spawndn[119];
- char spawnup[119];
- char abort[48];
- unsigned wild: 1;
- unsigned multi: 1;
- unsigned simul: 1;
- unsigned list: 1;
- unsigned opus: 1;
- unsigned noname: 1;
- unsigned reserved: 2;
- char pad1;
- char pad2;
- };
-
-
- /*--------------------------------------------------------------------------*/
- /* */
- /* CONFIGURATION............. */
- /* */
- /*--------------------------------------------------------------------------*/
-
- struct _config {
- char commport; /* Commport to use...0=COM1,1=COM2,etc. */
- word node; /* Our node number */
- char mailpath[79]; /* Path for incoming messages */
- char filepath[79]; /* Path for incoming files */
- word net; /* Our network number */
- word alt_node; /* Alternate node number (mainly for HOSTS) */
- word alt_net; /* Alternate net number (mainly for HOSTS) */
- byte zone; /* Our zone number */
- byte alt_zone; /* Alternate zone number */
- char homepath[79]; /* Path to BBS Files */
- char outpath[79]; /* Path for outbound messages */
- char menupath[79]; /* Path to system menu files */
- char messpath[79]; /* Path to system message files */
- char sysop[36]; /* SysOp's name */
- char system[64]; /* BBS's name */
- char logfile[79]; /* System logfile */
- word idleseconds; /* Seconds user can be idle before disconnect */
- char pages; /* Number of times user can page sysop */
- bit sysopin: 1; /* Is he? 0 or 1 */
- bit touchup: 1; /* Touchup uploaded file dates? 0 or 1 */
- bit uptime: 1; /* 1=Return upload time */
- bit downtime: 1; /* 1=Return download time */
- bit dvideo: 1; /* Use direct video for some output? */
- bit bvideo: 1; /* If not, use BIOS? */
- bit bioswrites: 1; /* Write through BIOS for ANSI? */
- bit debug: 1; /* Debug on or off (0 or 1) */
- bit ansiavail: 1; /* Is ANSI available? 0 or 1 */
- bit whichstat: 2; /* Default status line (0-2) */
- bit promptsay: 1;
- char edansi[79]; /* External ANSI editor DOS string */
- char edline[79]; /* External line editor DOS string */
- char edlocal[79]; /* Local message editor DOS string */
- word ansibaud; /* Minimum baud for ANSI */
- char quotestring[4]; /* String to put before quotes in reply */
- ulong callcount; /* Number of System calls */
- char lastcaller[36]; /* Last caller to system */
- word netmailboard; /* Net Mail Board # */
- word altnetboard; /* Net Mail Board # for alternate zone:net/node */
- struct _mboard mboard; /* Default message board setup */
- struct _fboard fboard; /* Default file board setup */
- char origin[59]; /* Default origin line */
- char carbons; /* Number of carbons allowed */
- char jumpfile[10][13]; /* Jump filenames */
- char jumpkey[10][2]; /* Jump keys */
- char subfile[10][13];/* Sub filenames */
- char subkey[10][2]; /* Sub keys */
- word nolmrs;
- long quote_pos; /* Start of next sequential quote in quotefile */
- char quote_file[13]; /* Name of quotefile */
- char domain[37];
- char alt_domain[37];
- bit forcefilemsg: 1;
- bit trace: 1;
- bit RBBSorQBBS: 1; /* Type of DORINFO?.DEF to make */
- bit reservedbits: 5;
- ulong nextid;
- word packsize;
- char helpkey;
- int version;
- long lastcall;
- char reserved1[94]; /* */
- char startat; /* Start u/d enforcement after # d/l's */
- char numcomps; /* How many computer types you are tracking */
- char edgraph[79]; /* "Real" ANSI editor */
- char comments; /* Number of comment lines for upload */
- word purgebaud; /* Maximum baud rate to purge outbound with */
- bit genphone: 1; /* Use generic phone input? */
- bit genstatezip: 1; /* Use state & zip as generic field? */
- bit share: 1; /* Using SHARE.EXE? */
- bit fastANSI: 1; /* Use INT 29h for ANSI output? */
- bit logmenu: 1;
- bit logfiles: 1;
- bit logmsg: 1;
- bit logtext: 1;
- char nodelist[79]; /* Path to nodelist files */
- word lastusernum; /* Last user's record # */
- char useswapdisk; /* Disk drive to use for swapping */
- char LIMEMS; /* Use LIMEMS for swapping? */
- char swap; /* Swap or not? */
- int available[41]; /* For third party apps...see notes */
- char reserved2;
- };
-
- /*
- Notes on available[] area in _config structure. These ints may be
- allocated by a third-party program so long as the app first makes
- sure the int is not 0! Apps should always use the highest
- available slot. Do not use a slot unless it (the two-byte int) is
- 0! Even XBBS might use a slot someday following this convention,
- so you'll avoid system crashes someday if you play by the rules
- today.
- */
-
-
- /*--------------------------------------------------------------------------*/
- /* Logon Configuration */
- /*--------------------------------------------------------------------------*/
-
- struct _logconfig {
- bit name;
- bit handle;
- bit phone1;
- bit phone2;
- bit graphics;
- bit ansiedit;
- bit scrnclr;
- bit pagepause;
- bit commflag;
- bit zipcode;
- bit city;
- bit state;
- bit pass;
- bit birth;
- bit length;
- bit width;
- bit locallog; /* Automatic logon in local mode? */
-
- char loglimit; /* How long to give user for login (mins) */
- char nameattempts; /* How many times user can try to enter name */
- char passattempts; /* How many times user can try to enter pword */
- word minbaud; /* Minimum baud rate */
- char reserved[24];
- };
-
-
- struct _events { /* Structure for XBBS online events */
- char filename[13];
- ulong secsleft;
- };
-
-
-
-
- /*--------------------------------------------------------------------------*/
- /* Message packet header */
- /*--------------------------------------------------------------------------*/
- #define PKTVER 2
-
- struct _pkthdr {
- word
- orig_node, /* originating node */
- dest_node, /* destination node */
- year, /* 1989 - nnnnn */
- month,
- day,
- hour,
- minute,
- second,
- rate, /* unused */
- ver, /* 2 */
- orig_net, /* originating net */
- dest_net; /* destination net */
- byte
- product,
- rev_lev, /* revision level */
- password[8];
- word
- qm_orig_zone,
- qm_dest_zone;
- byte
- domain[8];
- word
- orig_zone, /* originating zone */
- dest_zone, /* destination zone */
- orig_point, /* originating point */
- dest_point; /* destination point */
- long
- pr_data;
- };
-
- /* PakdMessage = 02H 00H message type, old type-1 is
- obsolete
- origNode of message
- destNode of message
- origNet of message
- destNet of message
- AttributeWord
- cost in lowest unit of originator's
- currency
- DateTime message body was last edited
- toUserName{36} Null terminated
- fromUserName{36} Null terminated
- subject{72} Null terminated
- text{unbounded} Null terminated /*
-
- /*=====================================================================*/
- /* FOSSIL definitions */
- /*=====================================================================*/
-
- #define SETBAUD 0
- #define TRANSWAIT 1
- #define RECVWAIT 2
- #define GETSTAT 3
- #define INIT 4
- #define DEINIT 5
- #define DTR 6
- #define UP 1
- #define DOWN 0
- #define FLUSHOUT 8
- #define PURGEOUT 9
- #define PURGEIN 10
- #define TRANSMIT 11
- #define PEEK 12
- #define KEYNOWAIT 13
- #define KEYWAIT 14
- #define FLOW 15
- #define ONOFF 16
- #define ON 0
- #define OFF 2
- #define SETCRSR 17
- #define READCRSR 18
- #define ONEANSI 19
- #define CARRIER 128
- #define INITOK 0x1954
- #define WATCHDOG 20
- #define REBOOT 23
- #define COLD 0
- #define WARM 1
- #define BLOCKREAD 24
- #define BLOCKWRITE 25
-
-
- /*-------------------------------------------------------------------------*/
- /* Nodelist structures for QuickNodeList */
- /*-------------------------------------------------------------------------*/
-
- /*------------------------------------------------------------------------*/
- /* Values for the `flags1' field */
- /*------------------------------------------------------------------------*/
- #define B_hub 0x0001 /* node is a net hub 0000 0000 0000 0001 */
- #define B_host 0x0002 /* node is a net host 0000 0000 0000 0010 */
- #define B_region 0x0004 /* node is region coord 0000 0000 0000 0100 */
- #define B_zone 0x0008 /* node is a zone coord 0000 0000 0000 1000 */
- #define B_CM 0x0010 /* runs continuous mail 0000 0000 0001 0000 */
- #define B_ores1 0x0020 /* reserved for Opus 0000 0000 0010 0000 */
- #define B_ores2 0x0040 /* reserved for Opus 0000 0000 0100 0000 */
- #define B_ores3 0x0080 /* reserved for Opus 0000 0000 1000 0000 */
- #define B_ores4 0x0100 /* reserved for Opus 0000 0001 0000 0000 */
- #define B_ores5 0x0200 /* reserved for Opus 0000 0010 0000 0000 */
- #define B_res1 0x0400 /* reserved for non-Opus 0000 0100 0000 0000 */
- #define B_res2 0x0800 /* reserved for non-Opus 0000 1000 0000 0000 */
- #define B_res3 0x1000 /* reserved for non-Opus 0001 0000 0000 0000 */
- #define B_res4 0x2000 /* reserved for non-Opus 0010 0000 0000 0000 */
- #define B_res5 0x4000 /* reserved for non-Opus 0100 0000 0000 0000 */
- #define B_res6 0x8000 /* reserved for non-Opus 1000 0000 0000 0000 */
-
- struct nodeidx {
- word zone;
- word net;
- word node;
- char type;
- };
-
- struct nodeinfo {
- char type;
- word zone;
- word net;
- word node;
- char name[21];
- char city[41];
- char phone[41];
- char password[9];
- word flags;
- word baud;
- int cost;
- };
-
-
- /* Symbols for SPAWNIT */
-
- #define SPAWN 0;
- #define EXEC 1;
- #define BATCH 2;
- #define DOS 3;
- #define EXIT 4;
- #define PRINT 5;
-
- /* Symbols for GENIN */
-
- #define ALLL 1
- #define ALPHA 2
- #define NUM 3
- #define ALPHANUM 4
- #define YESNO 5
- #define FLE 6
- #define FLEP 7
- #define FLEW 8
- #define FLEPW 9
- #define NAME 10
- #define NEAT 11
- #define PHONE 12
- #define DATE 13
- #define SUBJECT 14
- #define YESNOM 15
- #define FLEX 16
- #define ARROWS 17
- #define ANSIIN 18
- #define ANSISET 19
- #define FBATCH 20
- #define FBATCHW 21
- #define FBATCHWP 22
- #define FBATCHP 23
- #define TRUEANSI 24
- #define WORD 25
- #define WORDNUM 26
- #define BITS 27
- #define ANY 28
- #define ANYNOECHO 29
- #define HYPER 30
- #define THRU 31
- #define FLENX 64
- #define YESNOQ 65
-
- /* ANSI COLOR TRANS TABLE TO textcolor() */
-
- /* char ansii[8]={30,34,32,36,31,35,33,37}; */
-
- /* EQUATES for ANSI directions */
-
- #define UPP 0
- #define DOWNN 1
- #define FORWARD 2
- #define BACK 3
-
- /* END OF FILE: msgg.h */