home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / TGARTS.ZIP / TGDEV309.ZIP / TELEGARD.H < prev    next >
C/C++ Source or Header  |  1997-11-06  |  98KB  |  1,910 lines

  1. /*****************************************************************************/
  2. /*>                                                                         <*/
  3. /*>                     Telegard Bulletin Board System                      <*/
  4. /*>          Copyright 1995,1997 by Tim Strike.  All rights reserved.       <*/
  5. /*>                                                                         <*/
  6. /*>                      Data types and structures                          <*/
  7. /*>                                                                         <*/
  8. /*****************************************************************************/
  9. /*****************************************************************************/
  10. /* --------------- IMPORTANT NOTICE -- PLEASE READ CAREFULLY --------------- */
  11. /*****************************************************************************/
  12.  
  13. /*                                                        November 5, 1997
  14.  
  15.    Note to all Telegard 3.1 developers:
  16.  
  17.    These structures represent the release structures for 3.09.g1, and 
  18.    subsequently, the preliminary release structures for 3.10.  While there 
  19.    is still some work to be done, we hope that these structures will be 
  20.    very close to the final release structures (another package will be 
  21.    assembled in any event for Telegard 3.10 final release).
  22.    
  23.    PLEASE FEEL FREE TO UPDATE YOUR UTILITIES FOR THE 3.09 GAMMA SERIES; BUT 
  24.    DO NOT PRESUME THEY WILL WORK FOR THE 3.10 SERIES AS CHANGES TO THESE 
  25.    STRUCTURES MIGHT STILL BE REQUIRED.
  26.  
  27.    These structures may be used to modify and create new programs which
  28.    will be compatible with Telegard 3.09.g1.  Enclosed with this structure 
  29.    kit are several documents which outline the various data file formats 
  30.    that Telegard 3.09.g1 uses.  The development documentation, 
  31.    DEVEL309.DOC, has many helpful hints and information regarding most of 
  32.    the data file which Telegard uses -- please read it before attempting to 
  33.    use the data structures.
  34.  
  35.    The structures have been commented as best as possible.  If you need 
  36.    more information on how to use/access data within these structures, 
  37.    please see the accompanying documentation for contact methods.
  38.  
  39.    Thanks for your interest in Telegard 3.1.  Utility developers who wish
  40.    more information regarding distribution should look at the accompanying
  41.    documentation -- there are several helpful areas which should be read.
  42.  
  43.    We can use all the questions, comments and ideas that you can think of.
  44.  
  45.    Thanks,
  46.    Telegard 3.1 Development Team
  47. */
  48.  
  49. #ifndef __TELEGARD_H
  50. #define __TELEGARD_H
  51.  
  52. /*****************************************************************************/
  53. /* ----------------------- CONSTANT DEFINITIONS ---------------------------- */
  54. /*****************************************************************************/
  55.  
  56. #define TG_VERSION          0x0309     /* TG's version this header is for */
  57.  
  58. #define MAXWORD             65535      /* maximum for "Turbo Pascal" word */
  59.  
  60. #define MAXARCS             10         /* archive commands (1..max) */
  61. #define MAXPROTOCOL         26         /* protocol records (A..Z)   */
  62. #define MAXLEVEL            26         /* level records (A..Z)      */
  63. #define MAXEVENTS           16         /* scheduled events (0..max) */
  64.                                        /* 0 = -X[n] cmd (RESERVED)  */
  65. #define MAXMENUCMDS         75         /* menu commands (1..max) */
  66. #define MAXQUEUE            50         /* queue storage (1..max) */
  67. #define NUMVOTEAS           16         /* voting answers (0..max) */
  68. #define NUMVOTEQS           20         /* voting questions (1..max) */
  69. #define MAXFDESCLEN         1250       /* file description (1..max) */
  70.  
  71. #define MJAM                1          /* JAM format */
  72. #define MSQUISH             2          /* Squish format */
  73.  
  74. #define MLOCAL              1          /* Local */
  75. #define MNETMAIL            2          /* Netmail */
  76. #define MECHOMAIL           3          /* Echomail */
  77.  
  78. #define MPUBLIC             1          /* Public Messages */
  79. #define MPRIVATE            2          /* Private Messages */
  80.  
  81. #define SIGNONE             0          /* No signatures allowed */
  82. #define SIGSHORT            1          /* Short signatures allowed */
  83. #define SIGLONG             2          /* Long signatures allowed */
  84.  
  85. #define ATNO                1          /* No anonymous allowed */
  86. #define ATYES               2          /* Anonymus allowed */
  87. #define ATFORCED            3          /* Forced anonymous */
  88. #define ATDEARABBY          4          /* "Dear Abby" message area */
  89. #define ATANYNAME           5          /* Anyname posting */
  90. #define ATREALNAME          6          /* Realname/handle select */
  91.  
  92.                                        /* Track anonymous with: */
  93. #define ATTRACKNAME         1          /* Name (^aREALNAME: kludge) */
  94. #define ATTRACKID           2          /* UserID (From=Anonymous (An####)) */
  95. #define ATTRACKNONE         3          /* None (lose poster info) */
  96.  
  97. #define FSNONE              0          /* File Sorting Constants */
  98. #define FSFILENAME          1          /*   Ascending Sort = positive */
  99. #define FSFILEDATE          2          /*  Descending Sort = negative */
  100. #define FSFILESIZE          3
  101. #define FSFILEPOINTS        4
  102. #define FSULDATE            5
  103. #define FSFILEEXT           6
  104. #define FSDLDATE            7
  105. #define FSTIMESDL           8
  106. #define FSULNAME            9
  107.  
  108. #define LOGFRONTDOOR        0          /* Logging Style Constants */
  109. #define LOGBINKLEY          1
  110.  
  111. /*---------------------------------------------------------------------------*/
  112.  
  113. typedef unsigned char boolean;         /* Turbo Pascal "boolean" */
  114. typedef unsigned char byte;            /* Turbo Pascal "byte" */
  115. typedef signed short int integer;      /* Turbo Pascal "integer" */
  116. typedef signed char shortint;          /* Turbo Pascal "shortint" */
  117. typedef signed long int longint;       /* Turbo Pascal "longint" */
  118. typedef unsigned char string;          /* Turbo Pascal "string" */
  119. typedef unsigned short int word;       /* Turbo Pascal "word" */
  120. typedef unsigned int bit;              /* shorthand for C bit fields */
  121.  
  122. /*****************************************************************************/
  123. /* ------------------------ TYPE DEFINITIONS ------------------------------- */
  124. /*****************************************************************************/
  125.  
  126. typedef string acstring[41];           /* Access Control system string */
  127. typedef string datestring[9];          /* date string MM/YY/YY */
  128. typedef integer intrange[256];         /* security tables - integers */
  129. typedef byte byterange[256];           /* security tables - bytes */
  130.  
  131. typedef longint unixtime;              /* unix time stamp - seconds */
  132.                                        /* since 01/01/70 */
  133.  
  134. typedef byte acrq[4];                  /* AR Flags */
  135. typedef acrq acrqs;                    /* AR Flags set */
  136.  
  137. typedef struct          /* user AC flags */
  138. {
  139.     bit rlogon : 1;                    /* L - One call per day */
  140.     bit rchat : 1;                     /* C - Can't page the SysOp */
  141.     bit rnetmaildel : 1;               /* F - Force Netmail deletion */
  142.     bit ramsg : 1;                     /* A - Can't post AutoMessage */
  143.     bit rpostan : 1;                   /* * - Can't post anonymously */
  144.     bit rpostpvt : 1;                  /* E - Can't post private */
  145.     bit rpostnet : 1;                  /* N - Can't post NetMail */
  146.     bit rpost : 1;                     /* P - Can't post at all */
  147.     bit rvoting : 1;                   /* K - Can't vote */
  148.     bit rmsg : 1;                      /* M - Forced email deletion */
  149.     bit rpostecho : 1;                 /* G - Can't post EchoMail */
  150.     bit fnodlratio : 1;                /* 1 - No UL/DL ratio */
  151.     bit fnopostratio : 1;              /* 2 - No post/call ratio */
  152.     bit fnofilepts : 1;                /* 3 - No file points checking */
  153.     bit fnodeletion : 1;               /* 4 - Protection from deletion */
  154.     bit fnodailyratio : 1;             /* 5 - No daily DL ratio */
  155.     bit fnodltime : 1;                 /* 6 - No DL time check */
  156.     bit fnopwchange : 1;               /* 7 - No forced pw change */
  157.     bit ftimepercall : 1;              /* 8 - Time on per call basis */
  158.     bit fnopwalert : 1;                /* 9 - No password alert msg */
  159. }
  160. uflags;
  161.  
  162. typedef struct          /* Bitmapped date format */
  163. {
  164.     word date;                         /* date  5432109876543210 */
  165.                                        /*       Y------M---D---- */
  166.     word time;                         /* time  5432109876543210 */
  167.                                        /*       H----M-----S---- */
  168. }
  169. bitmapdate;
  170.  
  171.  
  172. /*****************************************************************************/
  173. /* ------------------- CONFIGURATION DATA STRUCTURES ----------------------- */
  174. /*****************************************************************************/
  175.  
  176. typedef struct          /* CONFIG.TG - System configuration */
  177. {
  178.     word versionid;                    /* version (eg 0x0309 = v3.09) */
  179.     string datapath[80];               /* DATA path */
  180.     string textpath[80];               /* TEXT path */
  181.     string langpath[80];               /* LANGUAGES path */
  182.     string menupath[80];               /* MENUS path */
  183.     string logspath[80];               /* LOG path */
  184.     string msgpath[80];                /* MSGS path */
  185.     string semaphore[80];              /* SEMAPHORE path */
  186.     string attchpath[80];              /* FILE ATTACH path */
  187.     string swappath[80];               /* SWAP path */
  188.     string arcpath[41];                /* ARCHIVE path */
  189.     string protpath[41];               /* PROTOCOL path */
  190.     string filepath[80];               /* FILE path */
  191.     string scriptpath[80];             /* SCRIPT path */
  192.     byte reserved1[40];                /* RESERVED */
  193.  
  194.     string bbsname[81];                /* BBS name */
  195.     string bbsphone[21];               /* BBS phone number */
  196.     string bbslocation[51];            /* BBS location */
  197.     string sysopname[31];              /* SysOp's full name or alias */
  198.     boolean multinode;                 /* System is Multinode? */
  199.     string bulletprefix[9];            /* default bulletin prefix */
  200.     boolean highbitinfo;               /* High-bit in user info? */
  201.     byte nodecheck;                    /* NodeCheck threshold (s) */
  202.     boolean nodetask;                  /* Node from TASK environment */
  203.                                        /*   if -Nnn not specified */
  204.     boolean hiddenpw;                  /* Passwords are hidden?
  205.                         1. Always verify passwords
  206.                            against user.pwcrc
  207.                         2. TRUE  user.pwtext=''
  208.                         3. FALSE check user.pwcrc
  209.                            if crc(input)=user.pwcrc
  210.                            then set user.pwtext=pw
  211.                         4. If changing pw, always
  212.                            update CRC field -- VERY
  213.                            important! */
  214.     byte reserved2[4];                 /* RESERVED  */
  215.     boolean localtimeout;              /* local timeout logoff? */
  216.     string sysoppw[21];                /* SysOp PW */
  217.     byte timeoutbell;                  /* minutes before timeout bell */
  218.     byte timeout;                      /* minutes before timeout logoff */
  219.     byte backsysoplogs;                /* days to keep SYSOP##.LOG */
  220.     byte slogtype;                     /* SysOp log type
  221.                                                 0 - File
  222.                                                 1 - Printer
  223.                                                 2 - Both */
  224.     boolean stripclog;                 /* strip colors from SysOp log? */
  225.  
  226.     boolean compressmsgs;              /* compress msg area numbers? */
  227.     boolean compressfiles;             /* compress file area numbers? */
  228.     byte slogstyle;                    /* SysOp log style
  229.                                              0 - FrontDoor
  230.                                              1 - Binkley */
  231.     byte reserved2a[2];                /* RESERVED */
  232.  
  233.     /*
  234.        The following two variables are used for scan record calculation-- 
  235.        these determine how much space to reserve for each users scan 
  236.        records.
  237.  
  238.         * The resvfileareas/resvmsgareas are the actual values that are
  239.           currently reserved.  THESE TWO VARIABLES SHOULD BE USED FOR ALL
  240.           CALCULATIONS DEALING WITH SCAN RECORDS!  Telegard can only
  241.           support up to resv...areas*8, DO NOT ADD MORE AREAS THAN THIS!
  242.  
  243.        NEITHER VARIABLE SHOULD BE CHANGED BY EXTERNAL UTILITIES!!!
  244.     */
  245.     word resvfileareas;                /* Reserved number of areas */
  246.     word resvmsgareas;                 /* DO NOT CHANGE! */
  247.  
  248.     byte reserved3[92];                /* RESERVED */
  249.  
  250.     word audiolowtime;                 /* Allow audio hours */
  251.     word audiohitime;
  252.     boolean monoscreen;                /* Monochrome screen */
  253.     boolean useems;                    /* use EMS for overlay */
  254.     boolean usebios;                   /* use BIOS for local video output */
  255.     boolean cgasnow;                   /* Suppres snow on CGA systems */
  256.     byte screensize;                   /* Screen size
  257.                                                 0 - Default/Auto
  258.                                                 1 - 25
  259.                                                 2 - 28  (VGA)
  260.                                                 3 - 43/50 (EGA/VGA) lines*/
  261.     byte wfcblanktime;                 /* minutes to blank WFC screen */
  262.     byte printerport;                  /* printer port (1-3) */
  263.     byte openfiledelay;                /* OpenFile delay b/w attempts */
  264.     byte openfileatt;                  /* OpenFile attempts */
  265.     byte openfiletimeout;              /* OpenFile timeout message */
  266.     byte openfileabort;                /* OpenFile timed abort */
  267.     byte reserved4[20];                /* RESERVED */
  268.  
  269.     byte chatpagelen;                  /* Page length in seconds */
  270.     byte chatattempts;                 /* # of chat attempts */
  271.     byte sysopcolor;                   /* SysOp chat color */
  272.     byte usercolor;                    /* User chat color */
  273.     boolean chatreason;                /* ask for a chat reason? */
  274.     boolean chattime;                  /* refund chat time? */
  275.     string externalchat[80];           /* External chat command */
  276.     byte chatdoortype;                 /* Chat door file type: */
  277.                                        /*   0: none        3: WWIV */
  278.                                        /*   1: GAP         4: PCBoard  */
  279.                                        /*   2: RBBS-PC                */
  280.     byte reserved5[33];                /* RESERVED */
  281.                                                                                /* External Utilities */
  282.     string fseforcedcmd[41];           /* FSE non-abortable command */
  283.                                             /* empty - use internal */
  284.     string fsecmd[41];                 /* FSE normal post command */
  285.     byte fsedoortype;                  /* FSE door file type: */
  286.                                        /*   0: none        3: WWIV     */
  287.                                        /*   1: GAP         4: PCBoard  */
  288.                                        /*   2: RBBS-PC             */
  289.     byte swapshelltype;                /* swap shell type: */
  290.                                        /*   0: disk        2: XMS */
  291.                                        /*   1: EMS                 */
  292.     boolean swaponarchive;             /* swap on archive command */
  293.     boolean swapondoor;                /* swap on door command */
  294.     boolean swapondosshell;            /* swap on DOS shell */
  295.     boolean swaponevent;               /* swap on DOS Shell event */
  296.     boolean swaponfse;                 /* swap on full-screen editor */
  297.     boolean swaponsysbat;              /* swap on system batch files */
  298.     boolean swaponxfer;                /* swap on file transfer */
  299.     boolean swapshell;                 /* swap shell function enabled? */
  300.     word envspace;                     /* DOS Environment space */
  301.     byte reserved6[48];                /* RESERVED */
  302.  
  303.     intrange timeallow;                /* daily time */
  304.     byterange callallow;               /* daily calls */
  305.     byterange dlratio;                 /* # ULs/# DLs ratios */
  306.     intrange dlkratio;                 /* DLK/ULK ratios */
  307.     byterange postratio;               /* post/call ratios */
  308.     byterange dailyratio;              /* daily DL #files ratios */
  309.     intrange dailykratio;              /* daily DL KB ratios */
  310.     intrange timebankmax;              /* timebank max limit */
  311.     byterange timedeposit;             /* timebank daily deposit */
  312.     byterange timewithdraw;            /* timebank daily withdraw */
  313.  
  314.     byte ansitype;                     /* ANSI Logon -
  315.                                               0  Ask
  316.                                               1  Detect
  317.                                               2  Force NO
  318.                                               3  Force YES */
  319.     byte lastcallers;                  /* days of last callers */
  320.     byte maxlogontries;                /* tries for PW's at logon */
  321.     byte maxlogonmins;                 /* minutes allowed for logon */
  322.     boolean allowalias;                /* allow aliases? (handles) */
  323.     boolean datapw;                    /* data phone # password */
  324.     boolean voicepw;                   /* voice phone # password */
  325.     boolean localsec;                  /* is local security ON? */
  326.     boolean displaysec;                /* is local screen-security ON? */
  327.     boolean globaltrap;                /* trap ALL USER'S activity? */
  328.     boolean autochatopen;              /* does chat buffer auto-open? */
  329.     boolean languagefirst;             /* language section first? */
  330.     byte reserved6a;                   /* bulletins in logon? */
  331.     byte lcallinlogon;                 /* "Last Calls" list in logon? */
  332.     byte reserved7;                    /* RESERVED */
  333.     boolean offhooklocallogon;         /* phone off-hook for local? */
  334.     boolean forcevoting;               /* logon voting mandatory? */
  335.     boolean iemsi;                     /* allow IEMSI logons */
  336.     boolean checkmulti;                /* check for multiple logons */
  337.     byte reserved8[41];                /* RESERVED */
  338.     string logonmenu[9];               /* logon menu to start users on */
  339.     string watcharea[9];               /* area for pw attempt warnings */
  340.     string inquiryarea[9];             /* area for forgotten PW inquiry */
  341.     word passdays;                     /* # of days to change password */
  342.     boolean updatelocal;               /* local calls in statistics */
  343.     boolean timeleftbank;              /* timebank prompt w/no time? */
  344.     longint minbaud;                   /* minimum logon baudrate */
  345.     longint graphicsbaud;              /* minimum graphics baudrate */
  346.     byte reserved9[63];                /* RESERVED */
  347.  
  348.     string newapp[37];                 /* new user letter to user */
  349.     boolean opensystem;                /* allow new users? */
  350.     boolean newiemsi;                  /* allow IEMSI new user logons */
  351.     byte linelen;                      /* default video line length */
  352.     byte pagelen;                      /* default video page length */
  353.     byte datefmt;                      /* date format - 0 ASK */
  354.     byte scanphone;                    /* scan for duplicate phone #'s? */
  355.                                        /*    0-No, 1-Log, 2-Email&Log */
  356.     boolean autopassword;              /* allow auto-created PW's? */
  357.     string language[9];                /* default language, ''  ASK */
  358.     byte ansi;                         /* ANSI               0  ASK */
  359.     byte avatar;                       /* Avatar             1  YES */
  360.     byte clrscr;                       /* Clear Screen       2  NO */
  361.     byte pause;                        /* screen pause */
  362.     byte hotkeys;                      /* Hotkeys */
  363.     byte fse;                          /* Full Screen Editor */
  364.     boolean mailaddress;               /* Ask for  Mail Address? */
  365.     boolean gender;                    /*          Gender? */
  366.     boolean dataph;                    /*          Data Phone? */
  367.     boolean voiceph;                   /*          Voice Phone? */
  368.     boolean dob;                       /*          Date of Birth? */
  369.     char newuserlevel;                 /* New User Level */
  370.     byte flinput;                      /* Full-line input   0 Ask
  371.                                                             1 Yes
  372.                                                             2 No */
  373.     byte countryinput;                 /* Country input   0 Ask 
  374.                                                           1 U.S.
  375.                                                           2 Canada
  376.                                                           3 Int'l */
  377.     boolean killcolor;                 /* Strip colour from entry fields */
  378.     byte reserved10[30];               /* RESERVED */
  379.  
  380.     acstring crosspost;                /* Cross-post message ACS */
  381.  
  382.     string batchfileext[4];            /* batch filename extension */
  383.     string os2cmdfileext[4];           /* cmd filename extension */
  384.     byte reserved11[28];               /* RESERVED */
  385.  
  386.     word minspaceforpost;              /* minimum drive space to post */
  387.     boolean emaillist;                 /* allow email user listing? */
  388.     boolean smartquote;                /* use smartquote features? */
  389.     boolean quickquote;                /* use quickquote features? */
  390.     acstring ccmail;                   /* ACS to carbon copy messages */
  391.     acstring creq;                     /* ACS for request confirm receipt */
  392.     acstring fileattach;               /* ACS to attach file */
  393.     acstring normpubpost;              /* ACS to post public messages */
  394.     acstring normprivpost;             /* ACS to post private messages */
  395.     acstring normnetpost;              /* ACS to post netmail messages */
  396.     acstring nopostratio;              /* ACS for no post/call ratio */
  397.     acstring anonpubread;              /* ACS see who posted public anon */
  398.     acstring anonprivread;             /* ACS see who posted private anon */
  399.     acstring anonpubpost;              /* ACS to post anon public messages */
  400.     acstring anonprivpost;             /* ACS to post anon private message */
  401.     boolean netconfirm;                /* honor confirmation request */
  402.     boolean msguploads;                /* allow upload of messages? */
  403.     boolean nodelookup;                /* allow nodelist lookup */
  404.     acstring fileattachnet;            /* ACS attach file - netmail */
  405.     boolean antiqueUUCP;               /* antique UUCP; UUCP in header,
  406.                                              TO: in message text */   
  407.     string writescanlog[41];           /* path to ECHOMAIL.JAM/NETMAIL.JAM */
  408.     boolean checkfsesave;              /* confirm FSE save? */
  409.     byte addREtoreply;                 /* add RE: to replies */
  410.     byte quotewarning;                 /* quote % for warning */
  411.     byte quotemaximum;                 /* quote % to deny save */
  412.     byte reserved13[12];               /* RESERVED */
  413.  
  414.     acstring sop;                      /* SysOp ACS */
  415.     acstring csop;                     /* C-SysOp ACS */
  416.     acstring spw;                      /* SysOp PW at logon ACS */
  417.  
  418.     byte wfc[15];                      /* WFC Menu Colours */
  419.     boolean heartbeat;                 /* WFC "Heartbeat" */
  420.     byte reserved14[25];               /* RESERVED */
  421.  
  422.     string qwkpktname[9];              /* packet name */
  423.     string qwkwelcomefile[9];          /* BBS welcome file */
  424.     string qwknewsfile[9];             /* BBS news file */
  425.     string qwkgoodbyefile[9];          /* BBS goodbye file */
  426.     string qwklocaldlpath[41];         /* local QWK download path */
  427.     string qwklocalulpath[41];         /* local REP upload path */
  428.     byte reserved15[41];               /* RESERVED */
  429.     word qwkmaxmsgs;                   /* max messages to DL (0=unlim) */
  430.     string qwkarc[4];                  /* default archive */
  431.     boolean qwkextctrl;                /* extended CONTROL.DAT info ? */
  432.     string qwknewsgen[61];             /* news program */
  433.     string qwkfilesgen[61];            /* new files program */
  434.     byte qwknews;                      /* include news        0 Ask */
  435.     byte qwkwelcome;                   /* include welcome     1 Yes */
  436.     byte qwkgoodbye;                   /* include goodbye     2 No */
  437.     byte qwknewfiles;                  /* include new files list */
  438.     byte qwksession;                   /* include session texts */
  439.  
  440.     byte reserved16[53];               /* RESERVED */
  441.  
  442.     acstring seeunavail;               /* see unavailable files ACS */
  443.     boolean highbitdesc;               /* allow high-bit in desc? */
  444.     string ularea[9];                  /* default UL area */
  445.     boolean showulname;                /* show upload name */
  446.     byte reserved16a[41];              /* RESERVED */
  447.     byte filetest;                     /* file upload test type
  448.                                              0 : none
  449.                                              1 : archive integrity
  450.                                              2 : upload processor */
  451.     acstring filepwacs;                /* ACS for users to add pw */
  452.     boolean truncdesc;                 /* truncate file_id/testinfo
  453.                                              imported descriptions */
  454.     byte drive_tblupd;                 /* CD-ROM drive table update
  455.                                              0 : every call
  456.                                              1-254 : once every n hours
  457.                                              255 : never */
  458.     boolean searchdup;                 /* search for dupe filenames? */
  459.     boolean globaldl;                  /* global downloads allowed? */
  460.     boolean allowdldesc;               /* allow description download? */
  461.     boolean importfileid;              /* import file descriptions? */
  462.     boolean nodupeext;                 /* no check of extension on dupe files? */
  463.     boolean cdlabelupd;                /* CD-ROM label auto update paths - Global Toggle */
  464.     byte unlistfp;                     /* file points for unlisted DLs */
  465.     byte ulrefund;                     /* percent time refund for ULs */
  466.     byte dlchecktype;                  /* DL checking (0=off,1=UL/DL,2=points) */
  467.     word maxintemp;                    /* max KB allowed in TEMP\ARC\ */
  468.     word minspaceul;                   /* minimum KB drive space left to upload */
  469.     word ulfpkbyte;                    /* UL K-bytes per file point */
  470.     word ulfpforfile;                  /* UL # points assigned to file */
  471.     word ulfpforuser;                  /* UL # points assigned to user */
  472.     string sysopularea[9];             /* file area for SysOp uploads */
  473.     acstring seeunval;                 /* ACS to see unvalidated files */
  474.     acstring dlunval;                  /* ACS to DL unvalidated files */
  475.     acstring ulvalreq;                 /* UL validation not-required */
  476.     string virusscanner[81];           /* Virus Scanner Command */
  477.     byte passederrlvl;                 /* Passed Scanner Errorlevel */
  478.     byte gifspectype;                  /* Gifspec type     0 Last line */
  479.                                        /*                  1 Before*  */
  480.                                        /*  *-old method, desc is      */
  481.                                        /*    truncated if necessary   */
  482.     boolean useTESTINFO;               /* import TESTINFO.DAT -- if */
  483.                                        /* virus scanner creates it.  */
  484.     string testpath[41];               /* path to TESTINFO.DAT */
  485.     boolean textview;                  /* allow text w/archive view */
  486.     boolean pausebefore;               /* pause list before next dir */
  487.     acstring dlunavail;                /* dl unavailable (failed) files */
  488.     byte reserved17[1536];             /* RESERVED */
  489. }
  490. configrec;
  491.  
  492. typedef struct          /* SYSTEM.DAT - System operational variables */
  493. {
  494.     byte usereditlvl;                  /* type of user editor */
  495.                                        /*   0 - 2,  Short - Long */
  496.     byte curwindow;                    /* type of SysOp window */
  497.     boolean istopwindow;               /* SysOp window on top? */
  498.     longint callernum;                 /* total number of callers */
  499.     boolean windowon;                  /* is SysOp window on? */
  500.     byte reserved[400];                /* RESERVED */
  501. }
  502. systemrec;
  503.  
  504. /*****************************************************************************/
  505. /* ----------------------- USER DATA STRUCTURES ---------------------------- */
  506. /*****************************************************************************/
  507.  
  508. typedef struct          /* USERS.DAT status flags */
  509. {
  510.     bit lockedout : 1;                 /* if locked out */
  511.     bit udeleted : 1;                  /* if deleted */
  512.     bit trapactivity : 1;              /* if trapping users activity */
  513.     bit trapseparate : 1;              /* if trap to separate TRAP file */
  514.     bit chatauto : 1;                  /* if autochat trapping */
  515.     bit chatseparate : 1;              /* if separate chat file to trap to */
  516.     bit slogseparate : 1;              /* if separate SysOp log kept */
  517.     bit alert : 1;                     /* alert SysOp when use logs on */
  518. }
  519. userstatus;
  520.  
  521. typedef struct          /* USERS.DAT - User flags */
  522. {
  523.     bit newusermsg : 1;                /* sent newuse message? */
  524.     bit clsmsg : 1;                    /* clear screen before messages? */
  525.     bit flinput : 1;                   /* full line input? */
  526.     bit hotkey : 1;                    /* menu hotkeys active */
  527.     bit pause : 1;                     /* pause? */
  528.     bit novice : 1;                    /* user is at novice help level */
  529.     bit hiddenlog : 1;                 /* not displayed in call/online listing */
  530.     bit hiddenlist : 1;                /* not displayed in user listings */
  531. }
  532. userflags;
  533.  
  534. typedef struct          /* USERS.DAT - User account records */
  535. {
  536.     string name[37];                   /* user name */
  537.     string realname[37];               /* real name */
  538.     string street[31];                 /* mail address */
  539.     string location[31];               /* city, province */
  540.     string postalcode[11];             /* postal code */
  541.     string voiceph[21];                /* voice phone # */
  542.     string dataph[21];                 /* data phone # */
  543.  
  544.     string pwtext[21];                 /* user password */
  545.  
  546.     /* DEVELOPERS NOTE:  The pwtext field *may* be empty.  Please observe
  547.      the following when updating passwords:
  548.  
  549.         1. All password input is UPPERCASE
  550.         2. If ConfigRec.HiddenPW = TRUE, then only the CRC32 of the password
  551.            is stored in the user record (userrec.crcpw). 
  552.         3. If ConfigRec.HiddenPW = FALSE, both the CRC32 and the actual
  553.            password are stored in the user record.
  554.        *4. When checking input passwords against the file, only the CRC32
  555.            value should be tested (the pwtext may or may not be correct).  
  556.            If ConfigRec.HiddenPW = FALSE, and the pwtext field is EMPTY, 
  557.            then after a correct password the field will be automatically
  558.            updated.  If ConfigRec.HiddenPW = TRUE, the pwtext will *not* be 
  559.            updated (this is obvious).
  560.        *5. Passwords should *only* be displayed (pwtext) if the CRC32 of
  561.            the pwtext field *matches* the pwcrc field.  Otherwise, the 
  562.            pwtext field is likely incorrect.  When changing passwords, the
  563.            user should be prompted only, not shown their previous password.
  564.     */    
  565.  
  566.     unixtime lastdate;                 /* laston date/time */
  567.     datestring firstdate;              /* firston date */
  568.     datestring pwdate;                 /* last date of PW change */
  569.     datestring birthdate;              /* Birth date */
  570.     char gender;                       /* gender - M/F */
  571.     datestring subdate;                /* subscription started */
  572.     datestring expiredate;             /* subscription expires */
  573.     char expireto;                     /* expire to level A - Z, !=Delete */
  574.  
  575.     string comment[41];                /* SysOp comment on user */
  576.     string notes[3][41];               /* SysOp definable variables (notes files) */
  577.     string lockfile[9];                /* lockout msg to print */
  578.  
  579.     longint pwcrc;                     /* CRC-32 of users password */
  580.  
  581.     byte reserved1[14];                /* RESERVED */
  582.     byte ugraphics;                    /* user graphics protocol
  583.                                              0 : TTY - no fallback
  584.                                              1 : ANSI
  585.                                              2 : Avatar
  586.                                              3 : RIP    */
  587.     byte fallback;                     /* 2nd fallback protocol
  588.                                              1 : ANSI
  589.                                              2 : Avatar
  590.                                              3 : RIP
  591.                                              3rd TTY */
  592.     byte linelen;                      /* line length (# cols) */
  593.     byte pagelen;                      /* page length (# rows) */
  594.     userflags flags;                   /* flags (see above) */
  595.     userstatus status;                 /* status (see above) */
  596.     byte reserved2;                    /* RESERVED */
  597.  
  598.     byte sl;                           /* SL */
  599.     uflags ac;                         /* user flags */
  600.     acrqs aflags1;                     /* Access flags - Set 1 */
  601.     acrqs aflags2;                     /* Access flags - Set 2 */
  602.     longint userID;                    /* unique User-ID - THIS VALUE
  603.                                           SHOULD NOT BE CHANGED BY ANY
  604.                                           PROGRAM!! */
  605.     char level;                        /* current validation level */
  606.     byte datefmt;                      /* Date Format
  607.                                           0 - MM/DD/YY
  608.                                           1 - DD/MM/YY
  609.                                           2 - YY/MM/DD */
  610.     byte reserved7;                    /* RESERVED */
  611.     longint macroptr;                  /* pointer for MACROS.DAT (-1 = none) */
  612.     longint votedate;                  /* last vote */
  613.     byte reserved3[13];                /* RESERVED */
  614.  
  615.     longint sigptr;                    /* pointer for SIGS.DAT
  616.                                              -1 = none */
  617.  
  618.     char lastgroup;                    /* last group 1 (main) */
  619.     word lastmsg;                      /* last message area # */
  620.     word pubpost;                      /* # public posts */
  621.     word privpost;                     /* # private posts */
  622.     word netpost;                      /* # netmail posts */
  623.     string mailbox[37];                /* mailbox status
  624.                                           ''        Open/Normal
  625.                                           'CLOSED'  Closed
  626.                                           Username  Forwarded to... */
  627.     longint credit;                    /* NetMail points (credit) */
  628.     longint debit;                     /* NetMail points (debit) */
  629.     byte fsetype;                      /* FSE usage (0=never,1=always,2=ask) */
  630.     byte reserved4[32];                /* RESERVED */
  631.  
  632.     string qwkarc[4];                  /* QWK default archiver */
  633.     boolean qwkfromyou;                /* bundle from user */
  634.     boolean qwkbwctrl;                 /* create BW control file? */
  635.     boolean qwknews;                   /* include news? */
  636.     boolean qwkwelcome;                /* include welcome? */
  637.     boolean qwkgoodbye;                /* include goodbye? */
  638.     boolean qwknewfiles;               /* include new files list? */
  639.     boolean qwkpointer;                /* include pointer file? */
  640.     boolean qwksession;                /* include session listing? */
  641.     byte reserved5[22];                /* RESERVED */
  642.  
  643.     char lastfgroup;                   /* last group 2 (file) */
  644.     char defprotocol;                  /* default protocol (A-Z)
  645.                                           ! = Select at download time */
  646.     word lastfile;                     /* last file area # */
  647.     word uploads;                      /* amount ULed (files) */
  648.     word downloads;                    /* amount DLed (file) */
  649.     word todaydl;                      /* amount DLed today (files) */
  650.     longint uk;                        /* amount ULed (kbytes) */
  651.     longint dk;                        /* amount DLed (kbytes) */
  652.     longint todaydk;                   /* amount DLed today (kbytes) */
  653.     longint filepoints;                /* file points remaining */
  654.  
  655.     longint totaltime;                 /* total time on system */
  656.     word timebank;                     /* # mins in Time Bank */
  657.     word totalcalls;                   /* total calls to system */
  658.     integer tltoday;                   /* time left today */
  659.     integer tbtoday;                   /* bank activit +/- time */
  660.     byte todaycalls;                   /* calls to system today */
  661.     byte illegal;                      /* illegal logons */
  662.     byte vote[NUMVOTEQS];              /* voting data */
  663.     string language[9];                /* langauge */
  664.     byte reserved6;                    /* RESERVED */
  665. }
  666. userrec;
  667.  
  668. typedef struct          /* USERS.IDX - Sorted names listing */
  669. {
  670.     string name[37];                   /* user name */
  671.     integer number;                    /* user record # */
  672.                                        /*     -1 = Deleted */
  673. }
  674. useridxrec;
  675.  
  676. typedef struct          /* USERID.IDX - Sorted ID listing */
  677. {
  678.     longint userID;                    /* User-ID from user record */
  679.     integer number;                    /* user record # */
  680.                                        /*     -1 = Deleted */
  681. }
  682. IDidxrec;
  683.  
  684. /*****************************************************************************/
  685. /* ----------------------- AREA DATA STRUCTURES ---------------------------- */
  686. /*****************************************************************************/
  687.  
  688. typedef struct          /* FAREAS.IDX/MAREAS.IDX - Area index records */
  689. {
  690.     string name[9];                    /* area filename */
  691.     integer number;                    /* area record # */
  692.                                        /*     -1 = Deleted */
  693. }
  694. areaidxrec;
  695.  
  696. /* 
  697.    FSCAN.DAT/MSCAN.DAT: Area scan records
  698.     
  699.    The area scan records are a sequential bitplane; the offset to any given 
  700.    user is (userid-1)*(systat.resv...areas).  The bitplane is then stored 
  701.    in systat.resv...areas sequential bytes.  So, to find the msg scan 
  702.    records for userid N, the following is done:
  703.    
  704.          open MSCAN.DAT;
  705.          if (N-1)*(systat.resvmsgareas) < filesize
  706.             seek (N-1)*(systat.resvmsgareas);
  707.             read bitplane,systat.resvmsgareas;
  708.          else
  709.             // record does not exist
  710.          endif
  711.          close MSCAN.DAT
  712.        
  713.    NOTE: The user may not have any scan records stored if they are a new 
  714.    user and have not successfully completed a full login.
  715. */
  716.  
  717. /*****************************************************************************/
  718. /* ---------------------- FILE AREA DATA STRUCTURES ------------------------ */
  719. /*****************************************************************************/
  720.  
  721. typedef struct          /* FAREAS.DAT status flags */
  722. {
  723.     bit fbnoratio : 1;                 /* <No Ratio> active */
  724.     bit fbvisible : 1;                 /* Visible to users w/o access? */
  725.     bit fbdrvltrcdlbl :1;              /* translate file path letter */
  726.                                        /* on bootup based on CDROM */
  727.                                        /* labels in CDROM drives and */
  728.                                        /* area CDROM label */
  729.     bit fbcdrom : 1;                   /* CD-ROM/read-only media */
  730.     bit fbusegifspecs : 1;             /* whether to use GifSpecs */
  731. }
  732. fareaflags;
  733.  
  734. /*
  735.    Telegard can only support up to resv...areas*8 areas -- do not attempt 
  736.    to allocate more areas -- Telegard will not see them, and subsequently 
  737.    not use them!  If utility authors hit the maximum number of areas they 
  738.    should present a warning that the SysOp must adjust the internal maximum 
  739.    (Telegard supports up to 32678 areas)--utilities should *not* do this 
  740.    otherwise the indexing will be damaged!
  741. */
  742.  
  743. typedef struct          /* FAREAS.DAT - File area records */
  744. {
  745.     string desc[41];                   /* area description */
  746.     string filename[9];                /* filename */
  747.     string infofile[9];                /* info filename */
  748.     string path[41];                   /* path */
  749.     string arctype[4];                 /* archive (''=inactive) */
  750.     byte reserved1;                    /* RESERVED */
  751.     fareaflags fstatus;                /* file area status */
  752.     acstring sysopacs;                 /* SysOp access */
  753.     acstring listacs;                  /* list/view access */
  754.     acstring nameacs;                  /* see uploader name access */
  755.     acstring ulacs;                    /* upload access */
  756.     acstring dlacs;                    /* download access */
  757.     byte scantype;                     /* scan type    0=Default ON
  758.                                                        1=Default OFF
  759.                                                        2=Always */
  760.     string cdlabel[12];                /* CD-ROM label */
  761.     unixtime createdate;               /* area creation date */
  762.     string filepath[41];               /* *.FB? storage path */
  763.     shortint primaryfs;                /* primary file sorting order */
  764.     shortint secondaryfs;              /* secondary " " */
  765.     byte reserved2[40];                /* RESERVED */
  766. }
  767. farearec;
  768.  
  769. /* 
  770.    Extra notes on QFILES.IDX:
  771.       1) To delete a record, toggle the 'deleted' flag
  772.       2) To insert a record, ensure there is no OTHER matching filename &
  773.          filearea that is *not* deleted (if it is deleted, IGNORE IT) --
  774.          if one exists, then do not add another record, otherwise append to
  775.          the end
  776.       3) Read DEVELnnn.DOC for further information on the index!
  777. */
  778.  
  779. typedef struct {
  780.     bit fndeleted : 1;                 /* index is deleted? */
  781. }
  782. fileidxstat;
  783.  
  784. typedef struct          /* QFILES.IDX - File index record */
  785. {
  786.     string filename[13];               /* filename [key] */
  787.     longint filearea;                  /* filearea */
  788.     fileidxstat status;                /* status bits */
  789. }
  790. fileidxrec;
  791.  
  792. typedef struct          /* *.FA status flags */
  793. {
  794.     bit freedl : 1;                    /* if file is free */
  795.     bit notime : 1;                    /* if file is time check free */
  796.     bit validated : 1;                 /* if file is validated */
  797.     bit available : 1;                 /* if file is available - will */
  798.                                        /*    be toggled FALSE only */
  799.                                        /*    if failed by filescan */
  800.     bit offline : 1;                   /* if file is offline */
  801.     bit hatch : 1;                     /* if file hatched via SDS */
  802. }
  803. fbstat;
  804.  
  805. typedef struct          /* *.FA File records */
  806. {
  807.     string filename[13];               /* filename */
  808.     longint descofs;                   /* offset of file desc */
  809.     word desclength;                   /* length of description */
  810.                                        /*   - does not include 13 */
  811.                                        /*   byte filename ID */
  812.     longint size;                      /* length of file (bytes) */
  813.     unixtime uldate;                   /* date uploaded */
  814.     unixtime filedate;                 /* date on file */
  815.     unixtime dldate;                   /* date last downloaded */
  816.     fbstat filestatus;                 /* file status */
  817.     word filepoints;                   /* points */
  818.     word downloads;                    /* number of downloads */
  819.     string uploader[37];               /* uploader's name */
  820.     longint passwordCRC;               /* CRC of password to dl */
  821.     byte reserved[12];                 /* RESERVED */
  822. }
  823. fbrec;
  824.  
  825. /* 
  826.    The description is stored in a continuous character file--the 
  827.    description for a file can be found by searching to the description 
  828.    offset and reading a 13 byte signature, then the description of the 
  829.    appropriate length.  If the 13 byte signature does NOT match the 
  830.    filename field, then the description is invalid
  831. */
  832.  
  833. typedef struct          /* DRIVES.DAT : CDROM/Network label storage */
  834. {
  835.     unixtime update;                   /* last update */
  836.     byte disktype[26];                 /* drive type
  837.                                             0-2: None, Floopy, HD
  838.                                             3 : CDROM
  839.                                             4 : Network */
  840.     string disklabel[26][12];          /* drive labels */
  841. }
  842. driverec;
  843.  
  844. typedef struct          /* *.QQQ transfer queue record */
  845. {
  846.     string filename[13];               /* filename */
  847.     longint filearea;                  /* filearea # */
  848.     longint descofs;                   /* desc offset in *.QQD */
  849.     word desclength;                   /* desc length */
  850.     string path[56];                   /* path of file */
  851.     integer points;                    /* # file points */
  852.     longint filesize;                  /* filesize (bytes) */
  853.     boolean freeratio;                 /* file is FREE ratio */
  854.     boolean freetime;                  /* file is FREE time */
  855.     boolean readonly;                  /* file is on read-only media */
  856. }
  857. queuerec;
  858.  
  859. /*****************************************************************************/
  860. /* -------------------- MESSAGE AREA DATA STRUCTURES ----------------------- */
  861. /*****************************************************************************/
  862.  
  863. typedef struct          /* MAREAS.DAT status flags */
  864. {
  865.     bit mbrealname : 1;                /* real names are forced */
  866.     bit mbvisible : 1;                 /* visible to users w/o access */
  867.     bit mbansi : 1;                    /* filter ANSI */
  868.     bit mb8bit : 1;                    /* filter 8-bit */
  869.     bit mbstrip : 1;                   /* strip center/title codes */
  870.     bit mbaddtear : 1;                 /* add tear/origin lines */
  871.     bit mbnopubstat : 1;               /* messages not added to user */
  872.                                        /*   public post total - i.e. */
  873.                                        /*   will not calculate in PCR */
  874.     bit mbnocredit : 1;                /* Netmail credit not used */
  875.     bit mbinternet : 1;                /* Internet (UUCP) handling */
  876.     bit mbfileattach : 1;              /* allow file attaches */
  877.     bit mbstripcolour : 1;             /* strip TG color codes */
  878.     bit mbareasubj : 1;                /* add AREA: to subject line */
  879. }
  880. mareaflags;
  881.  
  882. /*
  883.    WARNINGS:
  884.        1) Telegard can only support up to resv...areas*8 areas -- do not
  885.           attempt to allocate more areas -- Telegard will not see them, and
  886.           subsequently not use them!  If utility authors hit the maximum
  887.           number of areas they should present a warning that the SysOp must
  888.           adjust the internal maximum (Telegard supports up to 32678
  889.           areas)--utilities should *not* do this otherwise the indexing will
  890.           be damaged!
  891.        2) If you add, delete or reposition any areas, you *must* update the
  892.           scan records appropriately.  If you need assistance, please ask.
  893. */
  894.  
  895. typedef struct          /* MAREAS.DAT - Message area records */
  896. {
  897.     string name[41];                   /* message area description */
  898.     string msgpath[41];                /* messages pathname */
  899.     string filename[9];                /* data filenames */
  900.     string infofile[9];                /* area info filename */
  901.     acstring readacs;                  /* read access */
  902.     acstring postacs;                  /* post access */
  903.     acstring sysopacs;                 /* SysOp access */
  904.     acstring netacs;                   /* network access */
  905.     word maxmsgs;                      /* max message count */
  906.     word maxdays;                      /* max days to kee messages */
  907.     mareaflags mstatus;                /* status */
  908.     byte mbformat;                     /* message area format */
  909.     byte mbtype;                       /* message area type */
  910.     byte anonymous;                    /* anonymous type */
  911.     byte mbpost;                       /* message area posting type */
  912.     string origin[51];                 /* origin line */
  913.     byte kludge_color;                 /* color of kludge line */
  914.     byte quote_color;                  /* color of quoted line */
  915.     byte tear_color;                   /* color of tear line */
  916.     byte origin_color;                 /* color of origin line */
  917.     byte addr;                         /* network address # */
  918.     byte scantype;                     /* scan type    0 = Default ON
  919.                                                        1 = Default OFF
  920.                                                        2 = Mandatory */
  921.     unixtime createdate;               /* area creation date */
  922.     longint qwkindex;                  /* QWK-permanent index */
  923.     byte text_color;                   /* color of text line */
  924.     byte anontrack;                    /* anonymous tracking */
  925.     byte sigtype;                      /* signature usage */
  926.     byte reserved[38];                 /* RESERVED */
  927. }
  928. marearec;
  929.  
  930. typedef struct          /* QWK.IDX - QWK message area index */
  931. {
  932.     integer areanum;                   /* QWK area number */
  933.     string areatag[9];                 /* message area filename */
  934. }
  935. qwkidxrec;
  936.  
  937. typedef struct          /* packetid.QPT - QWK lastread pointer record */
  938. {
  939.     integer areanum;                   /* QWK area number */
  940.     longint lastread;                  /* last read pointer */
  941. }
  942. qptrrec;
  943.  
  944. /*****************************************************************************/
  945. /* ----------------------- OTHER DATA STRUCTURES --------------------------- */
  946. /*****************************************************************************/
  947.  
  948. typedef struct          /* Menu header status flags */
  949. {
  950.     bit clrscrbefore : 1;              /* C - clrscr before menu? */
  951.     bit dontcenter : 1;                /* D - don't center titles! */
  952.     bit forcefullline : 1;             /* F - force full line input */
  953.     bit nomenuprompt : 1;              /* N - no menu prompt */
  954.     bit forcepause : 1;                /* P - force pause before menu? */
  955.     bit autotime : 1;                  /* T - auto time display? */
  956.     bit dontcentersub : 1;             /* S: don't center subtitles! */
  957.     bit forcekey : 1;                  /* K: force key input */
  958. }
  959. menuflags;
  960.  
  961. typedef struct          /* Extended menu header status flags */
  962. {
  963.     bit notrailingcr : 1;              /* R: no CR after prompt */
  964.     bit noleadingcr : 1;               /* L: no CR before prompt */
  965. }
  966. menuflags2;
  967.  
  968. typedef struct          /* *.MNU Menu header */
  969. {
  970.     string menutitle[3][101];          /* menu header */
  971.     string dispfile[13];               /* help file displayed */
  972.                                        /*  ''        Generic */
  973.     string helpfile[13];               /* tutorial help file */
  974.                                        /*     ''      Generic */
  975.                                        /*   '*OFF*'   Disabled */
  976.     string prompt[121];                /* menu prompt */
  977.     acstring menuacs;                  /* access requirements */
  978.     string password[16];               /* password required */
  979.     string fallback[9];                /* fallback menu */
  980.     byte helplevel;                    /* forced help level for menu */
  981.     byte columns;                      /* generic menu: # of columns */
  982.     byte colours[6];                   /* generic menu: colors */
  983.     menuflags menuflags;               /* menu status flags */
  984.     boolean global;                    /* load global menu */
  985.     menuflags2 menuflags2;             /* menu extended status flags */
  986.     byte reserved1;                    /* RESERVED */
  987.     string nodestat[37];               /* Who's Online Status */
  988.     byte reserved2[10];                /* RESERVED */
  989. }
  990. menurec;
  991.  
  992. typedef struct          /* *.MNU  Command records */
  993. {
  994.     string ldesc[71];                  /* long description */
  995.     string sdesc[36];                  /* short description */
  996.     byte reserved[16];                 /* RESERVED */
  997.     string keys[15];                   /* execute keys */
  998.                                        /*   'AUTOEXEC' = Exec. Menu Display */
  999.                                        /*   'FIRSTCMD' = Exec. Menu Loaded */
  1000.                                        /*   'SUBHEADER' = Subheader */
  1001.                                        /*   'ENTER' = <ENTER> */
  1002.                                        /*   'SPACE' = <SPACEBAR> */
  1003.                                        /*   'ESC'   = <ESC> */
  1004.                                        /*   'TAB'   = <TAB> */
  1005.     acstring acs;                      /* access requirements */
  1006.     string cmdtype[3];                 /* command type */
  1007.     string options[51];                /* command options */
  1008.     byte viewtype;                     /* display of command */
  1009.                                        /*    0   ACS dependent */
  1010.                                        /*    1   Always visible */
  1011.                                        /*    2   Always hidden */
  1012. }
  1013. commandrec;
  1014.  
  1015. /*---------------------------------------------------------------------------*/
  1016.  
  1017. typedef struct          /* *.BBS - BBS Listings */
  1018. {
  1019.     string phone[21];                  /* BBS phone number */
  1020.     string name[31];                   /* BBS name */
  1021.     string sysop[31];                  /* BBS SysOp name */
  1022.     string description[31];            /* Other Description */
  1023.     string speed[5];                   /* Speed */
  1024.     string software[9];                /* Software */
  1025.     unixtime firstdate;                /* First date added */
  1026.     unixtime lastedit;                 /* Last date edited */
  1027.     string editor[37];                 /* entry editor */
  1028. }
  1029. bbslistrec;
  1030.  
  1031. /*---------------------------------------------------------------------------*/
  1032.  
  1033. typedef struct          /* ARCHIVE.DAT - Archiver Setup */
  1034. {
  1035.     boolean active;                    /* is this format active? */
  1036.     string extension[4];               /* archive extension */
  1037.     string description[51];            /* archiver description */
  1038.     string compress[51];               /* pack archive command */
  1039.     string decompress[51];             /* unpack archive command */
  1040.     string test[51];                   /* test archive command */
  1041.     string view[51];                   /* view archive command */
  1042.                                        /*  '' = internal (if avail)  */
  1043.     string comment[51];                /* comment archive command */
  1044.     byte success;                      /* sucess errorlevel */
  1045.     boolean viewcapture;               /* redirect external viewer */
  1046.     byte reserved[34];                 /* RESERVED */
  1047. }
  1048. archiverec;
  1049.  
  1050. /*---------------------------------------------------------------------------*/
  1051.  
  1052. /*
  1053.    GROUPS.DAT contains two group records -- the main groups, and the file
  1054.    groups, stored sequentially in the file (one confrec after another)
  1055. */
  1056.  
  1057. typedef struct           /* GROUPS.DAT - Groups data */
  1058. {
  1059.    acstring acs;                       /* ACS requirement */
  1060.    string name[41];                    /* name of group */
  1061.    boolean visible;                    /* visible w/o ACS */
  1062.    byte reserved[20];
  1063. }
  1064. groupsrec[27];                         /* groups @, A-Z */
  1065.  
  1066. /*---------------------------------------------------------------------------*/
  1067.  
  1068. typedef struct          /* EVENTS.DAT status flags */
  1069. {
  1070.     bit active : 1;                    /* event is active */
  1071.     bit busyduring : 1;                /* phone off-hook during event */
  1072.     bit monthly : 1;                   /* event is executed monthly */
  1073.     bit forced : 1;                    /* event is forced */
  1074. }
  1075. eventflags;
  1076.  
  1077. typedef struct          /* EVENTS.DAT - Scheduled event records */
  1078. {
  1079.     eventflags flags;                  /* status flags */
  1080.     string desc[31];                   /* description */
  1081.     char etype;                        /* Event type:
  1082.                                                 A:ACS,
  1083.                                                 C:Chat,
  1084.                                                 E:External,
  1085.                                                 O:OS */
  1086.     string execdata[41];               /* Event data:
  1087.                                                 ACS:  ACS command
  1088.                                                 OS:   OS command
  1089.                                                 Exit: ERRORLEVEL for exit */
  1090.     word exectime;                     /* execution time (minutes) */
  1091.     word duration;                     /* event duration (minutes) */
  1092.     byte execdays;                     /* monthly: day (1-28) */
  1093.                                        /* daily: days (bitwise) */
  1094.     unixtime lastexec;                 /* date event last executed */
  1095.     word execnode;                     /* affected nodes (0=all) */
  1096. }
  1097. eventrec[MAXEVENTS];
  1098.  
  1099. /*---------------------------------------------------------------------------*/
  1100.  
  1101. typedef struct          /* HISTORY.DAT - History logs */
  1102. {
  1103.     datestring date;                   /* history date */
  1104.     word userbaud[26];                 /* logon BPS rates */
  1105.                                        /*    0 - Local   11 - 19200  */
  1106.                                        /*    1 - 300     12 - 21600  */
  1107.                                        /*    2 - 1200    13 - 24000  */
  1108.                                        /*    3 - 1275    14 - 26400  */
  1109.                                        /*    4 - 2400    15 - 28800  */
  1110.                                        /*    5 - 4800    16 - 31200  */
  1111.                                        /*    6 - 7200    17 - 33600  */
  1112.                                        /*    7 - 9600    18 - 38400  */
  1113.                                        /*    8 - 12000   19 - 57600  */
  1114.                                        /*    9 - 14400   20 - 64000  */
  1115.                                        /*   10 - 16800   21 - 115200 */
  1116.     word active;                       /* % activity */
  1117.     word calls;                        /* # of calls */
  1118.     word newusers;                     /* # of new users */
  1119.     word pubpost;                      /* # of public posts */
  1120.     word privpost;                     /* # of private posts */
  1121.     word netpost;                      /* # of netmail posts */
  1122.     word criterr;                      /* # of critical errors */
  1123.     word uploads;                      /* # of uploads */
  1124.     word downloads;                    /* # of downloads */
  1125.     longint uk;                        /* amount ULed in KB */
  1126.     longint dk;                        /* amount DLed in KB */
  1127.     byte reserved[16];                 /* RESERVED */
  1128. }
  1129. historyrec;
  1130.  
  1131. /*---------------------------------------------------------------------------*/
  1132.  
  1133. typedef struct          /* IEMSI.DAT - IEMSI connection record */
  1134. {
  1135.     string realname[37];               /* User's Real Name */
  1136.     string handle[37];                 /* User's Handle */
  1137.     string location[31];               /* User's Location */
  1138.     string dataph[21];                 /* User's Data Phone # */
  1139.     string voiceph[21];                /* User's Voice Phone # */
  1140.     string password[21];               /* User's Password */
  1141.     unixtime birthdate;                /* User's Birthdate */
  1142.     byte linelen;                      /* Screen Width */
  1143.     byte pagelen;                      /* Screen Length */
  1144.     byte screentype;
  1145.     string protocols[11];              /* Protocol to use */
  1146.                                        /*      DZA* DirectZAP Zmodem
  1147.                                                ZAP* ZedZap Zmodem -> 8K
  1148.                                                ZMO  Zmodem -> 1K (Z)
  1149.                                                SLK* SEAlink
  1150.                                                KER* Kermit  */
  1151.     string capabilities[26];           /* System Capabilities */
  1152.                                        /*      CHT*    IEMSI chats
  1153.                                                MNU*    Image Downloading
  1154.                                                TAB*    TAB support
  1155.                                                ASCII8* 8-bit ASCII supprt */
  1156.     string requests[41];               /* Requests */
  1157.                                        /*      NEWS    Bulletins, news, etc.
  1158.                                                MAIL*   Logon - Mail Check
  1159.                                                FILE*   Logon - File Check
  1160.                                                HOT     Hot-Keys
  1161.                                                CLR     Screen clearing
  1162.                                                HUSH*   Do not disturb
  1163.                                                MORE    Page pausing
  1164.                                                FSED    Full-screen editor */
  1165.     string software[71];               /* Terminal Software */
  1166. }
  1167. iemsirec;
  1168.  
  1169.     /*
  1170.     *These items are are currently not supported in Telegard because they
  1171.     are things which were provided for systems with these capabilities.  They
  1172.     are listed here for convenience and so that utility authors can make
  1173.     use of them if neccessary.  Some of these options may be used in
  1174.     future versions of Telegard.
  1175.  
  1176.     (Z)The protocol that is selected by having the ZMO flag is protocol Z.
  1177.     If that protocol does not exist, it is not selected.  Protocol Z should
  1178.     be ZMODEM, otherwise the wrong protocol may be selected! */
  1179.  
  1180. /*---------------------------------------------------------------------------*/
  1181.  
  1182. typedef struct          /* LANGUAGE.DAT - Language records */
  1183. {
  1184.     string filename[9];                /* language filename */
  1185.     string desc[31];                   /* language description */
  1186.     acstring acs;                      /* language ACS */
  1187.     string textpath[76];               /* primary text path */
  1188.     string menuspath[76];              /* primary menus path */
  1189.                                        /*   '' = use default */
  1190.     boolean checktext;                 /* if primary path <> '' */
  1191.     boolean checkmenus;                /*   and file not found, check */
  1192.                                        /*   default path? */
  1193. }
  1194. languagerec;
  1195.  
  1196.  
  1197. /*---------------------------------------------------------------------------*/
  1198.  
  1199. typedef struct          /* LASTON.DAT  - Last callers records */
  1200. {
  1201.     longint caller;                    /* system caller number */
  1202.     string realname[37];               /* real name of caller */
  1203.     string handle[37];                 /* user name of caller */
  1204.     string location[31];               /* location of caller */
  1205.     longint logonspeed;                /* logon speed */
  1206.     unixtime logontime;                /* logon time */
  1207.     boolean newuser;                   /* was newuser? */
  1208.     byte reserved1;                    /* RESERVED */
  1209.     boolean hidden;                    /* hidden from display */
  1210.     byte node;                         /* node number */
  1211.     unixtime logofftime;               /* logoff time */
  1212.     word uploads;                      /* number of uploads */
  1213.     word downloads;                    /* number of downloads */
  1214.     longint uk;                        /* number of upload kB */
  1215.     longint dk;                        /* number of download kB */
  1216.     byte reserved2[8];                 /* RESERVED */
  1217. }
  1218. lcallers;
  1219.  
  1220. /*---------------------------------------------------------------------------*/
  1221.  
  1222. typedef struct          /* LEVELS.DAT - Membership/validation levels */
  1223. {
  1224.     string desc[51];                   /* Description */
  1225.     byte sl;                           /* SL level */
  1226.     acrqs flags1;                      /* Access flags - Set 1 */
  1227.     acrqs flags2;                      /* Access flags - Set 2 */
  1228.     uflags ac;                         /* Restriction flags */
  1229.     word addfp;                        /* Bonus FilePoinsts (added) */
  1230.     word addcredit;                    /* Bonus NetCredits (added) */
  1231.     word addtb;                        /* Bonus Timebank (added) */
  1232.     word expireday;                    /* Expire in ## days */
  1233.                                        /*      0 = Never */
  1234.     char tolevel;                      /* Expire to level A thru Z */
  1235.                                        /*      ! = Delete */
  1236.     string upgradefn[9];               /* upgrade: email fn to user */
  1237.     string dngradefn[9];               /* dngrade: email fn to user */
  1238.     byte reserved[7];                  /* RESERVED */
  1239. }
  1240. levelsrec;
  1241.  
  1242. /*---------------------------------------------------------------------------*/
  1243.  
  1244. typedef struct          /* MACRO.DAT - Keyboard macro records */
  1245. {
  1246.     longint userid;                    /* User-ID - from user record
  1247.                                             checked to verify that macro
  1248.                                             pointers are to the correct
  1249.                                             macros */
  1250.     string macro[4][241];              /* stored keystrokes */
  1251. }
  1252. macrorec;
  1253.  
  1254. /*---------------------------------------------------------------------------*/
  1255.  
  1256. typedef struct          /* MODEM.DAT/MODEMnnn.DAT status flags */
  1257. {
  1258.     bit xonxoff : 1;                /* XON/XOFF (software) flow ctl */
  1259.     bit ctsrts : 1;                 /* CTS/RTS (hardware) flow ctl */
  1260.     bit dtrdrop : 1;                /* drop DTR to hangup modem */
  1261.     bit fossilhot : 1;              /* FOSSIL active during DOS */
  1262.     bit int14 : 1;                  /* INT 14 driven (no fossil) */
  1263. }
  1264. modemflags;
  1265.  
  1266. typedef struct          /* MODEM.DAT/MODEMnnn.DAT - Modem configuration */
  1267. {
  1268.     string desc[51];                   /* modem reference description */
  1269.     byte comport;                      /* COM port number */
  1270.     longint waitbaud;                  /* modem bps rate */
  1271.     longint lockedbaud;                /* locked bps rate */
  1272.                                        /*    0 = Not Locked */
  1273.     string init[81];                   /* initialization command */
  1274.     string answer[41];                 /* answer command */
  1275.     string hangup[41];                 /* hangup command */
  1276.     string offhook[41];                /* phone off-hook command */
  1277.     string code_ok[17];                /* OK result code */
  1278.     string code_error[17];             /* ERROR result code */
  1279.     string code_ring[17];              /* RING result code */
  1280.     string code_nocarrier[17];         /* NO CARRIER result code */
  1281.     string code_arq[17];               /* error correction string */
  1282.     string code_connect[25][17];       /* connect strings */
  1283.                                        /*                10 - 19200  */
  1284.                                        /*    0 - 300     11 - 21600  */
  1285.                                        /*    1 - 1200    12 - 24000  */
  1286.                                        /*    2 - 1275    13 - 26400  */
  1287.                                        /*    3 - 2400    14 - 28800  */
  1288.                                        /*    4 - 4800    15 - 31200  */
  1289.                                        /*    5 - 7200    16 - 33600  */
  1290.                                        /*    6 - 9600    17 - 38400  */
  1291.                                        /*    7 - 12000   18 - 57600  */
  1292.                                        /*    8 - 14400   19 - 64000  */
  1293.                                        /*    9 - 16800   20 - 115200 */                                       
  1294.     byte reinittime;                   /* inactivity re-initialization */
  1295.     byte delay_cmd;                    /* delay after cmd (1/10th) */
  1296.     byte delay_answer;                 /* answer delay (1/10th) */
  1297.     byte delay_dtr;                    /* delay for DTR drop (1/10th) */
  1298.     modemflags flags;                  /* status flags (see above) */
  1299.     byte irq;                          /* irq for non-standard port */
  1300.     string address[5];                 /* base I/O address for port */
  1301.     byte ansrings;                     /* # rings before answering */
  1302.     byte ansreset;                     /* seconds before counter reset */
  1303.     byte reserved[67];                 /* RESERVED */
  1304. }
  1305. modemrec;
  1306.  
  1307. /*---------------------------------------------------------------------------*/
  1308.  
  1309. typedef struct          /* NETWORK.DAT status flags */
  1310. {
  1311.     bit nstrip : 1;                    /* strip message codes? */
  1312.     bit naddtear : 1;                  /* add tear/origin lines? */
  1313.     bit nholduser : 1;                 /* hold all non-SysOp Netmail? */
  1314.     bit nhold : 1;                     /* def Netmail to "hold"? */
  1315.     bit ncrash : 1;                    /* def NetMail to "crash"? */
  1316.     bit nkill : 1;                     /* def NetMail to "kill/sent"? */
  1317.     bit nstripcolour : 1;              /* strip TG color codes ? */
  1318. }
  1319. netflags;
  1320.  
  1321. typedef struct          /* NETWORK.DAT - Net Address */
  1322. {
  1323.     word zone, net, node, point;       /* Zone:Net/Node.Point */
  1324. }
  1325. netaddress;
  1326.  
  1327. typedef struct          /* NETWORK.DAT - Node Information */
  1328. {
  1329.     netaddress addr;                   /* Zone:Net/Node.Point */
  1330.     word akazone;                      /* aka matching Zone:Net */
  1331.     word akanet;                       /* if net=0, match Zone only */
  1332.     string replynet[9];                /* areaname of netreplies for AKA */
  1333.     byte reserved[18];                 /* RESERVED */
  1334. }
  1335. netaddrrec;
  1336.  
  1337. typedef struct          /* NETWORK.DAT - Network Information */
  1338. {
  1339.     netaddrrec netaddr[20];            /* network addresses */
  1340.     string origin[51];                 /* origin line */
  1341.     byte kludge_color;                 /* color of kludge line */
  1342.     byte quote_color;                  /* color of quoted text */
  1343.     byte tear_color;                   /* color of tear line */
  1344.     byte origin_color;                 /* color of origin line */
  1345.     netflags flags;                    /* status flags */
  1346.     acstring readacs;                  /* default read ACS */
  1347.     acstring postacs;                  /* default post ACS */
  1348.     byte text_color;                   /* color of text line */
  1349.     byte areaformat;                   /* default area format */
  1350.     byte areascan;                     /* default scan type */
  1351.     byte defaddr;                      /* default address */
  1352.     byte reserved1[37];                /* RESERVED */
  1353.     string nodepath[41];               /* Nodelist path */
  1354.     byte nodelisttype;                 /* Nodelist type
  1355.                                               0 : None
  1356.                                               1 : Version 6
  1357.                                               2 : Version 7
  1358.                                               3 : FrontDoor */
  1359.     netaddress UUCPgate;               /* Zone:Net/Node.Point */
  1360.     acstring sysopacs;                 /* default sysop ACS */
  1361.     byte reserved2[26];                /* RESERVED */
  1362. }
  1363. networkrec;
  1364.  
  1365. /*---------------------------------------------------------------------------*/
  1366.  
  1367. typedef struct          /* NODES.DAT : Who's Online status flags */
  1368. {
  1369.     bit ishidden : 1;                  /* user is hidden */     
  1370.     bit isquiet : 1;                   /* user not to be disturbed */
  1371. }
  1372. whosonflags;
  1373.  
  1374. typedef struct          /* NODES.DAT - Multi-Node setup */
  1375. {
  1376.     boolean active;                    /* node can accept calls */
  1377.     word logonbegin;                   /* logon starts (0-1440) */
  1378.     word logonend;                     /* logon ends (0-1440) */
  1379.     acstring logonacs;                 /* access to logon */
  1380.     longint logonbps;                  /* minimum logon bps */
  1381.     string nodephone[21];              /* Node Phone Number */
  1382.     byte reserved1[45];                /* RESERVED */
  1383.  
  1384.     string realname[37];               /* realname */
  1385.     string handle[37];                 /* handle */
  1386.     string location[31];               /* location */
  1387.     unixtime logontime;                /* logon time */
  1388.     byte statusid;                     /* 0 - waiting for call
  1389.                                           1 - unavailable (offline/down)
  1390.                                           2 - event
  1391.                                           3 - CONNECTED
  1392.                                           4 - waiting for reset */
  1393.     string string[37];                 /* status */
  1394.     longint bpsrate;                   /* bps rate */
  1395.     longint userid;                    /* user-ID */
  1396.     whosonflags flags;                 /* status flags */
  1397.     byte reserved2[45];                /* RESERVED */
  1398. }
  1399. nodesrec;
  1400.  
  1401. /*---------------------------------------------------------------------------*/
  1402.  
  1403. typedef struct          /* PROTOCOL.DAT - File transfer protocols */
  1404. {
  1405.     string desc[26];                   /* description */
  1406.     boolean active;                    /* active? */
  1407.     boolean batch;                     /* batch? (=filelist) */
  1408.     acstring acs;                      /* access control */
  1409.     string ulcmd[61];                  /* UL command line */
  1410.     string dlcmd[61];                  /* DL command line */
  1411.     string ulcode[3][7];               /* UL result code */
  1412.     string dlcode[3][7];               /* DL result code */
  1413.     string envcmd[61];                 /* environment command */
  1414.     string templog[26];                /* temporary log file */
  1415.     string flist[6];                   /* DL file list */
  1416.     byte logpf;                        /* log - word # (filename) */
  1417.     byte logpr;                        /* log - word # (result) */
  1418.     boolean success;                   /* results = success? */
  1419.     boolean bidirec;                   /* bi-directional */
  1420. }
  1421. protrec;
  1422.  
  1423. /*---------------------------------------------------------------------------*/
  1424.  
  1425. typedef struct          /* SHORTMSG.DAT -  Logon messages/receipts */
  1426. {
  1427.     longint userid;                    /* to user id (0=deleted) */
  1428.     string msg[156];                   /* message */
  1429.     byte msgid;                        /* msgid - INTERNAL USE
  1430.                                           should *always* be 0
  1431.                                           if set by external utils */
  1432.     unixtime written;                  /* date written to file */
  1433. }
  1434. shortmsgrec;
  1435.  
  1436. /*---------------------------------------------------------------------------*/
  1437.  
  1438. typedef struct          /* SIGS.DAT : Message signature records */
  1439. {
  1440.      longint userid;                   /* user-ID - from user record */
  1441.                                        /*   checked to verify that */
  1442.                                        /*   signature pointers are to */
  1443.                                        /*   the correct signatures */
  1444.      string shortsig[79];              /* short signature - one line */
  1445.      string longsig[241];              /* long signature < four lines */
  1446. }
  1447. sigsrec;
  1448.  
  1449. /*---------------------------------------------------------------------------*/
  1450.  
  1451. typedef struct          /* SMACROS.DAT : SysOp Macros */
  1452. {
  1453.     string macro[10][121];             /* SysOp Macros F1..F10 */
  1454. }
  1455. smacrorec;
  1456.  
  1457. /*---------------------------------------------------------------------------*/
  1458.  
  1459. typedef struct          /* TIMELOG.DAT - Daily/hourly usage tracking */
  1460. {
  1461.     unixtime startdate;                /* date graph started */
  1462.     word busyperhour[24];              /* busy per hour */
  1463.     word busyperday[7][72];            /* busy per DOW, 20 minute intervals */
  1464. }
  1465. timelogrec;
  1466.  
  1467. /*---------------------------------------------------------------------------*/
  1468.  
  1469. typedef struct          /* VOTING.DAT - Voting records */
  1470. {
  1471.     boolean active;                    /* active? */
  1472.     string question[80];               /* voting question */
  1473.     acstring voteacs;                  /* voting ACS */
  1474.     acstring addacs;                   /* add answer ACS */
  1475.     word numusers;                     /* # of users answering */
  1476.     byte numans;                       /* # of active answers */
  1477.     struct
  1478.     {
  1479.         string desc[61];               /* answer description */
  1480.         word numres;                   /* # votes for this answer */
  1481.     }
  1482.     answer[NUMVOTEAS];
  1483. }
  1484. voterec;
  1485.  
  1486. /*****************************************************************************/
  1487. /* ---------------------- EXTERNAL DATA STRUCTURES ------------------------- */
  1488. /*****************************************************************************/
  1489.  
  1490. /*
  1491.     The following structures are all derived from external sources and are
  1492.     not internal to Telegard 3.0 (i.e. the same format listed below is used
  1493.     for all other compatible products using the same specifications).
  1494.  
  1495.     For more information on the structures which are listed below, please
  1496.     refer to the DEVEL309.DOC documentation, which contains contact
  1497.     information and further reference listings for these structures.
  1498. */
  1499.  
  1500. /*****************************************************************************/
  1501. /* ------------ NODELIST FILE STRUCTURES ("VERSION 6" FORMAT) -------------- */
  1502. /*****************************************************************************/
  1503.  
  1504. typedef struct          /* NODELIST.DAT status flags */
  1505. {
  1506.     bit hub : 1;                       /* node is a net hub */
  1507.     bit host : 1;                      /* node is a net host */
  1508.     bit region : 1;                    /* node is a region coord */
  1509.     bit zone : 1;                      /* node is a zone coord
  1510.     bit cm : 1;                        /* runs continuous mail */
  1511. }
  1512. nodeflags;
  1513.  
  1514. typedef struct          /* NODELIST.DAT modem type flags */
  1515. {
  1516.     bit hst : 1;                       /* node uses a USRobotics HST modem */
  1517.     bit pep : 1;                       /* node uses a Telebit PEP modem */
  1518.     bit v32 : 1;                       /* node uses a V.32 modem */
  1519.     bit v32b : 1;                      /* node uses a V.32bis modem */
  1520.     bit h96 : 1;                       /* node uses a Hayes Express96 modem */
  1521. }
  1522. modemtypes;
  1523.  
  1524. typedef struct          /* NODELIST.DAT - Version 6 nodelist data */
  1525. {
  1526.     integer net;                       /* net number */
  1527.     integer node;                      /* node number */
  1528.     integer cost;                      /* cost per minute to call */
  1529.     byte name[34];                     /* node name */
  1530.     byte phone[40];                    /* phone number */
  1531.     byte city[30];                     /* city and state */
  1532.     byte password[8];                  /* password */
  1533.     integer realcost;                  /* phone company's charge */
  1534.     integer hubnode;                   /* node # of this nodes hub (0=none) */
  1535.     byte rate;                         /* actual bps rate divided by 300 */
  1536.     modemtypes modem;                  /* modem type codes */
  1537.     nodeflags flags;                   /* set of flags */
  1538.     byte res[3];                       /* RESERVED */
  1539. }
  1540. nodedatarec;
  1541.  
  1542. typedef struct          /* NODELIST.IDX - Version 6 nodelist index */
  1543. {
  1544.     integer node;                      /* node number */
  1545.     integer net;                       /* net number */
  1546. }
  1547. nodeindexrec;
  1548.  
  1549. /*****************************************************************************/
  1550. /* ------------ NODELIST FILE STRUCTURES ("VERSION 7" FORMAT) -------------- */
  1551. /*****************************************************************************/
  1552.  
  1553. typedef struct          /* NODELIST.DAT Version 7 status flags */
  1554. {
  1555.    bit ishub : 1;                      /* node is a net hub */
  1556.    bit ishost : 1;                     /* node is a net host */
  1557.    bit isregion : 1;                   /* node is region coord */
  1558.    bit isgate : 1;                     /* node is a zone gateway */
  1559.    bit iscm : 1;                       /* runs continuous mail */
  1560.    bit reserved : 7;                   /* RESERVED */
  1561.    bit ispoint : 1;                    /* node is a point */
  1562. }
  1563. node7flags;
  1564.  
  1565. typedef struct          /* NODELIST.DAT : Version 7 nodelist data */
  1566. {
  1567.      integer zone;                     /* node address */
  1568.      integer net;
  1569.      integer node;
  1570.      integer hubnode;                  /* hub node address */
  1571.      word callcost;                    /* Cost of call */
  1572.      word msgfee;                      /* Cost to user */
  1573.      node7flags flags;                 /* nodelist flags */
  1574.      byte modem;                       /* RESERVED */
  1575.      byte phlen;                       /* Phone # length */
  1576.      byte pwlen;                       /* PW length */
  1577.      byte boardlen;                    /* Board name length */
  1578.      byte sysoplen;                    /* SysOp name length */
  1579.      byte citylen;                     /* City length */
  1580.      byte packlen;                     /* Pack total length */
  1581.      byte baudrate;                    /* bps rate divided by 300 */
  1582.      /* ... data ... */
  1583.      byte data[160];                   /* packed data - length packlen */
  1584.      /* full length = phlen + pwlen + packlen */
  1585. }
  1586. node7datarec;
  1587.  
  1588. /*****************************************************************************/
  1589. /* ------------------- QWK OFFLINE MAIL FILE STRUCTURES -------------------- */
  1590. /*****************************************************************************/
  1591.  
  1592. typedef struct          /* MESSAGES.DAT - Message file header record */
  1593. {
  1594.     char status;                       /* message status flag:
  1595.                                           ' ' = public, unread
  1596.                                           '-' = public, read
  1597.                                           '+' = private, unread
  1598.                                           '*' = private, read
  1599.                                           '~' = comment to SysOp, unread
  1600.                                           '`' = comment to SysOp, read
  1601.                                           '%' = password protected, unread
  1602.                                           '^' = password protected, read
  1603.                                           '!' = group password, unread
  1604.                                           '#' = group password, read
  1605.                                           '$' = group password to all */
  1606.     char number[7];                    /* message number */
  1607.     char date[8];                      /* date (MM-DD-YY) */
  1608.     char time[5];                      /* time (HH:MM) */
  1609.     char msgto[25];                    /* To (uppercase) */
  1610.     char msgfrom[25];                  /* From (uppercase) */
  1611.     char subject[25];                  /* Subject */
  1612.     char password[12];                 /* password */
  1613.     char reference[8];                 /* reference message number */
  1614.     char blocks[6];                    /* # of blocks in message,
  1615.                                            including header block */
  1616.     byte active;                       /* $E1=active, $E2=to be deleted */
  1617.     word areanum;                      /* QWK area number */
  1618.     byte res[2];                       /* RESERVED */
  1619.     char tagline;                      /* contains network tagline :
  1620.                                           '*' = network tagline present
  1621.                                           ' ' = no tagline present */
  1622. }
  1623. qdatrec;
  1624.  
  1625. typedef struct          /* *.NDX - Message area index record */
  1626. {
  1627.     longint recnum;                    /* record number in MESSAGES.DAT,
  1628.                                           stored in Microsoft MKS$ format */
  1629.     byte areanum;                      /* area number (unused) */
  1630. }
  1631. qndxrec;
  1632.  
  1633. /****************************************************************************/
  1634. /* --------------------------- JAM STRUCTURES ----------------------------- */
  1635. /****************************************************************************/
  1636.  
  1637. typedef struct          /* *.JHR - JAM message area header - first record */
  1638. {
  1639.     char signature[4];                 /* message signature
  1640.                                           <J><A><M> followed by <NUL> */
  1641.     longint datecreated;               /* creation date */
  1642.     longint modeifycount;              /* modification counter */
  1643.     longint activemsgs;                /* active messages */
  1644.     longint passwordCRC;               /* CRC of password, -1 = none */
  1645.     longint basemsgnum;                /* lowest number in index */
  1646.     char reserved[1000];               /* reserved by JAM authors */
  1647. }
  1648. jaminforec;
  1649.  
  1650. typedef struct          /*  JAM message area attributes */
  1651. {
  1652.     bit jlocal : 1;                    /* local */
  1653.     bit jintransit : 1;                /* in-transit */
  1654.     bit jprivate : 1;                  /* private */
  1655.     bit jread : 1;                     /* read by receiver */
  1656.     bit jsent : 1;                     /* sent */
  1657.     bit jkillsent : 1;                 /* kill msg/sent */
  1658.     bit jarchivesent : 1;              /* archive msg/sent */
  1659.     bit jhold : 1;                     /* hold */
  1660.     bit jcrash : 1;                    /* crash */
  1661.     bit jimmediate : 1;                /* immediate */
  1662.     bit jdirect : 1;                   /* direct */
  1663.     bit jgate : 1;                     /* gate *
  1664.     bit jfilereq : 1;                  /* file requests */
  1665.     bit jfileattach : 1;               /* file attached */
  1666.     bit jtruncfiles : 1;               /* truncate (0 len) sent file */
  1667.     bit jillfiles : 1;                 /* kill sent files */
  1668.     bit jreceiptreq : 1;               /* receipt requested */
  1669.     bit jconfirmreq : 1;               /* confirmation of receipt */
  1670.     bit jorphan : 1;                   /* orpahned message */
  1671.     bit jencrypt : 1;                  /* encrypted message(*) */
  1672.     bit jcompress : 1;                 /* compressed message(*) */
  1673.     bit jescaped : 1;                  /* escaped message(*) */
  1674.     bit jforcepickup : 1;              /* force pickup */
  1675.     bit jtypelocal : 1;                /* local only */
  1676.     bit jtypeecho : 1;                 /* for echo dist'n */
  1677.     bit jtypenet : 1;                  /* for netmai dist'n */
  1678.     bit jRESERVED : 1;                 /* 0x04000000L */
  1679.     bit jRESERVED1 : 1;                /* 0x08000000L */
  1680.     bit jRESERVED2 : 1;                /* 0x10000000L */
  1681.     bit jnomsgdisplay : 1;             /* no message display */
  1682.     bit jlocked : 1;                   /* locked message */
  1683.     bit jdeleted : 1;                  /* deleted message */
  1684. }
  1685. jammsgattr;
  1686.  
  1687.  
  1688. typedef struct          /* *.JHR - JAM message headers */
  1689. {
  1690.     char signature[4];                 /* message signature */
  1691.                                        /* <J><A><M> followed by <NUL> */
  1692.     word revision;                     /* JAM revision level */
  1693.     word reserved1;                    /* reserved by JAM authors */
  1694.     longint subfieldlen;               /* length of subfields */
  1695.     longint timesread;                 /* # times message read */
  1696.     longint msgidCRC;                  /* CRC-32 of MSGID line */
  1697.     longint replyCRC;                  /* CRC-32 of REPLY line */
  1698.     longint replyto;                   /* reply to # */
  1699.     longint reply1st;                  /* 1st reply number */
  1700.     longint replynext;                 /* reply next */
  1701.     unixtime date;                     /* date written */
  1702.     unixtime datercvd;                 /* date received */
  1703.     unixtime dateproc;                 /* date processed (tosser/scanner) */
  1704.     longint msgnum;                    /* message number */
  1705.     jammsgattr attribute;              /* attributes */
  1706.     longint reserved2;                 /* reserved by JAM authors */
  1707.     longint textoffset;                /* offset of text in *.JDT file */
  1708.     longint textlen;                   /* length of text */
  1709.     longint passwordCRC;               /* CRC-32 of password */
  1710.     longint cost;                      /* cost of message */
  1711. }
  1712. jamhdrrec;
  1713.  
  1714. typedef struct          /* *.JHR - subfield records */
  1715. {
  1716.     word fieldid;                      /* subfield ID */
  1717.     word reserved1;                    /* reserved by JAM authors */
  1718.     longint datalen;                   /* length of buffer */
  1719. }
  1720. jamsubfieldrec;
  1721.  
  1722. typedef struct          /* *.JDX - JAM quick index */
  1723. {
  1724.     longint userCRC;                   /* CRC-32 of receipients name (lower) */
  1725.     longint hdroffset;                 /* offset to jamhdrrec */
  1726. }
  1727. jamindexrec;
  1728.  
  1729. typedef struct          /* *.JLR - JAM last read storage */
  1730. {
  1731.     longint userCRC;                   /* CRC-32 of users name (lower) */
  1732.     longint userID;                    /* unique user-ID */
  1733.     longint lastread;                  /* lastread pointer */
  1734.     longint highread;                  /* high read pointer */
  1735. }
  1736. jamreadrec;
  1737.  
  1738. /****************************************************************************/
  1739. /* ------------------------- SQUISH STRUCTURES ---------------------------- */
  1740. /****************************************************************************/
  1741.  
  1742. typedef struct          /* *.SQD - Squish message area header - first record*/
  1743. {
  1744.     word len_sqarea;                   /* length of this structure */
  1745.     word reserved;                     /* RESERVED */
  1746.     longint nummsgs;                   /* number of messages */
  1747.     longint highmsg;                   /* highest message(=nummsgs) */
  1748.     longint keepmsgs;                  /* # of messages to keep */
  1749.     longint hwmsgid;                   /* High Water message msg-ID # */
  1750.     longint lastmsgid;                 /* Last message msg-ID # */
  1751.     char basename[80];                 /* basename for Squishfile */
  1752.     longint beginframe;                /* offset to first message header */
  1753.     longint lastframe;                 /* offset to last message header */
  1754.     longint freeframe;                 /* offset to first FREE header */
  1755.     longint lastfreeframe;             /* offset to last FREE header */
  1756.     longint endframe;                  /* offset to end of file */
  1757.     longint maxmsgs;                   /* maximum number of messages */
  1758.     word keepdays;                     /* days to keep messages */
  1759.     word sqhdrsize;                    /* sice of header record */
  1760.     byte reserved2[124];               /* RESERVED */
  1761. }
  1762. sqarearec;
  1763.  
  1764. typedef struct          /* *.SQD - Message header */
  1765. {
  1766.     longint sqid;                      /* squish ID - $AFAE4453 */
  1767.     longint nextmsg;                   /* offset to last message */
  1768.     longint prevmsg;                   /* offset to previous message */
  1769.     longint framelength;               /* length of header & message */
  1770.     longint msglength;                 /* length of message */
  1771.     longint ctrllength;                /* length of control information */
  1772.     word headertype;                   /* Header type
  1773.                                           Message = 0
  1774.                                           Free    = 1 */
  1775.     word reserved;                     /* RESERVED */
  1776. }
  1777. sqhdrrec;
  1778.  
  1779. typedef struct          /* Squish Message Attributes */
  1780. {
  1781.     bit sprivate : 1;                  /* private */
  1782.     bit scrash : 1;                    /* crash */
  1783.     bit sread : 1;                     /* read by receiver */
  1784.     bit ssent : 1;                     /* sent */
  1785.     bit sfileattach : 1;               /* files attached */
  1786.     bit sintransit : 1;                /* in-transit */
  1787.     bit sorphan : 1;                   /* orphaned message */
  1788.     bit skillsent : 1;                 /* kill msg/sent */
  1789.     bit slocal : 1;                    /* local  */
  1790.     bit shold : 1;                     /* hold */
  1791.     bit sreserved : 1;                 /* reserved */
  1792.     bit sfilereq : 1;                  /* file requests */
  1793.     bit sreceiptreq : 1;               /* receipt requested */
  1794.     bit sconfirmreq : 1;               /* confirmation of receipt */
  1795.     bit saudit : 1;                    /* audit trail requested */
  1796.     bit supdate : 1;                   /* update request */
  1797.     bit sscanned : 1;                  /* echomail scanned */
  1798.     bit smsgid : 1;                    /* valid msgid? */
  1799.     bit sres1 : 1;                     /* reserved */
  1800.     bit sres2 : 1;
  1801.     bit sres3 : 1;
  1802.     bit sres4 : 1;
  1803.     bit sres5 : 1;
  1804.     bit sres6 : 1;
  1805.     bit sres7 : 1;
  1806.     bit sres8 : 1;
  1807.     bit sres9 : 1;
  1808.     bit sres10 : 1;
  1809.     bit sres11 : 1;
  1810.     bit sres12 : 1;
  1811.     bit sres13 : 1;
  1812.     bit sres14 : 1;
  1813. }
  1814. sqshmsgattr;
  1815.  
  1816.  
  1817. typedef struct          /* *.SQD - Message Info Header */
  1818. {
  1819.     sqshmsgattr attribute;             /* Message attributes */
  1820.     char msgfrom[36];                  /* Message from - NUL terminated */
  1821.     char msgto[36];                    /* Message to - NUL terminated */
  1822.     char subject[72];                  /* Message subject - NUL terminated */
  1823.     struct
  1824.     {
  1825.         word zone, net,
  1826.              node, point;
  1827.     } origaddr, destaddr;              /* Origin/Destination addresses */
  1828.     bitmapdate origdate;               /* Original date (utc) */
  1829.     bitmapdate msgdate;                /* Arrival (system) date (utc) */
  1830.     word utcoffset;                    /* Minutes offset of UTC */
  1831.     longint replyto;                   /* Reply-to msg-ID # */
  1832.     longint replies[9];                /* Replies msg-ID # */
  1833.     longint msgid;                     /* Message ID */
  1834.     char rawdate[20];                  /* ASCII date - NUL terminated */
  1835. }
  1836. sqxmsgrec;
  1837.  
  1838. typedef struct          /* *.SQI - Squish Message Index */
  1839. {
  1840.     longint msgptr;                    /* offset of sqfhdr record */
  1841.     longint msgid;                     /* msg-ID # */
  1842.     longint hash;                      /* hash of 'To' name */
  1843. }
  1844. sqindexrec;
  1845.  
  1846. typedef struct          /* *.SQL - Squish Last Read Index */
  1847. {
  1848.     longint msgid;                     /* msg-ID # */
  1849. }
  1850. sqreadrec;
  1851.  
  1852. /****************************************************************************/
  1853. /* ------------------------ TESTINFO.DAT FORMAT --------------------------- */
  1854. /****************************************************************************/
  1855.  
  1856.  
  1857. typedef struct          /* TESTINFO.DAT - individual file record */
  1858. {
  1859.     boolean sfx;                       /* is self-extracting file? */
  1860.     boolean exists;                    /* file exists */
  1861.     string full_path[61];              /* full file path */
  1862.     string path[61];                   /* file path */
  1863.     string drive[3];                   /* file drive (incl colon) */
  1864.     string name[9];                    /* filename (raw) */
  1865.     string ext[4];                     /* extension */
  1866.     string filetype[4];                /* file type(*) */
  1867.     longint date;                      /* file date_time (packed) */
  1868.     longint size;                      /* file size */
  1869. }
  1870. testinfofilerec;
  1871.  
  1872. typedef struct          /* TESTINFO.DAT */
  1873. {
  1874.     boolean processed;                 /* record has been processed */
  1875.     boolean desc_vendinfo;             /* vendinfo.diz description */
  1876.     boolean desc_import;               /* import descriptions? */
  1877.     boolean addtofbd;                  /* add file to file database */
  1878.     boolean file_conv;                 /* file converted? */
  1879.     boolean user_ansi;                 /* detected ansi */
  1880.     boolean user_avatar;               /* detected avatar */
  1881.     boolean user_carrier;              /* carrier detected last check */
  1882.     byte reserved1[9];                 /* RESERVED */
  1883.     byte check_count;                  /* update/check count */
  1884.     byte bbs_type;                     /* BBS type (TG3.0 = 6) */
  1885.     byte user_comport;                 /* user com port */
  1886.     byte exit_level;                   /* exit level for test */
  1887.     byte revision;                     /* testinfo.dat revision level */
  1888.     byte reserved2[9];                 /* RESERVED */
  1889.     longint test_datetime;             /* testing date/time */
  1890.     byte reserved3[40];                /* RESERVED */
  1891.     string thd_options[61];            /* THDPRO command line options */
  1892.     string bbs_path[61];               /* path to BBS data files */
  1893.     string creator[61];                /* TESTINFO.DAT creator */
  1894.     string thd_log[61];                /* THDPRO log path */
  1895.     byte reserved4[183];               /* RESERVED */
  1896.     string ver_major[3];               /* creator - major version */
  1897.     string ver_minor[3];               /* creator - minor version */
  1898.     string thd_session[4];             /* THDPRO session number */
  1899.     string desc_filename[13];          /* description file filename */
  1900.     byte reserved5[39];                /* RESERVED */
  1901.     testinfofilerec file_original;     /* original file information */
  1902.     testinfofilerec file_finished;     /* finished file information */
  1903.     byte reserved6[10];                /* RESERVED */
  1904.     integer desc_length;               /* length of description */
  1905.     char desc[1500];                   /* description */
  1906. }
  1907. testinforec;
  1908.  
  1909. #endif
  1910.