
{ Many people have asked me to include a list of various file formats
  used by GSBBS. Thus I am including this, along with some brief comments
  as to which format refers to which file. Beyond that, you're on your
  own.. good luck!

  Taken from unit BBSCONST interface section.

                  -- Jones }

const
  version  = 'GSBBS v3.01';

  applying = 'BBSINFO\APPLYING.TXT';
  welcome  = 'BBSINFO\WELCOME.TXT';   {Info files:    }
  otherBBS = 'BBSINFO\BBSLIST.TXT';
  helpfile = 'BBSINFO\BBSHELP.TXT';
  sysinfo  = 'BBSINFO\SYSINFO.TXT';
  bulletin = 'BBSINFO\BULLETIN.TXT';
  filehelp = 'BBSINFO\FILEHLP.TXT';
  mainmenu = 'BBSINFO\MAINMENU.TXT';
  readmenu = 'BBSINFO\READMENU.TXT';
  filemenu = 'BBSINFO\FILEMENU.TXT';
  editmenu = 'BBSINFO\EDITMENU.TXT';
  wallmenu = 'BBSINFO\WALLMENU.TXT';
  titles   = 'BBSINFO\TITLES.CNF';
  filefile = 'BBSINFO\FILES.CNF';
  ichelp   = 'BBSINFO\BASIC.IC';
  chathours= 'BBSINFO\CHATHOUR.DAT';
  cookies  = 'BBSINFO\DAILYMSG.DAT';
  doorconf = 'BBSINFO\EXTRNALS.CNF';
  doorinfo = 'BBSINFO\DOORBULL.TXT';
  wallfname= 'BBSINFO\WALLFILE.DAT';
  loserfile= 'BBSINFO\LOSERS.DAT';
  aliasfile= 'BBSINFO\ALIASES.DAT';
  compress = 'BBSINFO\COMPRESS.DAT';
  originfilename =
             'BBSINFO\ORIGINS.DAT';
  arcdir   = 'ARCTMP\';

  ids        = 'IDS.BBS';
  configfile = 'CONFIG.CNF';
  ulogfile   = 'USERLOG.TXT';
  timefile   = 'TIMELOG.BBS';
  userfile   = 'USER.TXT';

  bybyflagfile = 'bybyfile.$$$';
  popoutflagfile = 'timetogo.$$$';
  endfrontendfile = 'back_up.$$$';

  separator = '=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=';

  sysop   = 5;  { Access levels }
  prefuser= 4;
  expuser = 3;
  reg     = 2;
  newuser = 1;
  bozo    = 0;

  null      = #0;
  abort     = #3;
  bell      = #7;
  bksp      = #8;
  tab       = #9;
  lnfd      = #10;
  cls       = #12;
  cr        = #13;
  pause     = #19;
  esc       = #27;
  space     = #32;
  echo      = true;
  noecho    = false;
  maxnumsects  = 50; { Maximum number of subboards }
  maxlength = 99;    { Maximum length of the messages in lines }
  maxmess = 500;     { Maximum number of msgs per subboard }

  ProductCode : byte = $57;    { FTSC Product Code for GSBBS }
                               { DO NOT CHANGE WITHOUT PERMISSION! }

type
  name      = string[14];
  longname  = string[25];
  filbuffer = array[0..127] of byte;
  line      = string[80];
  person    = string[27];
  str10     = string[10];
  string20  = string[20];
  string36  = string[36];
  long      = string[150];
  longline  = string[132];

  timerec   = record
                year  : byte;
                month : byte;
                day   : byte;
                hour  : byte;
                min   : byte;
              end;

numsecrange = 1..maxnumsects;
one2_30   = array[numsecrange] of longint;

gscanrangetype = set of numsecrange;

{ FORMAT OF IDS.BBS USER FILE }

