
/*

Paragon BBS header file (C)1989 by Jon Radoff and Eric Drewry

This version has been updated November 12, 1989 for Paragon 2.0.

All rights released for use in any software

*/

#define MAXMSGBASE 128 /* Max number of message bases allowed */
#define MAXUDBASE 40 /* Max number of file areas */
#define FNAME "Paragon.CON" /* The configuration file */
#define INXSIZE 90
#define PATHSIZE 64
#define MAXNODES 9

/*----------------------------------------------------------------------*
* Paragon Nodelist
*-----------------------------------------------------------------------*/

struct paralist  {  /* Nodelist data file */
   short int type;
   short int zone;
   short int net;
   short int node;
   short int rnet;
   short int rnode;
   short int baud;
   short int cost;
   short int route;
   char bbsname[50];
   char bbsloc[30];
   char bbsnumber[20];
   char password[10];
   short int flags;
   char res1;
   char res2;
   char res3;
   char res4;
};

struct paradex  { /* Nodelist index file */
   short int type;
   short int zone;
   short int net;
   long position;
   char realloc[30];
   char location[50];
};

/*----------------------------------------------------------------------*

                      Paragon.CON structure (configuration)

                         Updated July 18, 1989 for V1.1
		       Updated November 12, 1989 for V2.0

*-----------------------------------------------------------------------*/

struct fig {

char defpath[PATHSIZE]; /* Default (main) path */
char mailpath[PATHSIZE]; /* not implemented */
char msgpath[MAXMSGBASE][PATHSIZE]; /* Path to each message area */
char msgname[MAXMSGBASE][32]; /* Name of each message area */
char udpath[MAXUDBASE][PATHSIZE]; /* Path to each file area */
char udname[MAXUDBASE][32]; /* Name of each file area */
short int msgno[MAXMSGBASE]; /* Not implemented */
short int lomsgno[MAXMSGBASE]; /* Low message # in each message area */
short int himsgno[MAXMSGBASE]; /* High message # in each message area */
char outpath[PATHSIZE]; /* Doors path */
char txtpath[PATHSIZE]; /* Text files path */
short int fiena;
short int fionhour;
short int fioffhour;
short int fionmin;
short int fioffmin;
short int mail;
short int ulist;
short int outena;
short int nm;
short int sm;
short int fm;
short int callspd[16]; /* Default calls allowed per day per access level */
short int idlemin[16]; /* Not implemented */
short int ptena;
short int onhour;
short int offhour;
char bbsname[64]; /* Name of the BBS */
char chateng[80]; /* Chat mode engaged string */
char chatret[80]; /* Chat mode returned string */
short int subop[MAXMSGBASE+MAXUDBASE]; /* Subops of file and message areas */
long syscalls; /* Total calls to system */
short int bdcktp;
char iden[4]; /* System ID string */
short int defbaud; /* Max baud rate */
long points;
short int log; /* Log to disk or prshort inter */
char newspath[PATHSIZE]; /* not implemented */
short int msglevel[MAXMSGBASE]; /* Absolute min access level for message area */
short int udlevel[MAXUDBASE]; /* Absolute min access for file area */
short int minpc[16]; /* Default minutes per call per access level */
short int minpd[16]; /* Default minutes per day */
short int onmin;
short int offmin;
char junk_string[16]; /* ignore this! */
short int smdiss;
char netpath[PATHSIZE]; /* Network path, not implemented */
short int net; /* Your net */
short int node; /* Your node */
short int basetype[MAXMSGBASE]; /* 0=local, 1=NetMail, 2=EchoMail, 3=Private */
char tele[16]; /* Telephone number */
char echo[64];
char prefix[20];
char suffix[10];
short int delay;
short int uplevel;
short int himsgsent[MAXMSGBASE]; /* High message sent via net in a FidoNet area */
char listpath[PATHSIZE]; /* Nodelist path */
char sysop[22]; /* Sysop's name */
short int seenby;
char mprompt[30]; /* Main BBS prompt */
short int binkley; /* Are we using a front end instead of Paragon's mailer? */
short int zone; /* Your zone */
short int prn;
short int chat;
char xpath[PATHSIZE]; /* not implemented */
short int graphics; /* Offer alternate graphics menus? */
short int d_msgmask[16][8]; /* Default message area mask per access level(read) */
short int d_udmask[16][4]; /* Default file area mask (read) */
short int d_wmsgmask[16][8]; /* Default message area mask for writing */
short int d_wudmask[16][4]; /* Default file area mask for writing */
short int d_privs[16][7]; /* Default privilleges */
long d_credits[16]; /* Default credits */
short int d_ratio[16]; /* Default U:D ratio */
short int dev_mask[MAXUDBASE]; /* Mask of the devices used for each file area */
char devices[16][10]; /* Name of each defined device for file areas */
short int ul_return; /* Percentage of time to return to user for an upload */
short int ul_perm; /* not implemented */
short int ul_perm_max; /* not implemented */
char data[PATHSIZE]; /* File area data path */
short int lockbaud; /* not implemented */
short int rts; /* rts/cts enable */
char laston[22]; /* username of last user online */
short int default_chat;
short int default_privacy;
char tagname[MAXMSGBASE][16]; /* Tag names of all the message areas */
short int msg_sig[MAXMSGBASE]; /* Sig # for all message areas */
short int file_sig[MAXMSGBASE]; /* Sig # for all file areas (*1) */
short int config_version; /* The version of the config file, currently 110 */
char YooHoo[100]; /* The WaZoo string */
long minspace; /* Minimum space allowed for an upload */
short int openfiles;
short int remote;
char waiting[PATHSIZE]; /* Waiting messages path */
short int def_brat[16]; /* Default byte ratios for access levels */
char helppath[PATHSIZE]; /* Not implemented yet */
char menupath[PATHSIZE]; /* Path for the menu data files */
short int junk_abc;
short int f_status[MAXUDBASE]; /* Not implemented yet */
short int m_status[MAXMSGBASE]; /* Not implemented yet */
short int f_menu[MAXUDBASE]; /* Menu file for all the file areas */
short int m_menu[MAXMSGBASE]; /* Menu file for all the message areas */
long freebyte[16]; /* Default number of free bytes for all access levels */
short int maxdlm; /* Maximum number of messages that may be dl'd with msg dl util */
char remote_dos_code[20]; /* Access code for the remote DOS shell */
char msg_dl_path[PATHSIZE]; /* Path to use for the message download utility */
short int msg_benefit; /* How many messages it takes to be credited upload equiv */
short int timeout; /* Timeout in seconds */
short int guest_on; /* Allow guests on the system? */
short int log_level; /* Log verbosity */
short int calls_today; /* Calls received today */
short int d_msg_limit[16]; /* Default message entry limitation */
char macros[10][80]; /* Shifted F-Key macros */
short int last_call; /* Date of the last call to the system */
short int bulletins_on; /* Have bulletin menu show up upon entry to BBS? */
short char uptmppath[PATHSIZE]; /* Upload temp directory */
short int AREXX; /* Unused */
short int check_integrity[MAXUDBASE]; /* Check ARC/LZH/ZOO in these file areas? */
short char serial_device[MAXNODES][30]; /* Name of serial devices */
short char serial_unit[MAXNODES]; /* Name of serial units */
short int total_nodes; /* Total nodes in use */
short int total_in_doors; /* Total users allowed in doors at a time */
/* Multi-user internal use data */
short int msglock[MAXMSGBASE];
short int fillock[MAXUDBASE];
short int mislock[20];
short int newumsg[20];
short int newsmsg[20];
char freqpath[PATHSIZE];
short int maxresume;
char res_names[20][14];
char res_users[20][22];
char line_user[MAXNODES+1][23];
char line_what[MAXNODES+1][30];
short int line_hide[MAXNODES+1][MAXNODES+1];
short int line_muf[MAXNODES+1][MAXNODES+1];
short int line_room[MAXNODES+1];
short int line_stat[MAXNODES+1];
short int line_mod[MAXNODES+1];
short int line_gag[MAXNODES+1];
short int room_open[110];
char line_from[MAXNODES+1][30];
short int serial_rts[MAXNODES];
} config;


