/********************************************************************
 * EzyCom structures converted to C format V1.10 6/3/94
 * by Peter Davies and Robin Cook
 *
 * These structures may ONLY be used in accordance with those
 * agreements laid out in the Official Ezycom Structures.
 * Peter Davies or Robin Cook takes no responsibility whatsoever
 * for the correctness of these structures.
 *
 * If, you find any faults please notify us of them.
 *
 * Please refer to the pascal structures for more explanation, before
 * querying us
 *
 ********************************************************************/

#define  EZYVER "1.10"
#define  VERSIONHIGH 1
#define  VERSIONLOW 10
#define  PRODNAME "Ezycom"
#define  COPYRIGHT "Peter Davies"
#define  COPYRIGHTYEAR "1992-1994"
#define  MAXFREE  1238
#define  USERFREE 125
#define  CONSTANTFREESPACE 89
#define  CONSTANTFILEFREESPACE 537
#define  MAXNODES 128
#define  MAXAKA 32
#define  MAXMESSALL 1536
#define  MAXMESS    MAXMESSALL
#define  MAXBAUDREC 11
#define  FLTMAXSIZE  2048   //      maximum size of a file description
#define  FNOINHERIT 128     //      No Interitence Flag
#define  FDENYALL   16      //      These are MUTUALLY EXCLUSIVE!!!!
#define  FDENYWRITE 32      //      Only ONE of THESE SHOULD BE USED
#define  FDENYNONE  64      //
#define  FDENYREAD  48      //
#define  FREADONLY  0       //                THESE ALSO!!!
#define  FWRITEONLY 1       //
#define  FREADWRITE 2       //

/****** Take Note ********************************************************
Boolean can be defined as a Char value under C or as an enum with a
true/false value under C++ (if compiled with enum to char switch)
WARNING: Make sure that you don't have another header which defines Boolean
**************************************************************************/
/* typedef char Boolean; */

/* Swapping Types : 0=None, 1=Ems, 2=Xms, 3=Disk, 4=EmsXms, 5=XmsEms */

/* The following can also be defined as enum under C++ */

typedef unsigned char AskType;        // 0=yes,1=no,2=ask default yes,
                                      // 3=ask default no
typedef unsigned char PhoneType;      // 0=business,1=data,2=nophone
typedef unsigned char MsgType;        // 0=local,1=net,2=echo,3=passthru
                                      // 4=waitthru,5=allmail
typedef unsigned char MsgKindsType;   // 0=public,1=private,2=both
typedef unsigned char ShowFileSizeType; // 0=nosize,1=bytes,2=kilobytes
typedef unsigned char MaxStr[256];
typedef unsigned char UserString[36];
typedef unsigned char Date[9];
typedef unsigned char FileStr[13];    // max length of a filename
typedef unsigned char DomainStr[21];  // domain string
typedef unsigned char AreaTagStr[31];
typedef unsigned char Str2[3];
typedef unsigned char Str3[4];
typedef unsigned char Str4[5];
typedef unsigned char Str8[9];
typedef unsigned char Str12[13];
typedef unsigned char Str23[24];
typedef unsigned char Str30[31];
typedef unsigned char Str72[73];
typedef unsigned char Str128[129];
typedef unsigned char FlagType[4];
typedef unsigned char GroupType[4];

typedef struct DATETIME {
unsigned int  Year,
              Month,
              Day,
              Hour,
              Min,
              Sec;
} DATETIME;

typedef struct SECURITYTYPE {
unsigned int  security;
FlagType      onflags,
              offflags;
} SECURITYTYPE;

typedef struct DATERECORD {
unsigned int   year;
unsigned char  month,
               day;
} DATERECORD;

typedef struct NETRECORD {
unsigned int  zone,
              net,
              node,
              point;
} NETRECORD;

typedef struct NET5DRECORD {
unsigned int  zone,
              net,
              node,
              point;
DomainStr     domain;
} NET5DRECORD;


/**********************************************************

       Filename:    <configrec.userbasepath>USERS.BBS

       Description: Users File
                    Records in parrallel with USERSEXT.BBS

       Limitations: 65000 records (users) maximum

           attribute,
                 Bit 0 : Deleted
                     1 : Clear Screen
                     2 : More Prompt
                     3 : Ansi Capable
                     4 : Don't Kill User
                     5 : File Points Ignore
                     6 : Full Screen Ed
                     7 : Quiet Mode
           attribute2,
                 Bit 0 : Ignore File Ratios
                     1 : Extended IBM Characters
                     2 : On = MMDDYY Off = DDMMYY
                     3 : Ignore Paging Hours
                     4 : Exclude User
                     5 : Avatar Capable
                     6 : Ignore Menu Time Restrictions
                     7 : Ignore Message Ratios
           attribute3,
                 Bit 0 : Do Not Sound Page
                     1 : Page on Logon
                     2 : Hold Mailbox
                     3 : Use Combined Mailbox
                     4 : Gender (Off = Male, On = Female)
                   5-7 : [Reserved]
           attribute4  : byte;
                 Bit 0-7 [Reserved]

 **********************************************************/

typedef struct USERSRECORD {
UserString     name,
               alias;
unsigned char  password[16];
unsigned int   security;
unsigned char  attribute,
               attribute2,
               attribute3,
               attribute4;
FlagType       flags;
unsigned char  dataphone[15],
               voicephone[15];
} USERSRECORD;


/**********************************************************

       Filename:    <configrec.userbasepath>USERSEXT.BBS

       Description: Extended Users Information
                    Records in parrallel with USERS.BBS

 **********************************************************/

typedef struct USERSEXTRARECORD {
unsigned char      location[26];
long int           lasttimedate;    // DOS Packed Date/Time
unsigned int       credit,          // Users netmail credit
                   pending,         // Netmail cost pending export
                   msgsposted,
                   nocalls,
                   uploads,
                   todayk,
                   timeused,
                   downloads;
long int           uploadsk,
                   downloadsk;
unsigned char      screenlength,
                   lastpwdchange;
unsigned int       timebanked,
                   ksbanked,
                   filepoints;
unsigned char      qwkcompression,
                   qwkdaysold,
                   comment[41],     // Sysop/User Comment
                   colour1_2,       // To retrieve the first colour & 15
                   colour3_4,       // To retrieve the second colour >> 4
                   colour5_6,
                   colour7_8,
                   bkcolour,
                   sessionfailures; // Number of Session Failures since last
                                    // successful logon 
Str8               topmenu;         // User's Top Menu 
unsigned int       filepointsgiven; // Number of Filepoints credited since last logon
DATERECORD         dateofbirth;
GroupType          groups;          // user's group setting (compressed)
unsigned int       regodate,        // Start of Registration
                   firstdate,       // Date of First Logon
                   lastfiledate;    // Last Time a New Files Search was done
unsigned char      defprotocol;     // Blank means no default protocol
unsigned int       timeleft,        // Users remaining time for today
                   filearea,        // Last file area user used
                   messarea,        // Last message area user used
                   qwkmaxmsgs,
                   qwkmaxmsgsperarea;
int                todaybankwk;     // Kilobytes Withdrawn from Bank Today
                                    // Negative Numbers indicate Deposited
UserString         forwardto;       // forward local mail to
unsigned char      todaycalls;      // Times the user has called today
int                todaybankwt;     // Time Withdrawn from Bank Today
                                    // Negative Numbers indicate Deposited
unsigned char      language;        // users language
unsigned int       endregodate;     // End Registration Date
long int           tottimeused;     // Total Time Used by the User
                                    // since the last time this field was
                                    // reset.  Normally first logon
unsigned char      extraspace[USERFREE];
} USERSEXTRARECORD;

/**********************************************************

       Filename:     <userbasepath>LASTCOMB.BBS

       Description:  Used be Ezycom for lastread & combined info

       Note:         This record adjusts when the number of
                     conferences change (in steps of 16).
                     IE: 16 conferences takes up HALF of the
                          diskspace of 32 conferences

 **********************************************************/

