/*
 * extern.h
 *
 * part of Pro-Wizard-1 package
 * (c) Sylvain "Asle" Chipaux
*/

/* tests */
#ifdef INCLUDEALL
extern short testArcDDataCruncher ( void );
extern short testByteKiller_13 ( void );
extern short testByteKiller_20 ( void );
extern short testByteKiller30 ( void );
extern short testbytekillerpro10 ( void );
extern short testcrunchmaniaAddr ( void );
extern short testcrunchmaniaSimple ( void );
extern short testCRND ( void );
extern short testDefjam32 ( void );
extern short testDefjam32pro ( void );
extern short testDefjamCruncher32t (void);
extern short testDoubleAction10 ( void );
extern short testDragpack100 ( void );
extern short testDragpack252 ( void );
extern short testGNUPacker12 (void);
extern short testHQCCruncher2 ( void );
extern short testMasterCruncher30addr ( void );
extern short testMaxPacker12 ( void );
extern short testMegaCruncher10 ( void );
extern short testMegaCruncher12 ( void );
extern short testMegaCruncherObj ( void );
extern short testPowerpacker23 ( void );
extern short testPowerpacker30 ( void );
extern short testPowerpacker40 ( void );
extern short testPowerpacker4lib ( void );
extern short testPPbk ( void );
extern short testRelokIt10 ( void );
extern short testSpikeCruncher ( void );
extern short testSTC299 ( void );
extern short testSTC299b ( void );
extern short testSTC299d ( void );
extern short testSTC300 ( void );
extern short testSTC310 ( void );
extern short testStoneCracker270 ( void );
extern short testSuperCruncher27 ( void );
extern short testSyncroPacker ( void );
extern short testTetrapack102 ( void );
extern short testTetrapack_2_1 ( void );
extern short testTetrapack_2_2 ( void );
extern short testTimeCruncher17 ( void );
extern short testTNMCruncher11 ( void );
extern short testTryIt101 ( void );
extern short testTurboSqueezer61 ( void );
#endif
extern short testAC1D ( void );
extern short testAmBk ( void );
extern short testBP ( void );
extern short testBSIFutureComposer ( void );
extern short testDI ( void );
extern short testDigiBooster17 ( void );
extern short testEUREKA ( void );
extern short testFC_M ( void );
extern short testFC13 ( void );
extern short testFC14 ( void );
extern short testFuchsTracker ( void );
extern short testFUZZAC ( void );
extern short testGnuPlayer ( void );
extern short testGMC ( void );
extern short testGPMO ( void );
extern short testHEATSEEKER ( void );
extern short testHRT ( void );
extern short testJamCracker ( void );
extern short testKRIS ( void );
extern short testKSM ( void );
extern short testMMD0 ( void );
extern short testMOD ( int );
extern short testMP_noID ( void );
extern short testMP_withID ( void );
extern short testMUGICIAN ( void );
extern short testNewtron ( void );
extern short testNewtronOld ( void );
extern short testNFH ( void );
extern short testNoiserunner ( void );
extern short testNoisepacker1 ( void );
extern short testNoisepacker2 ( void );
extern short testNoisepacker3 ( void );
extern short testNovoTrade ( void );
extern short testP40A ( void );
extern short testP41A ( void );
extern short testP50A ( void );
extern short testP60A_nopack ( void );
extern short testP60A_pack ( void );
extern short testP61A_nopack ( void );
extern short testP61A_pack ( void );
extern short testPHA ( void );
extern short testPM ( void );
extern short testPM01 ( void );
extern short testPM10c ( void );
extern short testPM2 ( void );
extern short testPM40 ( void );
extern short testPMZ ( void );
extern short testPolka ( void );
extern short testPP10 ( void );
extern short testPP21 ( void );
extern short testPP30 ( void );
extern short testPRUN1 ( void );
extern short testPRUN2 ( void );
/*extern short testPTK ( void );*/
extern short testQuadraComposer ( void );
extern short testSGT ( void );
extern short testSkizzo ( void );
extern short testSKYT ( void );
extern short testSoundFX13 ( void );
extern short testSoundTracker ( void );
extern short testSTARPACK ( void );
extern short testSTK26 ( void );
extern short testSTIM ( void );
extern short testStoneArtsPlayer ( void );
extern short testTheDarkDemon ( void );
extern short testTitanicsPlayer ( void );
extern short testTMK ( void );
extern short testTP1 ( void );
extern short testTP2 ( void );
extern short testTP3 ( void );
extern short testUNIC_noID ( void );
extern short testUNIC_withID ( void );
extern short testUNIC_withemptyID ( void );
extern short testUNIC2 ( void );
extern short testWN ( void );
extern short testXANN ( void );
extern short testXM ( void );
extern short testZEN ( void );

/* rips */

