home *** CD-ROM | disk | FTP | other *** search
- /*
- Message Base Reply Chain Linker
-
- This module was originally written by Bob Hartman
- Sysop of FidoNet node 1:132/101
-
- Spark Software, 427-3 Amherst St, CS 2032, Suite 232, Nashua, NH 03061
-
- This program source code is being released with the following provisions:
-
- 1. You are free to make changes to this source code for use on your own
- machine, however, altered source files may not be distributed without the
- consent of Spark Software.
-
- 2. You may distribute "patches" or "diff" files for any changes that you
- have made, provided that the "patch" or "diff" files are also sent to Spark
- Software for inclusion in future releases of the entire package. A "diff"
- file for the source archives may also contain a compiled version, provided
- it is clearly marked as not being created from the original source code.
- No other executable versions may be distributed without the consent of
- Spark Software.
-
- 3. You are free to include portions of this source code in any program you
- develop, providing: a) Credit is given to Spark Software for any code that
- may is used, and b) The resulting program is free to anyone wanting to use
- it, including commercial and government users.
-
- 4. There is NO technical support available for dealing with this source
- code, or the accompanying executable files. This source code is provided
- as is, with no warranty expressed or implied (I hate legalease). In other
- words, if you don't know what to do with it, don't use it, and if you are
- brave enough to use it, you're on your own.
-
- Spark Software may be contacted by modem at (603) 888-8179 (node 1:132/101)
- on the public FidoNet network, or at the address given above.
-
- */
-
- /*
- Message header structure. The message text is
- just a long string after the header.
- */
-
- struct _stamp {
- unsigned int date;
- unsigned int time;
- };
-
- typedef struct {
- char from[36]; /* who from */
- char to[36]; /* who to */
- char subj[72]; /* message subject */
- char date[20]; /* creation date */
- int times; /* number of times read */
- int dest; /* destination node */
- int orig; /* originating node */
- int cost; /* actual cost of msg */
- int orig_net; /* originating net */
- int dest_net; /* destination net */
- struct _stamp _date_written; /* When user wrote the msg (GMT) */
- struct _stamp _date_arrived; /* When msg arrived on-line (GMT) */
- /* int caca[4]; obsolete *//* extra space */
- int reply; /* thread to previous message */
- int attr; /* message type, below */
- int up; /* thread to next message */
- }
- MSG, *MSG_PTR;
-
- /*
- CONFIG.DOG structure used by get_sea_config()
- */
-
- typedef struct {
- int num_addrs; /* Number of addresses that follow */
- int zone[20]; /* Zone numbers for addresses */
- int net[20]; /* Net numbers */
- int node[20]; /* Node numbers */
- int point[20]; /* Point numbers */
- char mailpath[80]; /* Path to mail directory */
- char filepath[80]; /* Path to attached file directory */
- int baud; /* Maximum baud rate */
- int comport; /* Communications port used */
- }
- SEACONFIG, *SEACONFIG_PTR;
-
- /*
- AREAS.BBS in FastEcho format
- */
- typedef struct {
- char *msg_path;
- char *area_name;
- int num_nodes;
- int *msgs_in_area;
- int *net;
- int *node;
- int *handle;
- char **aname;
- unsigned int flags;
- }
- AREAS, *AREAS_PTR;
-
- /*
- Passworded structure format
- */
- typedef struct {
- int net;
- int node;
- char *password;
- }
- PW, *PW_PTR;
-
-
- /*
- MAIL.SYS file structure
- */
-
- typedef struct {
- int node; /* local node number */
- float fudge; /* cost fudge factor */
- int rate; /* baud rate */
- char mailpath[80]; /* path to find mail in */
- char filepath[80]; /* mail file path */
- int net; /* net number */
- int alt_node; /* alternate node number */
- int alt_net; /* alternate net number */
- }
- MAIL, *MAIL_PTR;
-
- /*
- Node descriptor (NODELIST.SYS)
- */
-
- typedef struct {
- int number; /* node number */
- int net; /* net number */
- int cost; /* cost per minute to call */
- int rate; /* baud rate */
- char name[20]; /* node name */
- char phone[40]; /* phone number */
- char city[40]; /* city and state */
- }
- NODE, *NODE_PTR;
-
- typedef struct {
- int orig_node; /* originating node */
- int dest_node; /* destination node */
- int year,
- month,
- day,
- hour,
- minute,
- second;
- int rate; /* baud rate */
- int ver; /* packet version */
- int orig_net; /* originating net */
- int dest_net; /* destination net */
- char product; /* Product code */
- char rev_lev; /* revision level */
- char password[8]; /* pickup password */
- char extra[20]; /* extra space */
- long pr_data; /* product dependent data */
- }
- PKTHDR, *PKTHDR_PTR;
-
- typedef struct {
- int ver;
- int orig_node;
- int dest_node;
- int orig_net;
- int dest_net;
- int attr;
- int cost;
- }
- PACKED, *PACKED_PTR;
-
- /*
- User records
- */
-
- typedef struct {
- char name[36]; /* user name */
- char city[36]; /* city and state */
- struct { /* This structure holds the last */
- int area; /* message read counters. It is */
- int last_read; /* used in place of the commented */
- }
- msgs_read[10]; /* out 'int date[20];' */
- /* int date[20];*/ /* initial date */
- char pwd[16]; /* password */
- int times; /* # times called */
- int help; /* last help setting */
- int tabs; /* 1 == expand tabs */
- int nulls; /* number of nulls */
- int msg; /* last message area */
- int more; /* last MORE setting */
- int priv; /* privilege setting */
- char ldate[20]; /* last time called */
- int time; /* time on system in 1 day */
- unsigned flag; /* various bit flags */
- unsigned upld; /* total K bytes uploaded */
- unsigned dnld; /* total K bytes downloaded */
- unsigned dnldl; /* download limiting */
- int files; /* last file area */
- char width; /* screen width */
- char len; /* screen length */
- int credit; /* credit, in cents */
- int debit; /* debit, in cents */
- }
- USR, *USR_PTR;
-
- typedef struct {
- int calls; /* # calls in log */
- char fdate[20]; /* logging started */
- char ldate[20]; /* logging ended */
- int log[7][24]; /* the counters */
- }
- TLOG, *TLOG_PTR;
-
- /*
- Structure for each virtual bulletin board.
- SYSTEM<n>.BBS files
- */
-
- typedef struct {
- int caller; /* caller number */
- int priv; /* min privilege */
- char msgpath[40]; /* path for message base */
- char bbspath[40]; /* path for .BBS files */
- char hlppath[40]; /* path for .HLP files */
- char uppath[40]; /* path for uploads */
- char filepath[40]; /* path for file area */
- int attrib; /* attributes */
- }
- SYS, *SYS_PTR;
-
- /* Standard time of day structure. */
-
- typedef struct {
- int year;
- int month;
- int day;
- int daywk;
- int hour;
- int mins;
- int sec;
- /* (daywk == 7 == every day. Month, day, year,
- sec not used by sched) */
- } TIMESTRCT, *TIMEPTR;
-
- /* Scheduler time structure. */
-
- typedef struct {
- TIMESTRCT time;
- int len;
- int enable; /* 1 == enabled -1 ==
- disabled 0 == deleted */
- int trigger; /* not used (yet) */
- int result; /* returned value */
- char tag; /* schedule tag */
- char extra; /* spacer */
- int a,b,c,d,e; /* extra garbage */
- } SCHED, *SCHEDPTR;
-
- typedef struct {
- char far *wbuff;
- char far *wptr;
- int wsize;
- } WBUFFER, *WBUFFPTR;
-
- typedef struct {
- long seconds;
- unsigned int from;
- unsigned int to;
- unsigned int subject;
- } KILL, *KILLPTR;
-
- typedef struct {
- KILLPTR klink;
- int msg_num;
- char deleted;
- char replied;
- } KILL2, *KILL2PTR;
-
- /* PtMapper structure for holding point names */
- typedef struct PTSTRUCT {
- char *pt_name; /* Who it is */
- int pt_num; /* Their point number */
- char ci;
- char co;
- char fi;
- char fo;
- struct PTSTRUCT *next; /* The next in this structure */
- } PTTYPE;
-
- typedef struct {
- char *mtxt; /* Message text */
- int txtcnt; /* Number of characters in text (not null terminated) */
- } MDSCR;
-
-
- /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
- /*% %*/
- /*% %*/
- /*% S Y S T E M F I L E S T R U C T U R E %*/
- /*% %*/
- /*% %*/
- /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
- /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
- /* */
- /* Opus uses a single file called a System File to define each of up to */
- /* 256 separate system areas numbered 0-255 and use the file name format */
- /* of "SYSTEM##.DAT" where the '##' is the hexadecimal value of the system */
- /* number. Please note that although the Opus user and sysop interfaces */
- /* refer to system areas in decimal notation, the file names use hex. */
- /* */
- /* Although each system area file defines both message and file areas of */
- /* the same number, those two systems are almost fully independent. */
- /* */
- /* For a related discussion on the meaning and use of 'locks' and 'keys' */
- /* see the comments for ClassLock in the user record. */
- /* */
- /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
- typedef struct {
- /*........ (mostly) Common System Data ..............................*/
-
- word version; /* System Record version = 110 = v1.10 */
- word menu; /* Alternate Menu file extension, 0=MNU */
- word attrib; /* Area attributes (see below) */
- byte fillc1[10]; /* Reserved filler */
- byte barrpath[ 40 ]; /* Barricade File path. */
- byte fillc2[24]; /* Reserved filler */
-
- /*........ File System Information ..................................*/
-
- byte filtitle[ 50 ]; /* File Area Title */
- byte filepath[ 40 ]; /* Path to the file download directory */
- byte uppath[ 40 ]; /* Path to the file upload directory */
- byte listpath[ 40 ]; /* Path to FILES.BBS equivalent */
- byte fillf1[22]; /* Reserved filler */
-
- byte FilePriv; /* Min priv for file area */
- byte DownPriv; /* If not 0, min priv to download */
- byte UpPriv; /* If not 0, min priv to upload */
- byte FileExtPriv; /* If not 0, min priv to go Outside */
- byte fillf2[12]; /* Reserved filler */
-
- long FileLock; /* Locks for File Area */
- long DownLock; /* If not 0, keys needed to download */
- long UpLock; /* If not 0, keys needed to upload */
- long FileExtLock; /* If not 0, keys needed to go Outside */
- byte fillf3[32]; /* Reserved filler */
-
- /*........ Message System Information ...............................*/
-
- byte msgtitle[ 50 ]; /* Msg Area Title */
- byte msgpath[ 40 ]; /* Path to messages */
- byte fillm1[ 22 ]; /* Reserved filler */
-
- byte MsgPriv; /* Min priv for msg area */
- byte EditPriv; /* If not 0, min priv to Enter or Reply */
- byte MsgExtPriv; /* If not 0, min priv to go Outside */
- byte fillm2[13]; /* Reserved filler */
-
- long MsgLock; /* Locks for Msg Area */
- long EditLock; /* If not 0, keys needed to Enter or Reply */
- long MsgExtLock; /* If not 0, keys needed to go Outside */
- byte fillm3[4]; /* Reserved filler */
- byte EchoName[32]; /* Echo Area 'Tag' Name */
-
- /*=================================== Total Record Size = 512 =====*/
- }
- _sys, *_sys_ptr;
-
-
- /*-------------------------------------------------------------------------*/
- /* 'attrib' -- Area attributes (limit or describe area's behavior) */
- /*-------------------------------------------------------------------------*/
-
- /* #define SYSMAIL 0x01 */ /* OPUS: Netmail Area */
- #define NOPUBLIC 0x04 /* OPUS: Disallow Public messages */
- #define NOPRIVATE 0x08 /* OPUS: Disallow Private messages */
- #define ANON_OK 0x10 /* OPUS: Allow Anonymous messages */
- #define ECHOMAIL 0x20 /* OPUS: EchoMail Area */
-
- /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/