typedef struct USERSLASTRECORD {
unsigned char  combinedinfo;
unsigned int   lastreadinfo[16];
} USERSLASTRECORD;

/**********************************************************

       Filename:    <configrec.menupath>????????.MNU

       Description: Menu Structure
                    Record 0 has a different record structure

       Mimimum    : 1 record
       Maximum    : 51 records


       Record 0 Structure

       typ     = HiLight Colour
       display = Menu Prompt
       colour  = Menu Prompt Colour

       all others are undefined

           securityattr
                 0 : Greater than/Equal to
                 1 : Greater than
                 2 : Less than/Equal to
                 3 : Less than
                 4 : Equal to
                 5 : Not Equal

           attribute
             bit 0 : Test Ratio K
                 1 : Test Message/Call Ratio
                 2 : Test Age <config age> and Over
                 3 : Test Ratio Files
                 4 : Local Keyboard Only
                5-7: [ Reserved ]

 **********************************************************/

typedef struct MNURECORD {
unsigned char      typ;
SECURITYTYPE       security;
unsigned char      display[91];
char               hotkey;         // Ctrl-A means Automatic Option
unsigned char      miscdata[91],
                   colour,
                   securityattr,
                   timeonline;
unsigned int       timestart,
                   timeend;        // Hours is "* 100"
long int           baudrate;
unsigned int       filepoints;
unsigned char      attribute,
                   node;
} MNURECORD;

/**********************************************************

       Filename:    PROTOCOL.EZY

       Description: Protocol Record Structure

       Size       : 60 records

           attribute
           bit 0 = enable/disable
               1 = batch protocol
               2 = [ Reserved ]
               3 = both directions
               4 = up/down
               5 = bidirectional
              6-7= [ Reserved ]

 **********************************************************/

typedef struct PROTOCOLRECORD {
unsigned char  name[16];
char           activekey;
unsigned char  attribute,
               logfilename[61],
               ctlfilename[61],
               dnctlstring[61],
               dncmdstring[101],
               upcmdstring[101],
               uplogkeyword[11],
               dnlogkeyword[11],
               uperrkeyword[11],
               dnerrkeyword[11],
               uperr2keyword[11],
               dnerr2keyword[11],
               xfernamewordnum,
               xfercpswordnum;
unsigned int   security;
FlagType       flags;
unsigned char  efficiency;
} PROTOCOLRECORD;

/**********************************************************

       Filename     : CONFIG.EZY

       Description  : Configuration Record

       Size         : 1 record (6144 bytes)

       Last Revised : 25/12/92(pwd)

               printerport,
                      0 : LPT1
                      1 : LPT2
                      2 : LPT3
                      3 : COM1
                      4 : COM2
                      5 : COM3
                      6 : COM4

               autodetect
                  bit 0 : Auto Detect ANSI
                      1 : ANSI Detect for NewUser
                      2 : Auto Detect IEMSI
                      3 : IEMSI Detect for NewUser
                      4 : Auto Detect RIP
                     5-7: [Reserved]

                configattr
                  bit 0 : Move Local Uploads
                    1-15: [Reserved]

                multitasker
                      0 = Do Not Detect or Use Any MultiTasker
                      1 = Auto-Detect
                      2 = Desqview
                      3 = Double DOS
                      4 = OS/2
                      5 = MultiDOS Plus
                      6 = Taskview
                      7 = Topview
                      8 = Windows Enhanced Mode
                  9..255= [Reserved]

                 shownewfileschar
                       0 - No
                       1 - ASCII Only
                       2 - Always

 **********************************************************/

typedef struct CONFIGRECORD {
Str8           version,
               deflanguage;
unsigned char  nocarrierstring[21];
UserString     guestaccount;
unsigned char  freespace01[11],       // unused
               logpath[61],
               textpath[61],
               menupath[61],
               mnurampath[61],
               netmailpath[61],
               nodelistpath[61],
               msgpath[61],
               filepath[61],
               freespace02[61],        // unused
               binkleyoutpath[61],
               temppath[61],
               userbasepath[61],
               avatarpath[61],
               ascpath[61],
               asclowpath[61],
               filemaint[61],
               fileattachpath[61],
               soundpath[61],
               fastindexpath[61],
               systempwd[16],          // Password to Logon System
               sysoppwd[16],           // Password to Keyboard
               newuserpwd[16];         // Password for Newuser
Str8           newtopmenu;             // NewUser TopMenu
unsigned char  newusergroups[4],
               inboundmail[61],
               outboundmail[61],
               uploadpath[61],
               swapfile[61],
               multipath[61],
               brackets[3],
               inactivitytime,
               minmesscheck,
               maxlogintime,
               freespace03,            // unused
               answerdelay,            // BOOLEAN
               shellswap,              //    "
               highbit,                //    "
               disppass,               //    "
               asklocalpass,           //    "
               fastlogon,              //    "
               sysopremote,            //    "
               printerlog,             //    "
               phone1ask,              //    "
               colourask,              //    "
               aliasask,               //    "
               dobask,                 //    "
               phoneforce,             //    "
               direct_video,           //    "
               snow_check,             //    "
               freespace04,            // unused
               screen_blank,
               oneword;                // BOOLEAN
AskType        checkmail,
               checkfile,
               ansiask,
               fullscreenask,
               clearask,
               moreask,
               avatarask,
               extendask,
               usdateask;
unsigned char  phone2ask,              // BOOLEAN
               phoneformat[15],
               freespace04a[61],
               freespace04b[61],
               shellprompt[61],
               shell2prompt[61],
               enterprompt[61],
               chatprompt[61],
               listprompt[61],
               f7keylinetop[80],
               f7keylinebot[80],
               freespace05[84],        // unused
               chat2prompt[61],
               freespace05a[61],
               freespace05b[61],
               freespace05c[61],
               freespace05d[61],
               loadprompt[61],
               freespace05e[61],
               freespace05f[61];
unsigned int   security,
               logonsecurity;
FlagType       flags;
unsigned char  minpasslength,
               dispfwind,              //  Status Bar Colour  constant
               dispbwind,              //  Status Bar Colour     "
               disppopupf,             //  Popup Forground       "
               disppopupborder,        //  Popup Border          "
               disppopupb,             //  Popup Background      "
               dispf,                  //  Foreground Colour     "
               freespace06,            // Unused
               comport,
               passlogons,
               doblogon,
               printerport,
               passtries,
               topmenu[9],
               freespace07[4];         // Unused
unsigned int   watchmess,              // constant
               netmailcredit;          // constant
signed long    ansiminbaud;
unsigned int   slowbaud,
               minloginbaud,
               lowsecuritystart,
               lowsecurityend,
               slowstart,
               slowend;
unsigned char  quotestring[6],
               freespace09,            // Unused
               offhook;                // BOOLEAN
unsigned int   forcecrashmail,
               optioncrashmail,
               netmailfileattach;
unsigned char  popuphighlight,         // Popup Highlight Colour (constant)
               freespace10,            // Unused
               maxpages,
               maxpagefiles,
               pagelength;
unsigned int   pagestart[7],
               freespace50,            // Unused
               localfattachsec,
               sectouploadmess,
               sectoupdateusers,
               readsecnewecho,
               writesecnewecho,
               sysopsecnewecho,
               secreplyvianetmail;
AskType        netmailkillsent;
unsigned char  swaponarchive,
               freespace11[9],         // Unused
               popuptext;              // Popup Text Colour (constant)
unsigned int   pageend[7];
unsigned char  freespace12[22];        // Unused
unsigned int   incomingcallstart,
               incomingcallend,
               fp_upload;              //  File Points Upload Credit
unsigned char  altf[10][61],
               ctrlf[10][41],
               freespace13[4];
unsigned int   fp_credit;              // Newuser Filepoints
unsigned char  ks_per_fp,              // Number of Kilobytes per FP
               freespace14,            // unused
               rego_warn_1,
               rego_warn_2,
               freespace15[2];         // Unused
unsigned int   min_space_1;            //  constant
unsigned char  swapbimodem,            // boolean
               modembusy,              // boolean  (* Toggle DTR or ATH1 *)
               scrheight,              // boolean  (* 43/50 line mode *)
               msgtmptype,        // boolean  (True=MSGTMP False=MSGTMP.<node>)
               swapupload,            // boolean
               phonelogon,
               carrierdetect,          // (* Carrier Detect (Default=$80) *)
               newfileshighlight,      // boolean;
               max_descrip,
               min_descrip;
unsigned int   requestreceipt;
unsigned char  ushowdate;              // boolean
ShowFileSizeType  ufilesizek;
unsigned char  uuploader,              // boolean
               udownloadcount,         // boolean
               freespace16,            // unused
               ushowsecurity,          // boolean
               sshowdate;               // boolean
ShowFileSizeType  sfilesizek;
unsigned char  suploader,              // boolean
               sdownloadcount,         // boolean
               freespace17,            // Unused
               sshowsecurity,          // boolean
               ushowtime,              // boolean
               ushowfp,                // boolean
               sshowtime,              // boolean
               sshowfp;                // boolean
unsigned int   fp_percent;             // Download Filepoints Credit
unsigned char  autodetect,
               dispsecurityfile,       // boolean
               askforpagereason,       // boolean
               delincompletefiles,     // boolean
               freespace18,            // unused
               swaponfeditview,       // constant
               freespace19,            // unused
               secfileschar,
               passchar;
unsigned char  localinactivity,        // boolean
               freespace20,            // unused
               leftbracket[2],
               rightbracket[2];
unsigned int   ignorefp;               // Min Security to Ignore FPs
unsigned char  menuminage,             // Minimum Age for Age Checks
               freespace21;            // unused
unsigned int   modemeff[MAXBAUDREC],
               modembaud[MAXBAUDREC];
unsigned char  modemconnect[MAXBAUDREC][16],
               freespace22[10];        // unused
unsigned int   configattr;
unsigned char  usercol1_2,
               usercol3_4,
               usercol5_6,
               usercol7_8,
               userbkcol,
               newusercol2,
               chstatcol,
               getentercol,
               usdateforsysop,         // boolean
               ezyovrpath[61],
               freespace23[36],
               ovrems,                 // boolean;
               swapezy,
               filesecpath[61],
               freespace24,            // unused
               multitasker;
unsigned int   oldmaxbaud;
unsigned char  lockedport;
unsigned int   filereqsec;
unsigned char  autoanswer,             //  boolean
               initresponse[11],
               ringstring[11],
               inittries,
               initstring1[61],
               initstring2[61],
               busystring[21],
               answerstring[21],
               mailerstring[61];
unsigned int   modemstart,
               modemend;
unsigned char  modemdelay,
               sendbreak,              // boolean;
               externaleditor[61],
               defaultorigin[51],
               connectfax[16];
signed long    maxbaud;
unsigned char  freespace25[12];
unsigned int   uploadcredit;           //  Upload Credit Percentage
unsigned char  freespace26[36],
               shownewfileschar;
unsigned char  freespace[MAXFREE];
} CONFIGRECORD;