#ifdef INCLUDEALL
extern void Rip_ByteKiller ( void );
extern void Rip_ByteKiller30 ( void );
extern void Rip_bytekillerpro10 ( void );
extern void Rip_CrunchmaniaAddr ( void );
extern void Rip_CrunchmaniaSimple ( void );
extern void Rip_Defjam32 ( void );
extern void Rip_DoubleAction10 ( void );
extern void Rip_Dragpack100 ( void );
extern void Rip_Dragpack252 ( void );
extern void Rip_GNUPacker12 (void);
extern void Rip_HQCCruncher2 ( void );
extern void Rip_MasterCruncher30addr ( void );
extern void Rip_MaxPacker12 ( void );
extern void Rip_MegaCruncher ( void );
extern void Rip_MegaCruncherObj ( void );
extern void Rip_Powerpacker23 ( void );
extern void Rip_Powerpacker30 ( void );
extern void Rip_Powerpacker40 ( void );
extern void Rip_Powerpacker4lib ( void );
extern void Rip_PPbk ( void );
extern void Rip_RelokIt10 ( void );
extern void Rip_SpikeCruncher ( void );
extern void Rip_STC299 ( void );
extern void Rip_STC299b ( void );
extern void Rip_STC299d ( void );
extern void Rip_STC300 ( void );
extern void Rip_STC310 ( void );
extern void Rip_StoneCracker270 ( void );
extern void Rip_SuperCruncher27 ( void );
extern void Rip_SyncroPacker ( void );
extern void Rip_Tetrapack102 ( void );
extern void Rip_Tetrapack_2_1 ( void );
extern void Rip_Tetrapack_2_2 ( void );
extern void Rip_TimeCruncher17 ( void );
extern void Rip_TNMCruncher11 ( void );
extern void Rip_TryIt101 ( void );
extern void Rip_TurboSqueezer61 ( void );
#endif
extern void Rip_AC1D ( void );
extern void Rip_AmBk ( void );
extern void Rip_BP ( void );
extern void Rip_BSIFutureComposer ( void );
extern void Rip_DI ( void );
extern void Rip_DigiBooster17 ( void );
extern void Rip_EUREKA ( void );
extern void Rip_FC_M ( void );
extern void Rip_FC13 ( void );
extern void Rip_FC14 ( void );
extern void Rip_FuchsTracker ( void );
extern void Rip_Fuzzac ( void );
extern void Rip_GnuPlayer ( void );
extern void Rip_GMC ( void );
extern void Rip_GPMO ( void );
extern void Rip_HEATSEEKER ( void );
extern void Rip_HRT ( void );
extern void Rip_JamCracker ( void );
extern void Rip_KRIS ( void );
extern void Rip_KSM ( void );
extern void Rip_MMD0 ( void );
extern void Rip_MOD ( int );
extern void Rip_MUGICIAN ( void );
extern void Rip_MP_noID ( void );
extern void Rip_MP_withID ( void );
extern void Rip_Newtron ( void );
extern void Rip_NewtronOld ( void );
extern void Rip_NFH ( void );
extern void Rip_Noisepacker1 ( void );
extern void Rip_Noisepacker2 ( void );
extern void Rip_Noisepacker3 ( void );
extern void Rip_Noiserunner ( void );
extern void Rip_NovoTrade ( void);
extern void Rip_P22A ( void );
extern void Rip_P30A ( void );
extern void Rip_P40A ( void );
extern void Rip_P40B ( void );
extern void Rip_P41A ( void );
extern void Rip_P50A ( void );
extern void Rip_P60A ( void );
extern void Rip_P61A ( void );
extern void Rip_PHA ( void );
extern void Rip_PM ( void );
extern void Rip_PM01 ( void );
extern void Rip_PM10c ( void );
extern void Rip_PM18a ( void );
extern void Rip_PM20 ( void );
extern void Rip_PM40 ( void );
extern void Rip_Polka ( void );
extern void Rip_PP10 ( void );
extern void Rip_PP21 ( void );
extern void Rip_PP30 ( void );
/*extern void Rip_PTK ( void );*/
extern void Rip_QuadraComposer ( void );
extern void Rip_SGT ( void );
extern void Rip_Skizzo ( void );
extern void Rip_SKYT ( void );
extern void Rip_SoundFX13 ( void );
extern void Rip_SoundTracker ( void );
extern void Rip_STARPACK ( void );
/*extern void Rip_StarTrekker ( void );*/
extern void Rip_STK26 ( void );
extern void Rip_STIM ( void );
extern void Rip_StoneArtsPlayer ( void );
extern void Rip_TheDarkDemon ( void );
extern void Rip_TitanicsPlayer ( void );
extern void Rip_TMK ( void );
extern void Rip_TP1 ( void );
extern void Rip_TP2 ( void );
extern void Rip_TP3 ( void );
extern void Rip_PRUN2 ( void );
extern void Rip_PRUN1 ( void );
extern void Rip_UNIC_withID ( void );
extern void Rip_UNIC_noID ( void );
extern void Rip_UNIC2 ( void );
extern void Rip_WN ( void );
extern void Rip_XANN ( void );
extern void Rip_XM ( void );
extern void Rip_ZEN ( void );

