/*ProfiPacket - packet radio terminal program
  Copyright (C) 1999  Alexander Feigl

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

  Author:

  Alexander Feigl
  Burachstraße 51

  D-88250 Weingarten

  Mail : Alexander.Feigl@gmx.de
*/

#ifdef AmigaOS
#include <libraries/mui.h>
#endif /*AmigaOS*/


#include "QSO.h"

#include "User.h"


extern Object *Application;
extern Object *MainWindow;
extern Object *PrefWindow;
extern Object *MessageWindow;
extern Object *MessageGroup;
extern Object *LaunchWindow;
extern Object *SaveBufferWindow;
extern Object *ConnectWindow;
extern Object *UserSettingsWindow;
extern Object *FileTransferWindow;
extern Object *FilterWindow;

#ifndef DISABLE_BBS
extern Object *BBSMainWindow;
extern Object *BBSSendWindow;
extern Object *BBSViewWindow;
extern struct BBSObject *BBSHook;

#endif

extern Object *ConnectMsgWindow;
extern Object *SpyWindow;
extern Object *PrefDataspace;
extern Object *MHeardWindow;
extern Object *MHeardLWindow;
extern Object *GetUserDataWindow;
extern Object *EncryptionWindow;

extern unsigned char *HuffmanSpeedup;



extern unsigned long RestartProgram;
extern void *PcFont8;
extern struct timerequest *TimerRequest;
extern struct MsgPort *TimerPort;
extern unsigned long GUIPollCounter;
extern unsigned long QSOPollCounter;
extern unsigned long PacketPollCounter;
extern unsigned long MailPollCounter;
extern unsigned long MUISignal;
extern struct DateStamp CurrentDateStamp;
extern struct DateStamp LastSysopActivity;
extern unsigned char TickerLine[80];
extern signed long ActiveChannel;
extern struct QSO *QSOs;
extern struct Spy *Spys;
extern void *MenuBuild;
extern unsigned char WindowTitle[80];
extern unsigned long InsertMode;
extern signed long AltASCII;
extern unsigned long NumLock;
extern unsigned long OldTimeMins;

extern struct LockCall *LockCalls;

extern unsigned long MaxSpy;
extern unsigned long MaxChannel;
extern   signed long MonitorSaveChannel;

extern unsigned long MessageWindowTime;
extern unsigned long MessageWindowSecs;

extern unsigned long CMessageNr;

extern unsigned long HardwareInfo[8];
extern unsigned long HardwareInfoData[8];

extern struct CatalogCache *CatalogHook;


struct GlobalArraysSTR {
         unsigned char *PrefArray1[16];
         void *PrefObjects[128];
         unsigned char *PrefArray2[6];
         unsigned char *PrefArray3[3];
         unsigned char *PrefArray6[4];
         unsigned char *PrefArray7[4];
         unsigned char *PrefArray8[16];
         unsigned char *PrefArray9[8];
         unsigned char *PrefArray10[8];
         unsigned char *PrefArray11[8];
         void *MainObjects[48];
         unsigned char *HardwarePages[40];
         unsigned char HardwareNames[8][4][16];
           signed long HardAssigns[40];
           signed long HardMemory[40];
         unsigned char *PrefArray4[10];
         unsigned char *PrefArray5[10];
         unsigned char *SaveBArray1[4];
         unsigned char *SaveBArray2[4];
         unsigned char *SaveBArray3[4];
         unsigned char *SaveBArray4[4];
         void          *SaveBObjects[8];
#ifdef AmigaOS
         struct MUI_Command RexxCommands[40];
#endif AmigaOS
         void          *ConnectObjects[16];
         void          *ConnectArray1[10];
         void          *ConnectArray2[10];
         void          *UserSetObjects[100];
         unsigned char *UserSetGroups[10];
         unsigned char *UserSetTerminal[17];
         unsigned char *UserSetPassword[9];
         unsigned char *UserSetLanguage[13];
         unsigned char *UserSetDColl[3];
         struct User   *UserSetUser;
         unsigned char *ConnectMsg[20];
         Object        *ConnectMsgObjects[8];
#ifndef DISABLE_BSB
         Object        *BBSMainObjects[24];
         unsigned char *BBSMainArray1[8];
         Object        *BBSSendObjects[16];
         unsigned char *BBSSendArray1[4];
         unsigned char *BBSSendArray2[4];
         unsigned long BBSSendMode;
         Object        * BBSViewObjects[24];
         unsigned long BBSViewMail;
         unsigned long BBSViewMode;
#endif DISABLE_BBS
         Object        *SpyObjects[24];
         unsigned char *SpyArray1[4];
         unsigned char *SpyArray2[12];
         Object        *MHeardObjects[8];
         unsigned char *MHeardArray[6];
         Object        *MHeardLObjects[8];
         unsigned char *MHeardLArray[6];
         unsigned char StreamCharBuffer[4096];

#ifdef AmigaOS
         struct StyleInfo StreamStyleBuffer[128];
#endif
         unsigned long mailmacroremember[9];
         Object        *UserDataObjects[16];
         Object        *EncryptionObjects[32];
        };

struct GlobalHooks{
         struct Hook PrefCloseHook;
         struct Hook AppMenuHook;
         struct Hook MainChannelBut;
         struct Hook MessageWindowClose;
         struct Hook HListConstruct;
         struct Hook HListDestruct;
         struct Hook MainInputStream;
         struct Hook PrefTNCHook;
         struct Hook PrefCallHook;
         struct Hook PrefCMsgHook;
         struct Hook PrefAudioHook;
         struct Hook MainKeyHook;
         struct Hook SaveBufferClose;
         struct Hook RexxHooks[40];
         struct Hook ConnectHook;
         struct Hook UserSettings;
         struct Hook ConnectMsgHook;
#ifndef DISABLE_BBS
         struct Hook BBSMainHook;
         struct Hook BBSSendHook;
         struct Hook BBSSendSHook;
         struct Hook BBSViewHook;
         struct Hook BBSViewSHook;
#endif
         struct Hook SpyHook;
         struct Hook MHeardConstruct;
         struct Hook MHeardDestruct;
         struct Hook MHeardDisplay;
         struct Hook MHeardControl;
         struct Hook MHeardCompare;
         struct Hook MHeardLConstruct;
         struct Hook MHeardLDestruct;
         struct Hook MHeardLDisplay;
         struct Hook MHeardLControl;
         struct Hook MHeardLCompare;
         struct Hook UserDataHook;
         struct Hook EncryptionHook;
        };




extern struct GlobalHooks *HooksP; 
extern struct GlobalArraysSTR *GlobalArraysP;

char **StringSpeedup;
unsigned long int StringSpeedupSize;
