home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / IRC client Source / ircle sources / IRCInit.p < prev    next >
Encoding:
Text File  |  1993-07-19  |  2.3 KB  |  87 lines  |  [TEXT/PJMM]

  1. {    ircle - Internet Relay Chat client    }
  2. {    File: IRCInit    }
  3. {    Copyright © 1992 Olaf Titz (s_titz@ira.uka.de)    }
  4.  
  5. {    This program is free software; you can redistribute it and/or modify    }
  6. {    it under the terms of the GNU General Public License as published by    }
  7. {    the Free Software Foundation; either version 2 of the License, or    }
  8. {    (at your option) any later version.    }
  9.  
  10. {    This program is distributed in the hope that it will be useful,    }
  11. {    but WITHOUT ANY WARRANTY; without even the implied warranty of    }
  12. {    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    }
  13. {    GNU General Public License for more details.    }
  14.  
  15. {    You should have received a copy of the GNU General Public License    }
  16. {    along with this program; if not, write to the Free Software    }
  17. {    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.    }
  18.  
  19. unit IRCInit;
  20. { Startup code. }
  21.  
  22. interface
  23. uses
  24.     TCPTypes, TCPStuff, TCPConnections, Coroutines, ApplBase, MsgWindows, InputLine, {}
  25.     IRCGlobals, IRCaux, IRCPreferences, IRCInput, {}
  26.     IRCNotify, IRCIgnore, DCC, IRCCommands, IRCChannels, IRCSComm, IRCHelp;
  27.  
  28. function IRCInitAll: boolean;
  29. { This will call ALL module startups and init ALL global variables. }
  30. { Returns false if program cannot be run. }
  31.  
  32. implementation
  33.  
  34. { Putting this module of 200+ bytes of code into an extra segment }
  35. { is a typical instance of memory management paranoia :-) }
  36.  
  37. function IRCInitAll: boolean;
  38.     var
  39.         i: integer;
  40.         s: str255;
  41.     begin
  42.         i := InitConnections;
  43.         if i <> noErr then begin
  44.             NumToString(i, s);
  45.             ParamText(s, '', '', '');
  46.             i := Alert(A_TCPERR, nil);
  47.             IRCInitAll := false
  48.         end
  49.         else begin
  50.             InitCoroutines;
  51.             ApplInit;
  52.             WNETime := 1;
  53.             InitMsgWindows;
  54.             InitInputLine;
  55.             InitIRCPreferences;
  56.             InitDCC;
  57.             InitIRCChannels;
  58.             InitIRCInput;
  59.             InitIRCHelp;
  60.             InitIRCNotify;
  61.             InitIRCIgnore;
  62.             ISOEncode := TableHndl(GetResource('Tabl', 256));
  63.             ISODecode := TableHndl(GetResource('Tabl', 257));
  64.             CmdChar := '/';
  65.             CurrentServer := '';
  66.             CurrentTarget := '';
  67.             lastInvite := '';
  68.             lastMSG := '';
  69.             currentNick := '';
  70.             flushing := false;
  71.             logging := false;
  72.             readTimeout := 10;
  73.             GetDateTime(idleTime);
  74.             InitCursor;
  75.             QuitRequest := false;
  76.             IsAway := false;
  77.             inBackground := false;
  78.             notified := false;
  79.             lastWindow := nil;
  80.             NFT := 0;
  81.             Watch := GetCursor(WatchCursor);
  82.             validPrefs := GetPrefs(false);
  83.             IRCInitAll := true
  84.         end;
  85.     end;
  86.  
  87. end.