/**********************************************************

       Filename:    CONSTANT.EZY

       Description: Constant Configuration Information
                    The four following definitions
                       constantrecord
                       compressrecord
                       domaintype
                       constantfilefreespacetype
                    make up the complete CONSTANT.EZY file
                    As shown in "constantfilerecord"

           scantossattr
           bit 0 : Dupe Detection
               1 : Kill Null Netmail
               2 : Keep EchoArea Node Receipts
               3 : Import Messages to Sysop
               4 : Binkley Support
               5 : Kill Bad Archives
               6 : ArcMail 0.6 Compatability
               7 : Binkley 5D Support
             8-15: [Reserved]

           constantattr
           bit 0 : Sysop Alias in Chat
               1 : Auto Log Chat
               2 : Display Full Message to User
               3 : Do not delete outbound mail bundles with no .MSG
               4 : On means do not use real name kludge line
               5 : User can write messages to user of same name
               6 : Users receive QWK messages that they posted
               7 : Show Sysop Online
               8 : Make Binkley Crash, Hold, etc
               9 : Show Colour in File Areas
            10-15: [Reserved]

           unknownarea
               0 : Kill Messages
               1 : Make a New EchoMail Area
               2 : Make a New PassThru Area

 **********************************************************/

typedef struct CONSTANTRECORD {
unsigned char  version[9],
               system[41];
UserString     sysopname,
               sysopalias;
unsigned char  systemlocation[36],
               multiline;              // boolean, multiline operation
unsigned int   maxmess,                //  maximum usable message areas
               maxfile,                //  maximum usable file areas
               watchmess,              //  watchdog message area
               pagemessboard,          //  paging message board
               badpwdmsgboard;         //  bad logon message board
unsigned char  mintimeforcall,         //  minimum time to register call today
               freespace2[11];
unsigned int   scantossattr,           //  ezymail scan/toss info
               constantattr,
               maxmsgsrescan;          //  Maximum msgs to rescan (0=disable)
Str8           qwkfilename;            //  Unique QWK Mail filename
unsigned int   qwkmaxmail,             //  Maximum Msgs for QWK archive
               qwkmsgboard;            //  Bad QWK Message Board
NETRECORD      oldnetaddress[16];
unsigned int   oldnetmailboard[16];
unsigned char  oldnewareagroup[16];
unsigned int   oldnewareastmess[16];    //  New area start msg board
unsigned char  quotestring[6],          //  quote messsage string
               swaponezymail,           //  ezymail swapping information
               unknownarea,             //  unknown new area tag action
               swaponfeditview,         //  FEdit swapping information
               swaponarchive;           //  Ezymaint swapping information
unsigned int   minspaceupload;          //  minimum space to upload
unsigned char  textinputcolour;         //  default text input colour
unsigned int   badmsgboard;             //  Bad echomail msg board
NETRECORD      netaddress[MAXAKA];
unsigned int   netmailboard[MAXAKA];
char           newareagroup[MAXAKA];
unsigned int   newareastmess[MAXAKA];    //  New area start msg board
unsigned char  domain[21][MAXAKA];
unsigned char  freespace[CONSTANTFREESPACE];
} CONSTANTRECORD;

typedef struct COMPRESSRECORD {
unsigned char  echounarccmd[10][13],
               echounarcpar[10][19],
               echoarccmd[10][13],
               echoarcpar[10][19];
} COMPRESSRECORD;

typedef unsigned char  ConstantFileFreeSpaceType[CONSTANTFILEFREESPACE];

//        (* the following constants are the starting positions in
//           CONSTANT.EZY of where to find these structures *)

#define  STARTOFCOMPRESS  (sizeof(constantrecord) + sizeof(constantfilefreespacetype))

typedef struct CONSTANTFILERECORD {
CONSTANTRECORD             constant;
ConstantFileFreeSpaceType  freespace;
COMPRESSRECORD             compress;
} CONSTANTFILERECORD;

/**********************************************************

       Filename:    LIMITS.EZY

       Description: User Security Limits Information

 **********************************************************/

typedef struct LIMITSRECORD {
unsigned char  comment[21];            // Security Comment (ZStr)
unsigned int   security,               // Security level
               time,                   // Time limit per day
               limit[MAXBAUDREC+11];
unsigned char  ratio;                  // File Ratio
unsigned int   credit;                 // File Ratio Credit
unsigned char  ratiok;                 // Kilobyte Ratio
unsigned int   creditk,                // Kilobyte Ratio Credit
               regodays,               // Registration in Days
               creditmess,             // PCR Credit
               mess,                   // PCR (%)
               timepercall;            // Time limit per call   0=Disabled
unsigned char  callsperday;            // Maximum Calls Per Day 0=Disabled
unsigned int   maxbankwk,              // Maximum Withdraw Kilobytes Bank
               maxbankwt,              // Maximum Withdraw Time Bank
               maxbankdk,              // Maximum Deposit Kilobytes Bank
               maxbankdt,              // Maximum Deposit Time Bank
               maxkbank,               // Maximum Allowable Kilobytes in Bank
               maxtbank;               // Maximum Allowable Time in Bank
               freespace[32];          // Freespace
} LIMITSRECORD;