/* depack */

extern void Depack_AmBk ( void );
extern void Depack_AC1D ( void );
extern void Depack_SoundFX13 ( void );
extern void Depack_DI ( void );
extern void Depack_EUREKA ( void );
extern void Depack_FC_M ( void );
extern void Depack_FuchsTracker ( void );
extern void Depack_Fuzzac ( void );
extern void Depack_GnuPlayer ( void );
extern void Depack_GMC ( void );
extern void Depack_GPMO ( void );
extern void Depack_HEATSEEKER ( void );
extern void Depack_HRT ( void );
extern void Depack_KRIS ( void );
extern void Depack_KSM ( void );
extern void Depack_MP ( void );
extern void Depack_Newtron ( void );
extern void Depack_NewtronOld ( void );
extern void Depack_NFH ( void );
extern void Depack_Noiserunner ( void );
extern void Depack_Noisepacker1 ( void );
extern void Depack_Noisepacker2 ( void );
extern void Depack_Noisepacker3 ( void );
extern void Depack_NovoTrade ( void );
extern void Depack_P22 ( void );
extern void Depack_P30 ( void );
extern void Depack_P40 ( void );
extern void Depack_P41A ( void );
extern void Depack_P50A ( void );
extern void Depack_P60A ( void );
extern void Depack_P61A ( void );
extern void Depack_PHA ( void );
extern void Depack_PM01 ( void );
extern void Depack_PM10c ( void );
extern void Depack_PM18a ( void );
extern void Depack_PM20 ( void );
extern void Depack_PM40 ( void );
extern void Depack_PM ( void );
extern void Depack_Polka ( void );
extern void Depack_PP10 ( void );
extern void Depack_PP21 ( void );
extern void Depack_PP30 ( void );
extern void Depack_PRUN1 ( void );
extern void Depack_PRUN2 ( void );
extern void Depack_QuadraComposer ( void );
extern void Depack_SGT ( void );
extern void Depack_Skizzo ( void );
extern void Depack_SKYT ( void );
extern void Depack_STARPACK ( void );
extern void Depack_STK26 ( void );
extern void Depack_STIM ( void );
extern void Depack_StoneArtsPlayer ( void );
extern void Depack_TheDarkDemon ( void );
extern void Depack_TitanicsPlayer ( void );
extern void Depack_TMK ( void );
extern void Depack_TP1 ( void );
extern void Depack_TP2 ( void );
extern void Depack_TP3 ( void );
extern void Depack_UNIC ( void );
extern void Depack_UNIC2 ( void );
extern void Depack_WN ( void );
extern void Depack_XANN ( void );
extern void Depack_ZEN ( void );

/* misc */

extern void Support_Types ( void );
extern void Support_Types_FileDefault ( void );
extern void Save_Rip ( char *, int );
extern void Save_Rip_Special ( char *, int, Uchar * , Ulong );
extern void Crap ( char *, Uchar, Uchar, FILE *);
extern short testSpecialCruncherData ( long , long );
extern void Rip_SpecialCruncherData ( char * , int , int );
extern short test_1_start ( Ulong );
extern short test_smps ( long, long, long, Uchar, Uchar );
extern long  PWGetFileSize ( char * );
extern FILE * PW_fopen ( char *, char * );
extern void fillPTKtable ( Uchar[37][2] );

/* globals */
/* Some say it's badly coding when using Globals ... sure it is, now what's the solution ? */

extern FILE  *PW_in,*PW_out;
extern long  PW_Start_Address;
extern Ulong OutputSize;
extern long  PW_in_size;
extern long  Cpt_Filename;
extern Ulong PW_i;
extern Ulong PW_j,PW_k,PW_l,PW_m,PW_n,PW_o;
extern Uchar *in_data;
/*extern Uchar OutName[5];*/
extern char OutName_final[33];
extern char Depacked_OutName[33];
extern Uchar Save_Status;
extern Ulong PW_WholeSampleSize;
extern char Extensions[_KNOWN_FORMATS+1][33];
extern Uchar CONVERT;
extern Uchar Amiga_EXE_Header;

extern void pw_write_log (const char *, ...);
extern FILE *moduleripper2_fopen (const char *name, const char *mode, const char *aid, int addr, int size);
extern FILE *moduleripper_fopen (const char *aname, const char *amode);

void Crap15 ( char *Format , Uchar Delta , Uchar Pack , FILE *out );
