OVRCALL.PAS

3.8 KB 1d70741bc1e107a0…
{
 now been redone with xms routines
}
{$I DIRECT.INC}
Unit OvrCall;
Interface Uses Dos, Crt, GenTypes, Overlay, Configrt,gensubs,skashit,ovrXms,
               dosmem;
{::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::}
Var X : Byte;
Implementation
{::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::}
Begin
  clrscr;
  skaWrite('|15     Infusion Bulletin Board Software, ver '+versionNum+' Initialization Sequence|CR');
  skaWrite('|07      (C)Copyright Infusion Technologies 1996-2003.  All rights reserved.|CR');
  showLine;
  skaWrite('|08:|07:|15: |07Initializing Infusion '+versionNum+' at '+timeStr(now)+' on '+dateStr(now)+'..|CR');
  skaWrite('|08:|07:|15: |07Examining batch run and command line parameters..|CR');
  if (paramstr(1)<>'runningfrombatch') and (upString(paramStr(1))<>'/O') then
   begin
    skaWrite('|08:|07:|15: |07Error, Infusion has not been run through system batchfile..|CR');
    showLine;
    skaWrite('|07  Infusion utilizes a batch oriented runtime system in order to efficiently|CR');
    skaWrite('|07  manage runtime events and operations of that sort.  If you are running your|CR');
    skaWrite('|07  Infusion system with a front end mailer, then please run |15INFUSION.EXE|07 with |CR');
    skaWrite('|07  the |15/O /X|07 parameters.  Otherwise, |15INF.BAT|07 must be used.  Thank you.|CR');
    showLine;
    halt(5);
   end;
  if (ParamStr(2) = '-?') or (Paramstr(2) = '/?') or (upstring(paramstr(1)) = 'HELP') then
    begin
      if exist(cfg.screensdir+'HELP.BIN') then
       begin
        clrscr;
        LoadTextScreen(cfg.screensdir+'HELP.BIN')
        end else
        begin
        clrscr;
        showMainLogo;
        showElite('|15valid infusion command line parameters are as follows - |CR|CR');
        skaWrite('|07         "local" - loads infusion in local mode, with no modem i/o|CR');
        skaWrite('|07          "/n #" - loads the supplied node (default is node 1)|CR');
        skaWrite('|07            "/x" - loads infusion with a user on the current node|CR');
        skaWrite('|07            "/o" - in conjunction with "/x" this allows infusion.exe to be|CR');
        skaWrite('|07                   run instead of inf.bat (for front end mailers, etc)|CR|CR');
        end;
      halt(5);
      end;
{::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::}
  For x := 2 to ParamCount Do
    If (upstring(ParamStr(x)) = '-N') or (upstring(ParamStr(x)) = '/N')
      Then ConfigFile := 'NODE'+ParamStr(x+1)+'.DAT';
  TextAttr := 8;
  skaWrite('|08:|07:|15: |07Examining |15'+configFile+'|07 configuration..|CR');
  dos_getMem(cfg,sizeOf(cfg) + 1);
  ReadCfg(False);
  skaWrite('|08:|07:|15: |07Configuration file passed inspection..|CR');
  skaWrite('|08:|07:|15: |07Initializing |15INFUSION.OVR|07 system overlay data..|CR');
  OvrInit('INFUSION.OVR');
  If cfg.UseEMS Then
  Begin
    OvrInitXMS;
      If (OvrResult <> OvrOk) Then
    Begin
      OvrInitEMS;
      If (OvrResult <> OvrOK) and cfg.UseEMS then
      Begin
        skaWrite('|08:|07:|15: |07Error, sufficient XMS for overlay cannot be allocated..|CR');
        skaWrite('|08:|07:|15: |07Loading overlay as binary disk buffer instead..|CR');
      End;
    End;
  End Else
  If OvrResult <> OvrOK then
  Begin
    skaWrite('|08:|07:15: |07Error, |15INFUSION.OVR|07 cannot be found or is corrupted..|CR');
    showLine;
    skaWrite('|07  Infusion requires a system overlay file at all times to be present in the|CR');
    skaWrite('|07  root directory.  Please obtain a new overlay from the distribution archive.|CR');
    showLine;
    Halt(4);
  End;
  if oVrResult=OvrOk then begin
    skaWrite('|08:|07:|15: |07Infusion overlay succesfully initialized..|CR');
    end;
End.