/**********************************************************

        Filename     : FILES.EZY

        Description  : Stores file area information

        Last Revised : 25/2/92(pwd)

        Records      : 1..65000

        Note         : FILEPATH.EZY must have the same amount
                       of records.
           attribute,
               bit 0  : keep files offline
                   1  : offline allowed
                   2  : sortby date
                   3  : sortby alpha
                   4  : master list
                   5  : show in new files check
                   6  : No Descriptions asked after Upload
                   7  : [Reserved]

            attribute2,
               bit 0-7 [Reserved]

            convert
                   0      = none
                   1      = zip
                   2      = lzh
                   3      = arj
                   4      = pak
                   5      = arc
                   6      = zoo
                   7      = sqz
                 8-255    = [ Reserved ]

 **********************************************************/

typedef struct FILESEZYRECORD {
unsigned char  name[31],
               attribute,
               attribute2,
               convert;
char           filegroup,
               altgroups[3];
unsigned char  minimumage;
unsigned int   upfilearea,
               areapath;               // relates to FILEPATH.EZY
SECURITYTYPE   listsecurity,
               upsecurity,
               syssecurity;
unsigned char  freespace[55];
} FILESEZYRECORD;

/**********************************************************

        Filename     : FILEPATH.EZY

        Description  : Stores information about where to get
                       the files

        Records      : 1..65000

        Note         : FILES.EZY must have the same amount
                       of records.

        Last Revised : 25/2/92(pwd)

           attribute
               Bit 0 : CD Rom Path
                   1 : [Reserved]
                   2 : Free Downloads
                   3 : Auto Adopt Files?
                  4-7: [Reserved]

 **********************************************************/

typedef struct FILEPATHRECORD {
unsigned char  filepath[61],
               filesbbs[61],
               ksperfp;
SECURITYTYPE   security;
unsigned int   uploadarea;
unsigned char  password[9],
               minimumage, 
               attribute,  
               freespace[110];
} FILEPATHRECORD;

/**********************************************************

        Filename     : FILESEC.EZY

        Description  : Stores individual (wildcard) file security

        Records      : 1->infinite  (sorted)

        Last Revised : 25/2/92(pwd)

           attribute
              Bit 0 : [Reserved]
                  1 : [Reserved]
                  2 : Free Download
                 3-7: [Reserved]

 **********************************************************/

typedef struct FILESECRECORD {
unsigned char filename[13];
SECURITYTYPE  security;
unsigned char password[9],
              minimumage,
              attribute;
} FILESECRECORD;

/**********************************************************

        Filename     : filebase path\FLCOUNT.BBS

        Description  : Stores number of files in each file area
                       (does not include comment lines)

        Records      : 1..65000
                       Always the same as FILES.EZY + FILEPATH.EZY

        Last Revised : 25/2/92(pwd)

        Sharing      : Always use DENYNONE + READWRITE

 **********************************************************/

      /*  Each record contains a word (2 bytes) which stores the
          amount of files in each file area.

          When reading the information, just seek to the
          appropriate record and read the 2 bytes

          When updating the count, lock the 2 bytes, then read
          it, then increate/decrease the amount, then write it
          back, and then release the lock. */


/**********************************************************

        Filename     : FLHXXXXX.BBS

        Description  : Stores file list information

        Last Revised : 25/2/92(pwd)

        Sharing      : Always use DENYNONE + READWRITE

              attribute 
                Bit 0 : checked
                    1 : nokill
                    2 : offline
                    3 : [Reserved]
                    4 : private
                    5 : deleted
                   6-7: [Reserved] 

           attribute2 
                bit 0-7 [Reserved] 

 **********************************************************/

typedef struct FILELINERECORD {    
long int       fltstart;               // start of info in FLTXXXXX.BBS 
unsigned int   fltlength;               // length including null termiantor
unsigned char  attribute,
               filename[13];           // if the length of filename is 0, 
                                       // then it is a comment
unsigned int   filepath;               // pointer to filepath.ezy for path 
                                       // of file 0= do not know where the 
                                       // file is 
long int       fsize,                  // size of the actual file 
               fdate,                  // date of the actual file
               arrivaldate;            // date the file arrived on the system 
unsigned char  downloads,
               downloaddate;           // last time the file was downloaded
                                       // if (downloads = 0) then
                                       //  this field is invalid
unsigned char  attribute2;
UserString     uploader;
unsigned char  freespace[57];
} FILELINERECORD;

/**********************************************************

        Filename     : FLTXXXXX.BBS

        Description  : Stores file list description information

        Last Revised : 25/2/92(pwd)

 **********************************************************/

// #define  FLTMAXSIZE  2048            // maximum size of a file description


     /* The FLTXXXXX.BBS has contains a null terminated string.

        It is either a comment, or a file description.  The description
        or comment can be upto FTLMAXSIZE in length.

        A comment maybe only 1 line long, and may NOT contain line feeds
        or carriage returns.

        A description can be any number of lines long, and may contain
        carriage returns, but may NOT contain line feeds (waste space)

        When writing to the description file, the file MUST be opened
        in DENYWRITE + READWRITE.  When reading from it, it MUST
        be opened in DENYNONE + READONLY */


/**********************************************************

        Filename     : EZYDOWN.<node>

        Description  : Stores Batch Download Information

        Last Revised : 20/3/93(pwd)

 **********************************************************/

typedef struct PREDOWNLOADRECORD {
unsigned char  filename[13],
               locationfile[65];       // path to file
long int       fsize;                  // KiloBytes 
unsigned char  freedown;               // boolean
long int       timetodown;             // Seconds 
unsigned char  cdromfile,              // boolean
               deleted;                // boolean
} PREDOWNLOADRECORD;

/**********************************************************

        Filename     : EZYUP.<node>

        Description  : Stores Pre Upload Descriptions

        Last Revised : 25/2/92(pwd)

 **********************************************************/

typedef struct PREUPLOADRECORD {
unsigned char  filename[13],
               description[FLTMAXSIZE + 1];
} PREUPLOADRECORD;

/**********************************************************

        Filename     : <configrec.userbasepath>MAINT1.BBS
                       <configrec.userbasepath>MAINT2.BBS

        Description  : Stores Information for download counts
                       and file points credit.

                       MAINT1.BBS is created by Ezycom for
                       processing by EzyFile

                       MAINT2.BBS is created by EzyFile for
                       processing by UserComp

        Last Revised : 25/2/92(pwd)

 **********************************************************/

typedef struct MAINT_RECORD {
unsigned char  filename[13];
unsigned int   filepath,               // filepath record in filepath.ezy
               filepoint;
UserString     downloader,
               uploader;
} MAINT_RECORD;

/**********************************************************

        Filename     : FFPTR.BBS

        Description  : Index Pointer File for the Fast Find Index

        Last Revised : 25/2/92(pwd)

        Format       : Files with First Character #0 through to #64
                       start at Position 0 in FFIDX.BBS

                       [730] is all new files after the last sort
                       [729] is all files with a first letter after
                             'Z' (besides new files)
                       [1..728] is files that start with A#0 through
                                to Z#255
                       eg: AA is 2, AB is 3, ZZ is 727, ZY is 726

                       A value of 0x0FFFFFFFF (-1) in any position
                       indicates no files are present for that
                       position.

**********************************************************/

typedef long int  FastPointerRecord[730];

