/**************************************************************************/
/*                                                                        */
/*  Multitool II   -   DOS-Hilfsprogramm                Version 1.4r000   */
/*                                                                        */
/*  ©1993 Boris Jakubaschk                                                */
/*                                                                        */
/*  Headerdatei mit sämtlichen Includes, Defines und Externdeklarationen  */
/*                                                                        */
/**************************************************************************/

#include <exec/types.h>
#include <exec/memory.h>
#include <intuition/intuition.h>
#include <intuition/gadgetclass.h>
#include <libraries/gadtools.h>
#include <graphics/displayinfo.h>
#include <clib/exec_protos.h>
#include <clib/intuition_protos.h>
#include <clib/gadtools_protos.h>
#include <clib/locale_protos.h>
#include <clib/dos_protos.h>
#include <libraries/dosextens.h>
#include <libraries/filehandler.h>
#include <libraries/asl.h>
#include <libraries/locale.h>
#include <dos/datetime.h>
#include <dos/exall.h>
#include <dos/dostags.h>
#include <stdio.h>
#include <string.h>

#define MToolVersion       "1.4"
#define DL_STRLEN       1500
#define DL_NODMAX        100

#define GD_Gadget0        30
#define GD_Gadget1         1
#define GD_Gadget2         2
#define GD_Gadget3         3
#define GD_Gadget4         4
#define GD_Gadget5         5
#define GD_Gadget6         6
#define GD_Gadget7         7
#define GD_Gadget8         8
#define GD_Gadget9         9
#define GD_Gadget10       10
#define GD_Gadget11       11
#define GD_Gadget12       12
#define GD_Gadget13       13
#define GD_Gadget14       14
#define GD_Gadget15       15
#define GD_Gadget16       16
#define GD_Gadget17       17
#define GD_Gadget18       18
#define GD_Gadget19       19
#define GD_Gadget20       20
#define GD_Gadget21       21
#define GD_Gadget22       22
#define GD_Gadget23       23
#define GD_Gadget24       24
#define SGD_Input          0
#define SGD_OK             1
#define SGD_Cancel         2
#define AGD_Liste          1
#define AGD_Mon            2
#define AGD_Weiter         3
#define AGD_Aktion         4
#define AGD_Hide           5
#define AGD_Script         6
#define AGD_Pure           7
#define AGD_Archive        8
#define AGD_Read           9
#define AGD_Write         10
#define AGD_Execute       11
#define AGD_Delete        12
#define AGD_Abbruch       13