/*----------------------------------------------------------------------*

User.DAT record structure.  Note that the size of the file User.VER will
equal the number of users stored in User.DAT.

Updated July 18, 1989 for V1.1
Updated November 12, 1989 for V2.0

*-----------------------------------------------------------------------*/

extern struct usr {
	short int level;	/* access level */
	char username[22]; 	/* User's name */
	long byteup;		/* Bytes uploaded */
	long bytedown; 		/* Bytes downloaded */
	long freebyte; 		/* Free bytes */
	char password[14]; 	/* password */
	short int numcalls; 	/* number of calls to system */
	short int lastdate; 	/* last date on */
	short int lasttime; 	/* last time on */
	short int callstd; 	/* calls today */
	short int dlmode_nls;	/* Message dl utility: eoln stripping mode */
	short int minleft;	/* minutes remaining today if lastdate == today's date */
	short int comtype;	/* Computer type (#) */
	short int col;		/* Number of screen columns */
	long bytesent; 		/* # of files uploaded to system */
	long byterec; 		/* # of files downloaded from system */
	char tele[14];		/* telephone number */
	long points;		/* Current door points */
	short int himsgread[MAXMSGBASE]; /* High msg read counters */
	short int msg_limit; 	/* Limit on number of msgs enter/call */
	char address[40]; 	/* address */
	char city[30]; 		/* city */
	char state[3]; 		/* state */
	char zip[8]; 		/* zip code */
	char dlmode_arc; 	/* Type of compression for msg dl utility */
	long credits; 		/* network credits */
	short int msgmask[8]; 	/* bitfield for message areas */
	short int udmask[4]; 	/* bitfield for file areas */
	short int moreflag; 	/* Number of lines before "More?" */
	short int u_version; 	/* User data file version, currently 120 */
	short int mmask[8]; 	/* Access mask to read a message areas */
	short int fmask[4]; 	/* Access mask to download in file areas */
	short int wmsgmask[8]; 	/* Access mask to write in message areas */
	short int wudmask[4]; 	/* Access mask to upload in file areas */
	short int privs[7]; 	/* Privillege bits */
	short int helplevel;	/* expert mode */
	short int protocol; 	/* default protocol */
	short int bprotocol; 	/* default batch protocol */
	short int graphics; 	/* graphics mode */
	short int ratio;	/* enforced upload:download ratio */
	short int ucallpd;	/* max calls to system per day allowed */
	short int uminpd; 	/* max minutes allowed per day to system */
	short int uminpc; 	/* max minutes allowed per call to system */
	short int lastfile; 	/* date the file area was last accessed on */
	short int brat; 	/* Byte ratio */
	short int msg_entered;  /* Number of messages entered */
	char hotkeys;		/* Will be 'H' if hotkeys mode is selected */
} user;