/**********************************************************

        Filename     : FFIDX.BBS

        Description  : Index File of all files available for download

        Last Revised : 1/2/94 (pwd)

        Records      : 0..Infinite

        To add a file to the fast find index, just add an extra
        record to the end of this file.  File sharing should be
        DENYNONE + READWRITE

               attribute;
                 Bit 0 : Deleted
                    1-7: [Reserved]

 **********************************************************/

typedef struct FASTINDEXRECORD {
FileStr        name;
unsigned int   filepath;               // FILEPATH.EZY 1 ->
unsigned char  attribute;
long int       filesize;
} FASTINDEXRECORD;

/**********************************************************

       Filename      : <multipath>ONLINE.BBS

       Description   : Used by Ezycom to store online information

       Minimum Size  : 1 Record
       Maximum Size  : 250 Records

       Last Revised  : 1/2/94 (pwd)

       Notes         : While in a door, it is possible to give
                       Ezycom more information about the door.
                       This can be done by creating a file called
                       <systempath>USERDOES.<node>.

                       When Ezycom is waiting for a call from a
                       particular node, information can be displayed
                       in the who's online list.  By making a simple
                       1 line text file in <systempath>NODEINFO.<node>

               status;
                  0 - Active
                  1 - [Reserved]
                  2 - Downloading
                  3 - Uploading
                  4 - [Reserved]
                  5 - Message Browsing
                  6 - Door
                  7 - Chat with Sysop
                  8 - Chat with Other Users Channel 000
                  ...................................
                207 - Chat with Other Users Channel 199 (200 channels)
                208 - 252 [Reserved]
                253 - Node Not Active in Any Way
                254 - User Logging On
                255 - Waiting for Caller

              attribute : byte;
                Bit 0 - Quiet Do Not Disturb
                   1-7- [Reserved] 

 **********************************************************/

typedef struct ONLINERECORD {
UserString     name, 
               alias;
unsigned char  status,
               attribute;
long int       baud;
unsigned char  location[26];
long int       lasttimeupdated;        // This field should always be updated 
                                       // when the record is modified in ANY 
                                       // way by the user online. 
unsigned char  freespace[20];
} ONLINERECORD;

/**********************************************************

       Filename:     <multipath>MESSNODE.<node>

       Description:  Used by Ezycom for conferencing

       Minimum Size: 0 Records (Maybe not present!)
       Maximum Size: Unlimited

       Sharing:
            Writing: Denynone + WriteOnly
            Reading: Denyall + ReadWrite (Truncate after read)

 **********************************************************/

typedef struct MULTIMESSAGERECORD {
UserString     from;
unsigned int   fromnode;
unsigned char  message[81],
               privatemsg;             // boolean
} MULTIMESSAGERECORD;

/**********************************************************

       Filename:     <userbase>BESTSTAT.BBS

       Description:  Used by Ezycom to store best user stats

       Minimum Size: 0 Records (Maybe not present!)
       Maximum Size: 200 Records

 **********************************************************/

typedef struct BESTUSERRECORD {
UserString     bestname[7];            // BestName[1] is for BestMessages
                                       // BestName[2] is for BestCalls
                                       // .....
                                       // BestName[7] is for BestDownK 
unsigned int   bestmessages,
               bestcalls,
               bestups,
               bestdns,
               bestfps;
long int       bestupk,
               bestdownk;
} BESTUSERRECORD;

/**********************************************************

       Filename:     <msgpath>\AREA<(<area>-1)/4+1>\MH<area>.BBS
                     eg: \ezy\msgbase\area1\mh00001.bbs     for area 1
                     eg: \ezy\msgbase\area10\mh01001.bbs    for area 1001
                     eg: \ezy\msgbase\area100\mh10001.bbs   for area 10001

       Description:  Used by Ezycom to store message header

           msgattr,
               Bit 0 : Deleted
                   1 : Netmail pending export
                   2 : [Reserved]
                   3 : Private
                   4 : Received
                   5 : Echomail pending export
                   6 : Locally generated msg
                   7 : Do not kill message 

           netattr,
               Bit 0 : Kill/sent
                   1 : Sent
                   2 : File Attach
                   3 : Crash
                   4 : File Req
                   5 : Request Receipt
                   6 : Audit Request
                   7 : Is a Return Receipt 

           extattr   : byte;
               Bit 0-7 [Reserved] 

 **********************************************************/

typedef struct MSGHDRRECORD {
unsigned int   prevreply,
               nextreply;              // 0 = No Reply Chain 
long int       startposition,          // Physical Start Position in 
                                       // MSGT???.BBS 
               messagelength;          // Message Length including 
                                       // Null Terminator
NETRECORD      destnet,
               orignet;
unsigned int   cost;
unsigned char  msgattr,
               netattr,
               extattr;
long int       posttimedate,           // DOS Format Packed DateTime
               recvtimedate;           // DOS Format Packed DateTime
UserString     whoto,
               whofrom;
unsigned char  subject[73];
} MSGHDRRECORD;

/**********************************************************

       Filename:     <msgpath>\AREA<<area-1>/4+1>\MT<area>.BBS
                     eg: \ezy\msgbase\area1\mt00001.bbs     for area 1
                     eg: \ezy\msgbase\area10\mt01001.bbs    for area 1001
                     eg: \ezy\msgbase\area100\mt10001.bbs   for area 10001

       Description:  Used by Ezycom to store message text

 **********************************************************/

        /* Message Text

                Each text part of the message starts at 'startposition',
           and continues on until a NULL terminator is found, or end
           of file is reached (shouldn't happen, but just in case).
           Each message is contained of plain text, with 0x08D
           terminators for wrapped lines or 0x0D terminators for hard
           carriage returns.  No line of text should exceed 79 characters
           excluding the terminator */

/**********************************************************

       Filename:     <msgpath>MSGFAST.BBS

       Description:  Used by Ezycom for mail checks

 **********************************************************/

typedef struct MSGFASTRECORD {
long int       whoto;                  // standard 32 Bit CRC on whoto in 
                                       // MH???.BBS Username is CRCd in
                                       // UPPERCASE, and does not include 
                                       // null terminator or length byte 
unsigned int   msgboard,
               msgnumber;
} MSGFASTRECORD;

/**********************************************************

       Filename:     <msgpath>MSGEXPRT.BBS

       Description:  Used by Ezycom to tell EzyNet/EzyMail whether
                     an area needs scanning or not

 **********************************************************/

typedef unsigned char  NeedScanRecord[MAXMESS];    // boolean;

/**********************************************************

       Filename:     <msgpath>MSGREPLY.BBS

       Description:  Used by MsgComp/EzyLink to tell it which
                     conference(s) need reply chain
                     linking

 **********************************************************/

typedef unsigned char  NeedReplyType[MAXMESS];     // boolean;

/**********************************************************

       Filename:     <msgpath>MSGCOUNT.BBS

       Description:  Used by Ezycom and Utilities for
                     message area counting.
                     Reading the number of records of
                     MHxxx.BBS gives the same effect as
                     reading the conferences count.

 **********************************************************/

typedef unsigned int  MsgAreaCountType[MAXMESS];

/**********************************************************

       Filename:     <msgpath>MSGDLTD.BBS

       Description:  May or may not exist
                     Lists all the deleted messages on the
                     system.  MSGCOMP deletes the file since
                     it packs all the deleted messages.

 **********************************************************/

typedef struct MSGDELETERECORD {
unsigned int   msgboard,
               msgnumber;
} MSGDELETERECORD;