#define MSG_0_MT_Project 0
#define MSG_0_MT_Project_Str "Project"
#define MSG_0_ME_About 1
#define MSG_0_ME_About_Str "About"
#define MSG_0_MS_About 2
#define MSG_0_MS_About_Str "a"
#define MSG_0_ME_Quit 3
#define MSG_0_ME_Quit_Str "Quit"
#define MSG_0_MS_Quit 4
#define MSG_0_MS_Quit_Str "q"
#define MSG_0_MT_Prefs 5
#define MSG_0_MT_Prefs_Str "Preferences"
#define MSG_0_ME_Open 6
#define MSG_0_ME_Open_Str "Open..."
#define MSG_0_MS_Open 7
#define MSG_0_MS_Open_Str "o"
#define MSG_0_ME_SaveAs 8
#define MSG_0_ME_SaveAs_Str "Save as..."
#define MSG_0_MS_SaveAs 9
#define MSG_0_MS_SaveAs_Str "w"
#define MSG_0_ME_SaveS 10
#define MSG_0_ME_SaveS_Str "Save to S:"
#define MSG_0_ME_SaveENV 11
#define MSG_0_ME_SaveENV_Str "Save to ENV:"
#define MSG_0_ME_ListFont 12
#define MSG_0_ME_ListFont_Str "Listfont..."
#define MSG_0_MS_ListFont 13
#define MSG_0_MS_ListFont_Str "l"
#define MSG_0_ME_GadFont 14
#define MSG_0_ME_GadFont_Str "Gadgetfont..."
#define MSG_0_MS_GadFont 15
#define MSG_0_MS_GadFont_Str "g"
#define MSG_0_ME_CScreen 16
#define MSG_0_ME_CScreen_Str "Customscreen"
#define MSG_0_MS_CScreen 17
#define MSG_0_MS_CScreen_Str "c"
#define MSG_0_ME_Screen 18
#define MSG_0_ME_Screen_Str "Screen..."
#define MSG_0_MS_Screen 19
#define MSG_0_MS_Screen_Str "s"
#define MSG_0_ME_Autodir 23
#define MSG_0_ME_Autodir_Str "AutoDir"
#define MSG_0_MS_Autodir 24
#define MSG_0_MS_Autodir_Str "d"
#define MSG_0_MT_Tools 25
#define MSG_0_MT_Tools_Str "Tools"
#define MSG_0_ME_ReScan 26
#define MSG_0_ME_ReScan_Str "Rescan devlist"
#define MSG_0_G_Parent 27
#define MSG_0_G_Parent_Str "_Parent"
#define MSG_0_G_Copy 28
#define MSG_0_G_Copy_Str "_Copy"
#define MSG_0_G_Move 29
#define MSG_0_G_Move_Str "_Move"
#define MSG_0_G_Delete 30
#define MSG_0_G_Delete_Str "_Delete"
#define MSG_0_G_ReName 31
#define MSG_0_G_ReName_Str "Re_name"
#define MSG_0_G_MakeDir 32
#define MSG_0_G_MakeDir_Str "MakeDi_r"
#define MSG_0_G_MAll 33
#define MSG_0_G_MAll_Str "S:_All"
#define MSG_0_G_MNot 34
#define MSG_0_G_MNot_Str "S:Nothin_g"
#define MSG_0_G_MPat 35
#define MSG_0_G_MPat_Str "S:Pa_ttern"
#define MSG_0_G_Archive 36
#define MSG_0_G_Archive_Str "Archi_ve"
#define MSG_0_G_Analyze 37
#define MSG_0_G_Analyze_Str "Analy_ze"
#define MSG_0_G_Action 38
#define MSG_0_G_Action_Str "Acti_on"
#define MSG_0_G_Info 39
#define MSG_0_G_Info_Str "I"
#define MSG_0_T_LoadPrefs 40
#define MSG_0_T_LoadPrefs_Str "Load Preferences:"
#define MSG_0_T_SavePrefs 41
#define MSG_0_T_SavePrefs_Str "Save Preferences:"
#define MSG_0_T_SListFont 42
#define MSG_0_T_SListFont_Str "Select Listfont:"
#define MSG_0_T_SGadFont 43
#define MSG_0_T_SGadFont_Str "Select Gadgetfont:"
#define MSG_0_T_ScreenMode 44
#define MSG_0_T_ScreenMode_Str "Select Screenmode:"
#define MSG_0_T_ShortCuts 45
#define MSG_0_T_ShortCuts_Str "pcmdnragtvzi\t\x1b o"
#define MSG_2_T_ExRename1 46
#define MSG_2_T_ExRename1_Str "File exists!"
#define MSG_2_T_ExRename2 47
#define MSG_2_T_ExRename2_Str "Do you want to rename it?"
#define MSG_2_T_MakeDir1 48
#define MSG_2_T_MakeDir1_Str "Please enter the name"
#define MSG_2_T_MakeDir2 49
#define MSG_2_T_MakeDir2_Str "of the new directory."
#define MSG_2_T_ReName 50
#define MSG_2_T_ReName_Str "Please enter the new name for:"
#define MSG_2_T_PatSel1 51
#define MSG_2_T_PatSel1_Str "Please enter the pattern."
#define MSG_2_T_PatSel2 52
#define MSG_2_T_PatSel2_Str "i.e. #?.info or ~(#?.BAK)"
#define MSG_3_T_SreqTitle 53
#define MSG_3_T_SreqTitle_Str "String request:"
#define MSG_3_T_AboutES1 54
#define MSG_3_T_AboutES1_Str "About MultiTool II"
#define MSG_3_T_AboutES2 55
#define MSG_3_T_AboutES2_Str "OK"
#define MSG_3_T_ErrorES1 56
#define MSG_3_T_ErrorES1_Str "Error message:"
#define MSG_3_T_ErrorES2 57
#define MSG_3_T_ErrorES2_str "Don't panic!"
#define MSG_3_T_DevInfoES1 58
#define MSG_3_T_DevInfoES1_Str "Device information:"
#define MSG_3_T_DevInfoES2 59
#define MSG_3_T_DevInfoES2_Str "Name  : %s:\n\n          blocks      bytes\ntotal : %8ld %10ld\nfree  : %8ld %10ld\n\n%ld bytes per block\n\n%ld bytes selected\n( real: %ld )"
#define MSG_3_T_DevInfoES3 60
#define MSG_3_T_DevInfoES3_Str "  OK  |Rename"
#define MSG_3_T_Error 61
#define MSG_3_T_Error_Str "Error"
#define MSG_3_T_SROK 62
#define MSG_3_T_SROK_Str "_Accept"
#define MSG_3_T_SRCancel 63
#define MSG_3_T_SRCancel_Str "_Cancel"
#define MSG_3_T_OpenCON 64
#define MSG_3_T_OpenCON_Str "CON:20/50/600/150/Press ctrl-c to cancel.../SCREEN MTOOLSCREEN"
#define MSG_3_T_SRKeys 65
#define MSG_3_T_SRKeys_Str "ac"
#define MSG_4_T_AreqTitle 66
#define MSG_4_T_AreqTitle_Str "Analyzing file"
#define MSG_4_T_FileSize 67
#define MSG_4_T_FileSize_Str "File size : %8d bytes"
#define MSG_4_T_1Block 68
#define MSG_4_T_1Block_Str "                   1 block"
#define MSG_4_T_Blocks 69
#define MSG_4_T_Blocks_Str "            %8d blocks"
#define MSG_4_T_Time 70
#define MSG_4_T_Time_Str "Time: %s, %s  %s"
#define MSG_4_T_MODFile 71
#define MSG_4_T_MODFile_Str "MOD-file (song)"
#define MSG_4_T_EmptyFile 72
#define MSG_4_T_EmptyFile_Str "Empty file"
#define MSG_4_T_IFFFile 73
#define MSG_4_T_IFFFile_Str "IFF-file,   type:     "
#define MSG_4_T_HunkList 74
#define MSG_4_T_HunkList_Str "hunk list:"
#define MSG_4_T_HunkLen 75
#define MSG_4_T_HunkLen_Str "     , size %6d"
#define MSG_4_T_Resolution 76
#define MSG_4_T_Resolution_Str " Resolution %d × %d pixel"
#define MSG_4_T_ScreenRes 77
#define MSG_4_T_ScreenRes_Str " Screen     %d × %d pixel"
#define MSG_4_T_Colors 78
#define MSG_4_T_Colors_Str " Bitplanes  %d, %d colors"
#define MSG_4_T_Compress 79
#define MSG_4_T_Compress_Str " File not compressed!"
#define MSG_4_T_VPModes 80
#define MSG_4_T_VPModes_Str " Viewportmodes: $%X"
#define MSG_4_T_Icon 81
#define MSG_4_T_Icon_Str "Icon (xxx.info)"
#define MSG_4_T_Info 82
#define MSG_4_T_Info_Str ".info file"
#define MSG_4_T_LoadSeg1 83
#define MSG_4_T_LoadSeg1_Str "File for LoadSeg()"
#define MSG_4_T_LoadSeg2 84
#define MSG_4_T_LoadSeg2_Str "-> Command, Library, Font..."
#define MSG_4_T_GFABugsick 85
#define MSG_4_T_GFABugsick_Str "GFA basic program"
#define MSG_4_T_PPM2 86
#define MSG_4_T_PPM2_Str "PageStream (PPM) V2.x"
#define MSG_4_T_PPM1 87
#define MSG_4_T_PPM1_Str "PageStream (PPM) V1.x"
#define MSG_4_T_LHA0 88
#define MSG_4_T_LHA0_Str "LHArc-Archive (lh0)"
#define MSG_4_T_LHA1 89
#define MSG_4_T_LHA1_Str "LHArc-Archive (lh?)"
#define MSG_4_T_LHA5 90
#define MSG_4_T_LHA5_Str "LHArc-Archive (lh5)"
#define MSG_4_T_Text 91
#define MSG_4_T_Text_Str "Text file (ASCII)"
#define MSG_4_T_Unknown 92
#define MSG_4_T_Unknown_Str "Unknown file type"
#define MSG_4_T_Editor 93
#define MSG_4_T_Editor_Str "Ed_itor"
#define MSG_4_T_Cont 94
#define MSG_4_T_Cont_Str "C_ontinue"
#define MSG_4_T_Action 95
#define MSG_4_T_Action_Str "Ac_tion"
#define MSG_4_T_Cancel 96
#define MSG_4_T_Cancel_Str "_Cancel"
#define MSG_4_T_Keys 97
#define MSG_4_T_Keys_Str "hsparwedcoit"
#define MSG_5_T_Title 98
#define MSG_5_T_Title_Str "Multitool II  %s graphics mem  %s other mem"
#define MSG_5_T_Stat 99
#define MSG_5_T_Stat_Str "free:%13s stat:%s"
#define MSG_5_T_NotValid 100
#define MSG_5_T_NotValid_Str " No valid directory selected "
#define MSG_6_T_Archiv1 101
#define MSG_6_T_Archiv1_Str "Please enter the name"
#define MSG_6_T_Archiv2 102
#define MSG_6_T_Archiv2_Str "of the new archive:"
#define MSG_7_T_Parms 103
#define MSG_7_T_Parms_Str "Please enter parameters:"
#define MSG_2_T_DestFull 104
#define MSG_2_T_DestFull_Str "Not enough space\non destination!"
#define MSG_7_T_ActFail 105
#define MSG_7_T_ActFail_Str "Action failed!\nBad arguments or missing command"
#define MSG_7_T_NoAction 106
#define MSG_7_T_NoAction_Str "No action defined\nfor this file type!"
#define MSG_7_T_MenuFail 107
#define MSG_7_T_MenuFail_Str "Menu installation corrupt!"
#define MSG_6_T_LHAFail 108
#define MSG_6_T_LHAFail_Str "LHA has got a problem!"
#define MSG_0_T_NoGFont 109
#define MSG_0_T_NoGFont_Str "Can't open gadget font!"
#define MSG_0_T_NoScreen 110
#define MSG_0_T_NoScreen_Str "Can't lock screen!"
#define MSG_0_T_BigWin 111
#define MSG_0_T_BigWin_Str "The workbench window\nis too big!"
#define MSG_0_T_BigGFont 112
#define MSG_0_T_BigGFont_Str "The gadget font\n is too big!"
#define MSG_0_T_NoWindow 113
#define MSG_0_T_NoWindow_Str "Window doesn't open!"
#define MSG_0_T_NoLFont 114
#define MSG_0_T_NoLFont_Str "Can't open list font!"
#define MSG_2_T_CopDel 115
#define MSG_2_T_CopDel_Str "Copy / Delete"
#define MSG_2_T_ConfEvryFile 116
#define MSG_2_T_ConfEvryFile_Str "Confirm every file"
#define MSG_2_T_ConfExisFile 117
#define MSG_2_T_ConfExisFile_Str "Confirm exist. files"
#define MSG_2_T_ConfSensFile 118
#define MSG_2_T_ConfSensFile_Str "Copy if newer/longer"
#define MSG_2_T_ConfAllFile 119
#define MSG_2_T_ConfAllFile_Str "All files"
#define MSG_2_T_NoSourceFile 120
#define MSG_2_T_NoSourceFile_Str "No source files selected!"
#define MSG_2_T_CheckThese 121
#define MSG_2_T_CheckThese_Str "Show information about:"
#define MSG_2_T_SourceFile 122
#define MSG_2_T_SourceFile_Str "Source file:"
#define MSG_2_T_DestFile 123
#define MSG_2_T_DestFile_Str "Destination file:"
#define MSG_2_T_Length 124
#define MSG_2_T_Length_Str "Length:"
#define MSG_2_T_Date 125
#define MSG_2_T_Date_Str "Date:"
#define MSG_2_T_Contents 126
#define MSG_2_T_Contents_Str "Contents:"
#define MSG_2_T_Version 127
#define MSG_2_T_Version_Str "Version:"
#define MSG_2_T_Name 128
#define MSG_2_T_Name_Str "Name:"
#define MSG_2_G_Length 129
#define MSG_2_G_Length_Str "_Length"
#define MSG_2_G_Date 130
#define MSG_2_G_Date_Str "_Date/Time"
#define MSG_2_G_Contents 131
#define MSG_2_G_Contents_Str "_Contents"
#define MSG_2_G_Version 132
#define MSG_2_G_Version_Str "_Version check"
#define MSG_2_G_ChngName 133
#define MSG_2_G_ChngName_Str "Change _Name"
#define MSG_2_G_Start 134
#define MSG_2_G_Start_Str "_Start"
#define MSG_2_G_Copy 135
#define MSG_2_G_Copy_Str "C_opy"
#define MSG_2_G_Delete 136
#define MSG_2_G_Delete_Str "D_elete"
#define MSG_2_G_Continue 137
#define MSG_2_G_Continue_Str "Con_tinue"
#define MSG_2_G_Cancel 138
#define MSG_2_G_Cancel_Str "C_ancel"
#define MSG_2_T_Keys 139
#define MSG_2_T_Keys_Str "aldcvnsoet"
#define MSG_2_T_ReadError 140
#define MSG_2_T_ReadError_Str "Read error!"
#define MSG_2_T_FilesIdent 141
#define MSG_2_T_FilesIdent_Str "Files identical"
#define MSG_2_T_FilesDiff 142
#define MSG_2_T_FilesDiff_Str "Files different"
#define MSG_2_T_FiLenDiff 143
#define MSG_2_T_FiLenDiff_Str "File length different"
#define MSG_2_T_NoExist 144
#define MSG_2_T_NoExist_Str "Does not exist yet"
#define MSG_0_ME_QuickStart 145
#define MSG_0_ME_QuickStart_Str "Quick start"