/*----------------------------------------------------------------------*

                    UDx.DAT record structures
                    UDx.VER has a length equal to number of records

                    Updated July 18, 1989 for V1.1

*-----------------------------------------------------------------------*/

extern struct fil {
	short int level; 		 /* Access level to read file */
	char filesname[14];	 	 /* Name of file */
	char free_spc[34]; 		 /* empty space */
	short int numdls; 		 /* number of downloads */
	unsigned short int createdate;	 /* Creation date */
	unsigned short int createtime;	 /* Creation time */
	short int comtype;		 /* Not used */
	long bytesize;			 /* Length of file */
	char des1[82];			 /* Short description */
	char des2[82];			 /* Unused */
	char upusername[22];		 /* Name of who uploaded it */
	short int free_dl;		 /* Free download? */
	short int unvalidated;		 /* Is file unvalidated? */
	unsigned short int last_dl_date; /* Date of last download (*2) */
	char free[4];
} files;

/*----------------------------------------------------------------------*

	                     Message header
			 Standard FidoNet hybrid
		        Updated November 12, 1989

*-----------------------------------------------------------------------*/

struct msg {
	char fromuser[36];		/* Who it is from */
	char touser[36];		/* Who it is to */
	char subject[30];		/* The subject */
	short int replies[20];		/* Messages numbers of replies */
	short int thread_id;		/* Thread ID number */
	char datetime[20];		/* Creation time and date */
	short int timesread;		/* Number of times read */
	short int desnode;		/* Destination node */
	short int orignode;		/* Origin node */
	short int cost;			/* Unused */
	short int orignet;		/* Origin net */
	short int desnet;		/* Destination net */
	char fill[8];			/* Expansion space */
	short int replyto;		/* Unused */
	unsigned short int private : 1; /* Is it private? */
	unsigned short int crash : 1;	/* Unused */
	unsigned short int recd : 1;	/* Has addressee received it? */
	unsigned short int sent : 1;	/* Has it been MailProc'd? */
	unsigned short int fileatt : 1;	/* Is there a file attached? */
	unsigned short int intransit : 1;/* (Remainder unused */
	unsigned short int orphan : 1;
	unsigned short int killsent : 1;
	unsigned short int local : 1;
	unsigned short int hfpick : 1;
	unsigned short int unused : 1;
	unsigned short int filereq : 1;
	unsigned short int retrecreq : 1;
	unsigned short int isretrec : 1;
	unsigned short int auditreq : 1;
	unsigned short int fileupreq : 1;
	short int nextreply;
} msgs;

/*----------------------------------------------------------------------*

                      Menu file structure - new for V1.1

*-----------------------------------------------------------------------*/

struct _Menu {
	short int page; /* Page number */
	short int menutype; /* 0=general, 1=file, 2=message */
	short int unused1;
	short int unused2;
	short int unused3;
	char default_menu[16];
	char access_menu[16][16];
	char commands_active[60]; /* ascii 33 to 90 are used */
	char commands_function[60]; /* see menubit.h */
	char commands_minsec[60]; /* Min access */
	char commands_maxsec[60]; /* Max access */
	char commands_priv[60]; /* Priv req'd to use command */
	char commands_sparam[60][50];
	short int commands_iparam[60];
	char prompt[40];
	} Menu;

/*

(*1): The MAXMSGBASE is not an error for this structure.
(*2): If this value equals 0, it the program accessing this record
      should set it's value equal to files.createdate

*/