/**********************************************************

       Filename:     <systempath>MESSAGES.EZY

       Description:  Used by Ezycom to store message areas

       Size:         1024 records

           attribute,
              Bit 0 : Allow Aliases
                  1 : Use Alias
                  2 : Use Alias, Ask for Aliases
                  3 : Test Age (use config age)
                  4 : Combined Area Access
                  5 : Local File attaches
                  6 : Keep Private Bit on Incoming EchoMail
                  7 : Security *)

           attribute2,
              Bit 0 : Show Seenby Lines
                  1 : Forced Mail Check
                  2 : Tiny Seenbys
                  3-4 [Reserved]
                  5 : Areafix Info Visible
                  6 : Initial Combined Area Access
                  7 : Do Not Use in Template *)

           attribute3     : byte;
                0-7: [Reserved]
 **********************************************************/

typedef struct MESSAGERECORD {
unsigned char  name[31],
               areatag[31],
               qwkname[13];
MsgType        typ;
MsgKindsType   msgkinds;
unsigned char  attribute,
               attribute2,
               attribute3,
               dayskill,
               recvkill;
unsigned int   countkill,
               kilobytekill;
SECURITYTYPE   readsecurity,
               writesecurity,
               sysopsecurity;
unsigned char  minimumage,
               originline[51],
               originaddress,
               seenby[MAXAKA/8],
               areagroup,
               messgroup,     
               echomailfeed,           // 0=No Uplink
               destnodes[MAXNODES/8],   // Nodes  1 to  8 - DestNode[1]
                                       // Nodes  9 to 16 - DestNode[2]
                                       // Nodes 17 to 24 - DestNode[3]
               freespace[1..32];
} MESSAGERECORD;

/**********************************************************

       Filename:     <systempath>ECHOMGR.EZY

       Description:  Used by Ezycom to store node information

       Last Update:  1/2/94

       Size:         128 records

           compress
              0 : Compress to ZIP
              1 : Compress to LZH
              2 : Compress to ARJ
              3 : Compress to ARC
              4 : Compress to PAK
              5 : Compress to ZOO
              6 : Compress to SQZ 

           attribute  
              Bit 0 : Node Active
                  1 : Crash Mail
                  2 : Hold Mail
                  3 : Can Create New Echos
                  4 : Add to Export on New Echo
                  5 : Can Delete/Rename Areas
                  6 : Direct Mail (Off=Routed Mail)
                  7 : Allow 2D Security)

           sendpkttype
              0 : Type 2
              1 : Type 2+
            2-255 [Reserved]

 **********************************************************/

typedef struct ECHOMGRRECORD {
NETRECORD      destnet;
DomainStr      domain;
unsigned int   redirectto;
GroupType      groups;                 // compressed groups A thru Z 
unsigned char  compress, 
               attribute,
               passwordto[21],
               passwordfr[21],
               dayshold,
               sendpkttype;
unsigned int   maxpktsize,
               maxarcksize;
unsigned char  arealist[65],
               pktpassword[9],
               freespace[33];
} ECHOMGRRECORD;

/**********************************************************

       Filename:     EVENTS.EZY (multinode file)

       Description:  Used by Ezycom to store event information

       Minimum Size: 1 record
       Maximum Size: 65000 records

           attribute   
               Bit 0 = Enabled

           days        
               Bit 0 : Sunday
                   1 : Monday
                       ...
                   6 : Saturday
                   7 : [ Reserved ] 

 **********************************************************/

typedef struct EVENTRECORD {
unsigned char  attribute;
unsigned int   starttime;              // Hi Byte=Hour,Low Byte=Min
unsigned char  errorlevel,
               days;
unsigned int   lasttimerun;
} EVENTRECORD;

/**********************************************************

       Filename:    <systempath>TODAY.BBS
                    <systempath>YESTER.BBS

       Last Update: 1/2/94

       Description: Used by Ezycom to today's/yesterday's callers

          didwhat
           Bit 0 : (N) NewUser
               1 : (U) Upload
               2 : (D) Download
               3 : (R) Read Mail
               4 : (S) Sent Mail
               5 : (O) Outside
               6 : (C) Chat to Sysop and/or User
               7 : (P) Paged 

 **********************************************************/

typedef struct ONTODAYRECORD {
unsigned char  line;
UserString     name,
               alias;
unsigned char  location[26];
unsigned long  baudrate;
unsigned int   logontime,
               logofftime;
unsigned char  didwhat;
unsigned char  freespace[20];
} ONTODAYRECORD;

/**********************************************************

       Filename:    <systempath>TIME<node>.BBS

       Description: Used by Ezycom to store usage information

 **********************************************************/

typedef struct USEAGERECORD {
unsigned int   startdate;
long int       busyperhour[24],        // Minutes Used 
               busyperday[7];          // Minutes Used
} USEAGERECORD;

/**********************************************************

       Filename:    <systempath>MSGINFO.<node>

       Description: Used by Ezycom and EzyEdit to interface to
                    each other

          returnstatus 
               0 : FSE Record Not Used
               1 : Message Saved
               2 : Message Aborted
               3 : User  Inactivity
               4 : User  Hungup
               5 : Sysop Hungup
           6-255 : Reserved 

          attribute    
               Bit 0 : Can Change Subject
                   1 : Can Change Whoto
                   2 : Can Change Private
                   3 : Private Message
                   4 : Is Message Forwarded (False = Quoted)
                       (Providing MSGTMP.<node> exists)
                   5 : Netmail Message
                   6 : Avatar Capable (ANSI if not set)
                   7 : EchoMail Message   

 **********************************************************/

typedef struct FSERECORD {
UserString     whofrom;                // User Who wrote message 
NETRECORD      orignet;                // From Net Address 
UserString     whoto;                  // User Who message is to
NETRECORD      destnet;                // To Net Address 
unsigned char  subject[73],            // Subject of message 
               returnstatus,           // Return Status 
               attribute;
long int       baudrate,               // Effective Baudrate 
               lockedbaud;             // Locked Baudrate 
unsigned int   comport;
unsigned char  screenlength;
unsigned int   timeleft;
} FSERECORD;

/**********************************************************

       Filename:    <msgbasepath>MSGRSCAN.BBS

       Description: Used by EzyNet and EzyMail for Rescanning a
                    Message Area for a particular node

 **********************************************************/

typedef struct RESCANRECORD {
unsigned char  nodetorescan;
unsigned int   msgboard;
} RESCANRECORD;

/**********************************************************

       Filename:    <msgbasepath>MSGSTATS.BBS

       Description: Written by EzyMail for echomail statistics

 **********************************************************/

typedef struct MSGSTATSRECORD {
unsigned int   tossedboard[MAXMESSALL],  // Number of Messages Tossed to Msg 
                                         // Board 
               scannedboard[MAXMESSALL]; // Number of Messages Tossed to Msg 
                                         // Board
long int       tossednode[MAXNODES];     // Number of Messages Tossed to 
                                         // EchoArea Node 
} MSGSTATSRECORD;

/**********************************************************

       Filename:    <systempath>EXITINFO.<node>

       Description: Used by Ezycom in Type 15 exits to return
                    Used by Ezycom in Type 7 exits for door
                       information

       Last Revised : 16/1/94(pwd)

       dayofnextevent
              0 = Sunday
              ..........
              6 = Saturday
              7 = NOEVENT 

          mtasker 
             Time Slice Routine to use
                0 = No Multitasker
                1 = [Reserved]
                2 = Desqview
                3 = Double DOS
                4 = OS/2 or Windows
                5 = MultiDOS Plus
                6 = Windows 3.1
           7..255 = [Reserved] *)

          iemsi_req1,
              Bit 0 = News
                  1 = Mail
                  2 = File
                  3 = Clrscr
                  4 = Quiet
                  5 = More
                  6 = FSE
                  7 = [Reserved] 

          iemsi_req2,
              Bit 0-7 = [Reserved] 

          iemsi_prot,
              Bit 0 = ZModem
                  1 = SEAlink
                  2 = Kermit
                  3 = ZedZap

          iemsi_crt,
              0 = TTY
              1 = ANSI
              2 = AVT0+
              3 = VT100
              4 = VT52 *)

          iemsi_cap    
              Bit 0 = CHT
                  1 = MNU
                  2 = TAB
                  3 = ASCII8 

 **********************************************************/