extern struct DosLibrary *DOSBase;
extern struct Window	 *Wnd;
extern struct Screen     *Scr;
extern APTR      VisualInfo;
extern struct Gadget     *GList;
extern struct TextFont   *LFont;
extern struct Gadget	 *Gadgets[];
extern struct Menu       *Menus;
extern struct IntuiMessage *msg;
extern char   *LS[];
extern ULONG	GClass;
extern USHORT   GCode;
extern WORD     GMouseY;
extern ULONG    GTime;
extern struct Window     *SreqWnd;
extern struct Gadget     *SreqGList;
extern struct Gadget     *SreqGadgets[];
extern char     Maske[];
extern char     STitle[];
extern struct Window     *AreqWnd;
extern struct Gadget     *AreqGList;
extern struct Gadget     *AreqGadgets[];
extern char              ConName[];
extern struct Window     *ConWnd;
extern char     ListSel;
extern APTR     ProcWinPtr;
extern UWORD    OldPSM;
extern UWORD    CM;
extern char     AutoDir;
extern char     OS3;

/* Datenbereich für Device-Liste */

extern struct Node DL_Nodes[];
extern struct MinList DL_List;
extern char  DL_Strings[];
extern ULONG DL_StrEntry;
extern ULONG DL_NumEntry;

/* Datenbereiche für Verzeichnislisten */

