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

  1. {    ircle - Internet Relay Chat client    }
  2. {    File: IRCGlobals    }
  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 IRCGlobals;
  20. { Contains global constants and variables }
  21.  
  22. interface
  23. uses
  24.     TCPTypes, TCPStuff, TCPConnections, MsgWindows;
  25.  
  26. type
  27.     defaultType = record
  28.             Port: integer;
  29.             Server, Nick, username, userLoginName, autoExec: str255;
  30.             notify: array[1..4] of boolean;
  31.         end;
  32.     defaultPtr = ^defaultType;
  33.     defaultHndl = ^defaultPtr;        { Preferences }
  34.  
  35.     shortcutsType = array[1..10] of str255;
  36.     shortcutsPtr = ^shortcutsType;
  37.     shortcutsHndl = ^shortcutsPtr;    { Shortcuts }
  38.  
  39.     FSType = record
  40.             fnt, siz: integer
  41.         end;
  42.     FSPtr = ^FSType;
  43.     FSHndl = ^FSPtr;                { default font/size }
  44.  
  45.     Table = packed array[char] of char;
  46.     TablePtr = ^Table;
  47.     TableHndl = ^TablePtr;        { charset translation table }
  48.  
  49.     str20 = string[20];
  50.     CEPtr = ^ConnectionEventRecord;
  51.  
  52.  
  53. const
  54.     COSPACE = 10000;        { Workspace to allocate for Coroutines }
  55.     LOFREEMEM = 20000;        { Memory checking lower (critical) bound }
  56.     HIFREEMEM = 30000;        { Memory checking higher (uncritical) bound }
  57.     MEMTIME = 30;            { Memory checking timeout (seconds) }
  58.  
  59.     DCC_CHAT_PREFIX = '=';
  60.     DCC_CHAT_POSTFIX = '=';
  61.     INACTIVE_PREFIX = '(';
  62.     INACTIVE_POSTFIX = ')';
  63.  
  64. { Error messages (STR#256 indexes) }
  65.     E_NOSERVER = 1;        { Not connected }
  66.     E_NOTARGET = 2;        { Not talking to a target }
  67.     E_SFAILED = 3;            { Corresponding with ConnectionEvents }
  68.     E_NSFAILED = 4;
  69.     E_OFAILED = 5;
  70.     E_CLOSING = 6;
  71.     E_CLOSED = 7;
  72.     E_OPEN = 8;            { Attempting to re-open }
  73.  
  74. { Connection status }
  75.     S_CONN = 0;            { connected }
  76.     S_OFFLINE = 1;            { offline }
  77.     S_LOOKUP = 2;            { DNS lookup }
  78.     S_OPENING = 3;            { connecting }
  79. { Server versions }
  80.     SV_27 = 27;
  81.     SV_28 = 28;
  82.  
  83. { Alerts }
  84.     A_INFO = 128;            { About box }
  85.     A_TCPERR = 129;        { Cannot open TCP driver }
  86.     A_QUIT = 131;            { Ask whether to quit }
  87.     A_LOWMEM = 259;        { Memory shortage }
  88.     A_OPKILL = 260;        { Operator kill }
  89.     A_SSTAT = 261;        { Server connection status }
  90.  
  91. { Dialogs }
  92.     D_INFOPOP = 130;        { Popup status window }
  93.     D_PREFS = 256;            { Preferences }
  94.     D_SHCUTS = 257;        { Shortcuts }
  95.  
  96. { Menus }
  97.     M_F_OPEN = 1;
  98.     M_F_CLOSE = 2;
  99.     M_F_LOG = 4;
  100.     M_F_FLUSH = 5;
  101.     M_F_PREFS = 7;
  102.     M_F_QUIT = 9;
  103.     M_COMMANDS = 259;        { Commands menu }
  104.     M_CO_JOIN = 1;
  105.     M_CO_PART = 2;
  106.     M_CO_LIST = 4;
  107.     M_CO_WHO = 5;
  108.     M_CO_QUERY = 7;
  109.     M_CO_WHOIS = 8;
  110.     M_CO_INVITE = 9;
  111.     M_CO_KICK = 10;
  112.     M_CO_AWAY = 12;
  113.     M_CO_MSG = 13;
  114.     M_SHCUTS = 261;        { Shortcuts menu }
  115.     M_SH_DEFINE = 1;
  116.     M_SH_FIRST = 2;
  117.     M_FONT = 262;            { Fonts menu }
  118.     M_FO_9 = 1;
  119.     M_FO_10 = 2;
  120.     M_FO_12 = 3;
  121.     M_FO_14 = 4;
  122.     M_FO_FIRST = 5;
  123.     M_WINDOWS = 263;        { Windows menu }
  124.     M_WI_CYCLE = 1;
  125.     M_WI_MAIN = 2;
  126.     M_WI_FIRST = 3;
  127.  
  128.  
  129. var
  130. { general status vars }
  131.     CL_VERSION: string;        { Version of this program }
  132.     serverVersion,             { Version of server }
  133.     serverStatus: integer;    { Connection status: 0=ok, -1=not connected, or TCP error codes }
  134.     validPrefs,                { Indicates whether preferences are set proper }
  135.     QuitRequest,            { Will quit }
  136.     flushing,                 { Ignore server output up to end of list }
  137.     logging,                { Logging to file }
  138.     IsAway,                { AWAY status set }
  139.     inBackground,            { Running in background }
  140.     notified                { User has got notfication from background }
  141.     : boolean;
  142.     sSocket: connectionIndex;    { Server connection }
  143.     lastWindow: MWHndl;        { window las notice went in }
  144.     readTimeout,            { timeout for TCP reading }
  145.     idleTime: longint;        { time when last command sent }
  146.     NFT: integer;            { number of DCC filetransfers in progress }
  147.  
  148. { user vars }
  149.     CmdChar: char;            { Command prefix }
  150.     serverConn,             { server to connect to }
  151.     CurrentServer,             { server currently connected to }
  152.     CurrentTarget,            { current target to talk to (corresponds to active window) }
  153.     lastInvite                { Channel to which got last invited }
  154.     : str255;
  155.     CurrentNick,             { Nickname }
  156.     lastMsg                { Nick who sent last MSG }
  157.     : str20;
  158.     logfile: text;            { File to log to }
  159.     serverPort: integer;        { Port to connect to }
  160.  
  161. { user preferences }
  162.     default: defaultHndl;
  163.     Shortcuts: shortcutsHndl;
  164.     defFont: FSHndl;
  165.  
  166.     ISOEncode, ISODecode: TableHndl;
  167.  
  168.  
  169. implementation
  170. { Global variables get initialized in IRCInit }
  171. end.