typedef struct EXITINFORECORD {
unsigned int      oldbaud;             // Effective Baud Rate
unsigned int      oldlockedbaud;       // Speed between Modem/Modem
unsigned char     comport;             // Comport 1 = Com1, etc
unsigned int      efficiency,          // Baud Rate efficiency
                  userrecord;          // User Record Number (0=User1)

USERSRECORD       userinfo;

USERSEXTRARECORD  userextra;

UserString        sysopname,
                  sysopalias;
unsigned char     system[41];
unsigned int      downloadlimit,       // Maximum Download Limit 
                  timelimit,           // Daily Time Limit 
                  timetakenevent;      // Number of Minutes Taken from User 
                                       // for Event
long int          timecreated,         // Number of Seconds since Midnight 
                  timeofnextevent,     // Number of Seconds since Midnight 
                  timetillnextevent;   // Number of Seconds after Time Created
unsigned char     dayofnextevent,
                  errorlevelofnextevent, // Errorlevel to return from next 
                                         // event 
                  ratio;               // File Ratio 
unsigned int      credit;              // File Ratio Credit
unsigned char     ratiok;              // Kilobyte Ratio
unsigned int      creditk,             // Kilobyte Ratio Credit
                  regodays,            // Registration Days 
                  creditmess,          // Post Call Ratio Credit
                  mess;                // Post Call Ratio 
DATETIME          logintimedate;       // Login Datetime 
Str8              stack[20];           // Menu Stack 
unsigned char     stackpos;            // Menu Stack Position (0 = No Stack) 
Str8              curmenu;             // Current Menu
unsigned char     oldpassword[16];
unsigned int      limitrecnum;         // Limits Record Being Used 
unsigned char     baudrecnum,          // BaudRate Record Being Used
                  ripactive,           // boolean;
                  maxpages,            // Maximum Pages 
                  pagedsysop,          // Number of Times User has Paged Sysop
                  wantchat;            // boolean;
unsigned int      pagestart,
                  pageend;             // Number of Seconds since Midnight 
unsigned char     pagelength,          // Page Length 
                  echoentered,         // boolean
                  netentered,          // boolean
                  nextsysop;            // boolean
unsigned int      inactivitytime;       // Seconds 
unsigned char     protrecnum,          // Default Protocol Record Number 
                                       // 0=NoDefault 
                  protname[16],        // Default Protocol Name 
                  didwhat,             // Didwhat flag for Todays Callers
                  pagereason[61],
                  mtasker,       
                  iemsi_session,       // boolean;
                  iemsi_req1,
                  iemsi_req2,
                  iemsi_scrlen,        // Screen Length for current session
                                       // If NOIEMSI session, this is set to 
                                       // the users screen length 
                  iemsi_prot,
                  iemsi_crt,
                  iemsi_cap,
                  pagesound;           // boolean;
long int          timeconnect;         // time connected this call 
unsigned char     screenon;            // boolean - whether ezycom is
                                       // displaying the screen locally or not
unsigned long     baud;                // Effective Baudrate
unsigned long     lockedbaud;          // Speed between Computer/Modem
unsigned long     freespace[86];
} EXITINFORECORD;

typedef struct SYSINFORECORD {
long int        callcount;
UserString      lastcaller;
long int        filessizek;             // Updated by EzyIDX -BUILD
unsigned int    newusers,
                newfiles,
                newmessages;           // Does NOT include Inbound Echomail 
UserString      lastalias;
unsigned int    laststarttime;         // The start of the last session by 
                                       // a user
unsigned char   extraspace[80]; 
} SYSINFORECORD;

/**********************************************************

       Filename     : <nodelistpath>EZYINDEX.<nodelistnum>

       Description  : Stores Nodelist Information

       Min Size     : File Not Exist

       Max Size     : 65000 Records

       Last Revised : 3/1/94(pwd)

       Sharing      : Reading       - DenyNone + ReadOnly
                      Insert/Update - Never (EzyNode does it)

 **********************************************************/

typedef struct NODELISTRECORD {
unsigned char  nodelistfile;
long int       position;
unsigned int   zone,
               net;
} NODELISTRECORD;

/**********************************************************

       Filename     : <nodelistpath>EZYINDEX.00

       Description  : AkaIndex is a pointer to which EZYINDEX.<nodelist num>
                         is used for that Aka.
                      NodelistFileRecord holds information to a particular
                         nodelistfile.  (nodelistfile byte in nodelistrecord).

       Min Size     : AkaIndex + 1 NodelistFileRecord

       Max Size     : AkaIndex + 255 NodelistFileRecords

       Last Revised : 3/1/94(pwd)

       Sharing      : Reading       - DenyNone + ReadOnly
                      Insert/Update - Never (EzyNode does it)

 **********************************************************/


typedef unsigned char  AkaIndex[MAXAKA];

typedef struct NODELISTFILERECORD {
unsigned char  nodelistpath[80];
DomainStr      domain;
} NODELISTFILERECORD;

/**********************************************************

       Filename     : <nodelistpath>EZYINDEX.COS

       Description  : Lists all the phone number costing factors

       Min Size     : 1 Record (Default Cost)

       Max Size     : Unlimited

       Last Revised : 3/1/94(pwd)

       Sharing      : Reading       - DenyNone + ReadOnly
                      Insert/Update - Never (EzyNode does it)

 **********************************************************/

typedef struct COSTRECORD {
unsigned char  phonenum[26];
unsigned int   cost;
} COSTRECORD;

/**********************************************************

       Filename     : <systempath>RUMOURS.BBS

       Description  : Stores Rumour Information

       Min Size     : File Not Exist

       Max Size     : 65000 Records

       Last Revised : 27/3/93(pwd)

       Sharing      : Reading       - DenyNone + ReadOnly
                      Insert/Update - DenyWrite + ReadWrite

 **********************************************************/

typedef struct RUMOURRECORD {
unsigned char  userinput[71],
               compiled[101];
UserString     username;
unsigned int   lastupdate;
unsigned char  freespace[46];
} RUMORRECORD;

/**********************************************************

       Filename     : <systempath>LANGUAGE.EZY

       Description  : Language Information Setup

       Min Size     : 1 Record

       Max Size     : 255 Records

       Last Revised : 7/1/94(pwd)

       Sharing      : Reading       - DenyNone + ReadOnly
                      Insert/Update - DenyWrite + ReadWrite

 **********************************************************/

typedef struct LANGUAGERECORD {
unsigned char  langname[9],
               description[61],
               rippath[61],
               avtpath[61],
               ansipath[61],
               ascpath[61],
               aslpath[61],
               g1path[61],
               g2path[61],
               g3path[61],
               mnupath[61],
               mnu2path[61];
SECURITYTYPE   security;
unsigned char  freespace[334];
} LANGUAGERECORD;


/*************************************************************************/
/* Some sample C Src to replicate most of the functions shown in the     */
/* Pascal version of the EzyCom Structures  (Turbo/Borland)              */
/*************************************************************************/

/**********************************************************
 * Determine if a file or path exists.
 * Returns 1 if true and 0 if false.
 * To check a path do NOT include the trailing backslash.
 * Note: You could use "findfirst()" for this also.
 *
 * eg: if(exists(filepath)) do_something(); else is_error();
 **********************************************************/
int exists(char *filepath)
{
    return( access( filepath, 0 ) == 0 );
}

/**********************************************************
 * Check if file path has a trailing backslash.
 * It is assumed you won't be stupid enough to pass a NULL
 * length string.
 *
 * eg: fixslash(pathstring);
 **********************************************************/
void fixslash(char *s)
{
         while(*s) s++;                       /* Move to EOS */
         if(*(--s) == '\\') return;          /* If Ok return */
    *(++s) = '\\';                       /* Else Add Slash */
    *(++s) = '\0';                       /* Terminate String */
}