sysid     = record
             vrfd: boolean;                   { true if a verified user }
             user: person;                    { handle }
            user2: longname;                  {real name}
            addr : longname;                  {street address}
            city : longname;                  {city}
            szip : longname;                  {state & zip }
            phnn : name;                      {phone number}
             exfl: byte;                      {EXPERT USER}
             lsto: timerec;                   {LAST TIME ON}
            intlg: timerec;                   {date first logged on}
             dld : word;                      { # of downloads }
             uld : word;                      { # of uploads }
             mptd: word;                      { # of messages posted }
             lgdn: word;                      { # of logons }
             lstm: one2_30;                   {LAST MESSAGE READ}
             pass: name;                      {PASSWORD}
              acc: byte;                      {ACCESS LEVEL}
            speca: byte;                      {special access}
              clr: name;                      {CLEAR SCREEN CHARACTERS}
              bsp: char;                      {BACKSPACE CHAR}
              lnf: char;                      {LINEFEED CHAR}
              upc: boolean;                   {UPPER CASE ONLY}
              wid: byte;                      {SCREEN WIDTH}
           height: byte;                      {length of user screen}
              tto: timerec;                   {time used today}
            money: byte;                      {how much if any donated}
           cookie: word;                      {where in fortune file we are}
           gscans: gscanrangetype;            {what boards to globalscan}
             junk: string[10];                { filler.. for non-fatal expansion }
           end;

{ FORMAT OF TIMELOG.BBS }

  log = record                  { timelog.bbs record }
          who: person;          { User name }
          rate:string[4];       { baud rate used}
          msgs:string[2];       { # of msgs posted }
          when: timerec;        { log in time }
          done: timerec         { log off time }
        end;

{ IMPORTANT: An array of 1..MAXMESS of 'messages' is allocated on the heap.
  If you change the size of this structure be sure to change the memory
  compiler directive ($M) in the main unit of the program! }

{ FORMAT OF TITLEx.BBS }

   messages = record
             sender   : string36;          { record describing the }
             recver   : string36;          { TITLEX.bbs files }
             subject  : string[72];
             date     : name;
             messno   : longint;     { <- Unique for all msgs, usually last msg + 1}
             pointer  : longint;     { <- pointer to 1st record in MESSX.BBS file}
             fromnet,
             fromnode : integer;     { where it came from }
        end;

  messpointer = ^messages;

{ FORMAT OF MESSx.BBS }

  messrec = record                 {records used in the messx.bbs files}
            mtext  : string[80];   {holds text of msgs}
            pmess  : longint;      {hold pointer to next record in msg}
         end;

  sectrec = record                 { describes the titles.cnf file}
              sectname : string[40]; { ie '1. General board' }
              subdir   : string[40]; { subdirectory msg are in }
              sectaccess : byte;     { minimun access level needed to use}
              specaccess : byte;     { special access if any needed to use}
              anon_allowed:boolean;  { whether you can post anonymously on sub }
              echoname : string[61]; { if echo sub, what the net calls the area }
              special_net,           { in some cases, send the echo }
              special_node: integer; { to a system other than the hub }
              elsewhere: boolean;    { And sometimes, we're a hub! }
            end;

{ If we're a hub for, say, area #13, then there should exist a file
  called 'MSGSHARE.13' in the same dir as message area 13 is kept..
  this file should contain, one per line,

net node
net node
net node

  .. of places to send it to. This should not include whereever you get it from,
  and should not contain any node twice.

  If you want to route a message base to some node via some other node,
  this is done by using the format

net node net2 node2

  'net' and 'node' are the nodes to eventually recieve the message;
  'net2' and 'node2' are who we forward it via.
  }

  sectnames = array[1..maxnumsects] of sectrec;
  messtext  = array[1..maxlength] of line;

  yesno     = array[boolean] of string[3];

  ExecWSwapType  = function (x, y: String): Word;
  InitESwapType  = function (x: pointer; y: String): Boolean;
  CloseESwapType = procedure;

const yn: yesno = ('NO','YES');
   onoff: yesno = ('Off','On');

{ FORMAT OF BBSINFO\DAILYMSG.DAT }

    datafile: file of longline;

{ FORMAT OF BBSINFO\WALLFILE.DAT }

const
  mlen = 35;

type
  walldat = array [1..20] of string[mlen];

var
  wallfile: file of walldat;