extern struct ExAllData *VL_Data[];
extern char   VL_Active;
extern char   VL_OldAct;
extern char  *VL_Name[];
extern char   VL_Name1[];
extern char   VL_Name2[];
extern ULONG  VL_NumEntry[];
extern ULONG  VL_OldFI[];
extern char   VL_Valid[];
extern char  *VL_Select[2];
extern ULONG  VL_OldCS[];
extern char   VL_OldSM[]; /* Selektionsmodus; 0=ab-, 255=anwählen */
extern short  MaxLen[];
extern short  VL_XPos[];
extern char   VL_Archiv; 
extern char   VL_OldArc;
extern ULONG  VL_BytSel;
extern ULONG  VL_BlkSel;
extern ULONG  VL_StatFree[];
extern ULONG  VL_Marked[2];
extern char  *VL_StatStat[];

/* Datenbereich für Analyse */

extern struct Node Ana_Nodes[];
extern struct MinList Ana_List;
extern char Ana_Strings[];
extern ULONG Ana_StrEntry;
extern ULONG Ana_NumEntry;
extern char *Ana_Command[];
extern char *Ana_Prefs;
extern LONG  Ana_Len;

/* Variablen für Bildschirmlayout */

extern short LY_TopList;
extern short LY_LXOffset[];
extern short LY_YTOffset;
extern short LY_LNumChars;
extern short LY_LXS;
extern short LY_LYS;
extern short LY_LNumLines;
extern short LY_LBaseLine;
extern ULONG WB_Win_x;
extern ULONG WB_Win_y;
extern ULONG WB_Win_w;
extern ULONG WB_Win_h;

/* Screen-, Window- und Gadgetdefinitionen */

extern char GadgetFontName[];

extern struct TextAttr GadgetFont;
extern UWORD LY_GFontH;

extern char ListFontName[];

extern struct TextAttr ListFont;
extern UWORD LY_LFontH;

extern struct TagItem  WindowTags[];
extern struct TagItem  SreqWindowTags[];
extern struct TagItem  AreqWindowTags[];
extern struct NewMenu  NewMenu[];
extern struct ColorSpec  ScreenColors[];

extern char   CustomScreen;
extern UWORD  DriPens[];

extern struct TagItem  ScreenTags[];
extern struct Gadget Gadget17;
extern struct Gadget Gadget18;

/* Struktur für Image "Über Multitool" */

extern struct Image AboutImage;

/* Struktur für Easyrequester "Fehlermeldung" */

extern struct EasyStruct ErrorES;

/* Struktur für Easyrequester "Device-Info" */

extern struct EasyStruct DevInfoES;