/**********************************************************
 * Locate the Config.xxx file
 *
 * The parameter "node" should be declared globaly and
 * initialized to "1" if not otherwise declared either
 * by your own program or the "TASK" environment variable.
 * Note: It's up to you to check these two things.
 *
 * eg: if((pntr=findc(2))==NULL) is_error();
 **********************************************************/
char *findc1(int node)
{
    char p[128];                                  /* Temp String Pointer */
    static char path[128];                        /* To store the location */
    char *s[] = {"CONFIG.1","CONFIG.EZY"};

    strcpy(p,getenv("EZY"));                      /* Get EZY Environment value */
    fixslash(p);                                  /* Make sure theres a backslash */

    if(node > 1 && node < 251) sprintf(s[0],"CONFIG.%d",node);

    if(strlen(p) > 1)                             /* If environment path set */
    {
        strcpy(path,p);
        strcat(path,s[0]);
        if(exists(path)) return(path);            /* Env Path + Config.xxx */

        strcpy(path,p);
        strcat(path,s[1]);
        if(exists(path)) return(path);            /* Env Path + Config.Ezy */
    }

    strcpy(path,s[0]);
    if(exists(path)) return(path);                /* Config.xxx in CurDir */

    strcpy(path,s[1]);
    if(exists(path)) return(path);                /* Config.Ezy in CurDir */

    return(NULL);                                 /* Unable to locate config.xx */
}

char *findc2(void)
{
    char p[128];                                  /* Temp String Pointer */
    static char path2[128];                        /* To store the location */
    char *s = {"CONSTANT.EZY"};

    strcpy(p,getenv("EZY"));                      /* Get EZY Environment value */

    fixslash(p);                                  /* Make sure theres a backslash */

    if(strlen(p) > 1)                             /* If environment path set */
    {
        strcpy(path2,p);
        strcat(path2,s);
        if(exists(path2)) return((char*)&path2);            /* Env Path + Config.xxx */
    }

    strcpy(path2,s);
    if(exists(path2)) return(path2);                /* Config.Ezy in CurDir */

    return(NULL);                                 /* Unable to locate config.xx */
}

char *finde(int node)
{
    char p[128];                                  /* Temp String Pointer */
    static char pathe[128];                        /* To store the location */
    char *s = {"EXITINFO.1"};

    strcpy(p,getenv("EZY"));                      /* Get EZY Environment value */

    fixslash(p);                                  /* Make sure theres a backslash */

    if(node > 1 && node < 251) sprintf(s,"EXITINFO.%d",node);

    if(strlen(p) > 1)                             /* If environment path set */
    {
        strcpy(pathe,p);
        strcat(pathe,s);
        if(exists(pathe)) return((char*)&pathe);            /* Env Path + Config.xxx */

    }

    strcpy(pathe,s);
    if(exists(pathe)) return(pathe);                /* Config.Ezy in CurDir */

    return(NULL);                                 /* Unable to locate config.xx */
}

char *findm(void)
{
    char p[128];                                  /* Temp String Pointer */
    static char pathm[128];                        /* To store the location */
    char *s = {"MESSAGES.EZY"};

    strcpy(p,getenv("EZY"));                      /* Get EZY Environment value */

    fixslash(p);                                  /* Make sure theres a backslash */

    if(strlen(p) > 1)                             /* If environment path set */
    {
        strcpy(pathm,p);
        strcat(pathm,s);
        if(exists(pathm)) return((char*)&pathm);  /* Env Path + Config.xxx */
    }

    strcpy(pathm,s);
    if(exists(pathm)) return(pathm);                /* Config.Ezy in CurDir */

    return(NULL);                                 /* Unable to locate config.xx */
}


char *findf(void)
{
    char p[128];                                  /* Temp String Pointer */
    static char path[128];                        /* To store the location */
    char *s = {"FILES.EZY"};

    strcpy(p,getenv("EZY"));                      /* Get EZY Environment value */

    fixslash(p);                                  /* Make sure theres a backslash */

    if(strlen(p) > 1)                             /* If environment path set */
    {
        strcpy(path,p);
        strcat(path,s);
        if(exists(path)) return((char*)&path);            /* Env Path + Config.xxx */
    }

    strcpy(path,s);
    if(exists(path)) return(path);                /* Config.Ezy in CurDir */

    return(NULL);                                 /* Unable to locate config.xx */
}

char *findfp(void)
{
    char p[128];                                  /* Temp String Pointer */
    static char pathp[128];                        /* To store the location */
    char *s = {"FILEPATH.EZY"};

    strcpy(p,getenv("EZY"));                      /* Get EZY Environment value */

    fixslash(p);                                  /* Make sure theres a backslash */

    if(strlen(p) > 1)                             /* If environment path set */
    {
        strcpy(pathp,p);
        strcat(pathp,s);
        if(exists(pathp)) return((char*)&pathp);            /* Env Path + Config.xxx */
    }

    strcpy(pathp,s);
    if(exists(pathp)) return(pathp);                /* Config.Ezy in CurDir */

    return(NULL);                                 /* Unable to locate config.xx */
}

/**********************************************************
 * Check for a valid date
 *
 * Returns 1 if a valid date and 0 if not.
 *
 * eg: if(!checkdate(1992,1,1)) do_nothing();
 **********************************************************/
int checkdate(unsigned int yy, unsigned int mm, unsigned int dd)
{
    int days[] = {31,29,31,30,31,30,31,31,30,31,30,31};

    if( mm < 1 || mm > 12) return(0);                        /* Invalid Month */
    if( dd < 1 || dd > days[mm-1]) return(0);                /* Invalid Day */
    if(yy < 1900) return(0);                                 /* Your to Old */
    if(((yy%4) != 0) && (dd == 29) &&  (mm == 2)) return(0); /* Tryin to fool me */

    return(1);                                               /* Everything must be valid */
}

/**********************************************************
 * Convert a Date to an Int
 *
 * Returns the converted date on success or 65535 on failure.
 *
 * eg: intdate = dat2int(1992,1,1);
 **********************************************************/
unsigned int dat2int(unsigned int yy, unsigned int mm, unsigned int dd)
{
    unsigned int  tofield=0;

    if(!checkdate(yy,mm,dd) || yy < 1980 || yy > 2107) return(65535);

    tofield = dd-1;
    tofield = tofield + ((mm-1) << 5);
    tofield = tofield + ((yy-1980) << 9);

    return(tofield);
}

/**********************************************************
 * Convert an Int to a Date
 *
 * Returns the converted date in the variables yy,mm,dd
 * and a true false value in relation to the conversion.
 *
 * eg: if(!int2dat(intdate,&year,&mon,&day)) is_error();
 **********************************************************/
int int2dat(unsigned int dat, unsigned int *yy, unsigned int *mm, unsigned int *dd)
{
    unsigned int temp=dat;

    if(dat == 65535) return(0);          /* Invalid Date */

    *dd = (temp & 31) + 1;
    temp >>= 5;
    *mm = (temp & 15) + 1;
    temp >>= 4;
    *yy = (temp & 127) + 1980;
    return(1);                         /* Conversion OK */
}

/**********************************************************
 * Convert a Date and Time to a Long (DOS Packed DateTime)
 *
 * Returns the converted date on success or 0 on failure.
 *
 * eg: longdate = dat2int(1992,1,1,12,53,50);
 **********************************************************/
unsigned long dat2long(unsigned int year, unsigned int month, unsigned int day,
                       unsigned int hour, unsigned int min,   unsigned int sec)
{
    unsigned long  todatefield,totimefield,tofield;

    if(!checkdate(year,month,day) || year < 1980 || year > 2107) return(0);

    todatefield = day;
    todatefield = tofield + ((month) << 5);
    todatefield = tofield + ((year-1980) << 9);

    totimefield = (sec >> 1) + (min << 5) + (hour << 12);

    totimefield = totimefield + (todatefield << 16);

    return(totimefield);
}

