home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
-
-
-
- ********* ********* * *
- * * * * *
- * * * * *
- ********* ********* *********
- * * *
- * * *
- ********* * *
-
-
-
- Version 1.0
-
-
-
- by Federico Giannici
-
- Viale Francia 4
- 90146 Palermo
- Italy
-
-
-
-
- It's a SPY of the main AmigaDOS and EXEC function calls.
-
-
- -----------------------------------------------------------------------------
- This source is provided for you to see the techniques I used to write SPY.
- You can, obviously, use it to make your experiments and you can take some
- routines to insert in your programs. But you CANNOT modify, recompile and
- distribute the modified version to anyone without my permission.
- Be a programmer not a copier.
- -----------------------------------------------------------------------------
-
-
-
- Compile with Lattice C 5.02 or subsequent, with the -v compiler option
- (also for SPYFunc.c).
-
-
-
- STORY:
- 21/08/89 v0.1
- Inizio sperimentazioni
- 26/10/89 v0.2
- Nuovo inizio
- Preparazione menu`
- Inizio prima routine (newopen())
- Routines di condivisione della finestra in multitasking
- Gadget GO ON
- Utilizzo del timer.device
- Quit sicuro (il piu` possibile)
- La maggior parte delle funzioni DOS
- Menu Functions
- 20/12/89 v0.3
- Sostituzione menu functions con finestra
- Altre funzioni DOS
- Gadgets in fwindow
- 24/12/89 v0.4
- LOGO!
- Divisione del source in piu` parti
- Inizio routines EXEC
- Gestione msg del WAIT FOR GO
- AllocMem solo se fallisce (pericolo di loop infiniti)
- Quit ancora piu` sicuro
- Problemi con le funzioni EXEC
- Niente informazioni con stack insufficiente
- Attesa in ownwindow()
- Bug in ownwindow()
- Modifica funzione newexit()
- Implementate ultime funzioni EXEC
- Eliminata funzione newfindtask(), troppi problemi!
- Problemi funzione AddPort()
- 27/01/90 v0.5
- Revisione generale
- ScreenFlash
- Logo autocentrante
- GO ON con tastiera
- 02/02/90 v0.6
- Inizio save e load configuration
- 20/02/90 v0.7
- logoImage, wallImage, wallhImage
- Risistemazione gadget (con wall)
- Risistemazione info
- Save e Load config
- Ricostruzione nome e path del lock
- Utilizzo della stampante
- 05/03/90 v0.8
- Memorizzazione nome dei FileHandle
- Scrittura buffer di Read() e Write()
- 13/02/90 v1.0
- PRIMA RELEASE UFFICIALE
- 28/02/90 Adesso
-
-
- ****************************************************************************/
-
-
-
- #include "SPY.h"
-
-
- #define VERSIONE "1.0 " /* 4 caratteri */
- #define LIBVER 33
-
- #define ITEML 4 /* leftborder degli item */
- #define ITEMD 12 /* distanza tra gli item */
- #define ITEMH ITEMD
- #define ITEM0W (21*8) /* width degli item */
- #define ITEM1W (15*8)
- #define ITEMTEXTT ((ITEMH-8)/2)
-
- #define WINDW 400 /* Largezza iniziale della finestra principale */
- #define WINDH 150 /* Altezza " " " " */
- #define WINDL (640-WINDW-10) /* Left */
- #define WINDT (8) /* Top */
-
- #define FWINDW 580 /* Parametri gadget delle nuove funzioni */
- #define FWINDH 190
- #define FTEXTL (CHECKWIDTH) /* Distanza del testo elementi fwindow dal bordo */
- #define FGADGL 30 /* Distanza fgadget dal bordo */
- #define FGADGT 30
- #define FGADGT2 (FGADGT+FGADGD*6+FGADGD*2)
- #define FGADGW 125
- #define FGADGH 10
- #define FGADGD 10
- #define FGADGCOL (FGADGW+10) /* Distanza tra colonne di gadget in fwindow */
-
- #define WALLW 93 /* Dimensioni wallImage */
- #define WALLH 16
-
- #define FWWALLNUM 6 /* Numero di wall in fwindow */
- #define FWALLL ((FWINDW-WALLW*FWWALLNUM)/2)
- #define FWALLT (FWINDH-WALLH-8)
-
- #define WALLHW 56
- #define WALLHH 8
- #define WALLHT (-WALLHH)
- #define WALLHL ((GADGW-WALLHW)/2)
-
- #define GADGW 80 /* Dimensioni gadget (wall) */
- #define GADGH WALLH
-
- #define FWGW GADGW /* Width dei gadget fwindow */
- #define FWGH GADGH
- #define FWGT FWALLT
- #define FWGD ((WALLW*FWWALLNUM)/5)
- #define FWGL (FWALLL+(FWGD-FWGW)/2)
- #define FWGTT ((FWGH-8)/2) /* Top del testo gadget fwindow */
- #define FOKID 1 /* ID gadget fwindow */
- #define FRESTOREID 2
- #define FALLID 3
- #define FNONEID 4
- #define FCANCELID 5
-
- #define CWINDW 310 /* cwindow, richiesta nome configurazione */
- #define CWINDH 80
- #define CWGW FWGW
- #define CWGH FWGH
- #define CWGTT FWGTT
- #define CWWALLNUM 3
- #define CWALLL ((CWINDW-WALLW*CWWALLNUM)/2)
- #define CWALLT (CWINDH-WALLH-8)
- #define CWGD ((WALLW*CWWALLNUM)/2)
- #define CWGL (CWALLL+(CWGD-CWGW)/2)
- #define CWGT CWALLT
- #define CGSTRLEN 30 /* Lunghezza gadget nome configurazione */
- #define CSTRLEN 50 /* Lunghezza nome configurazione */
- #define COKID 1 /* ID Gadget cwindow */
- #define CCANCELID 2
-
- #define IWINDW (window->GZZWidth) /* Larghezza finestra interna */
- #define IWINDH (window->GZZHeight)
-
- #define LOGOW 164 /* Parametri info */
- #define LOGOH 41
- #define ALLLOGOW LOGOW
- #define ALLLOGOH (LOGOH+4+20+10)
- #define INFOT (-30)
- #define INFOLOGOT (INFOT+5)
- #define INFOTEXTT (LOGOH+INFOLOGOT+25-INFOT)
- #define INFOTEXTD 11
- #define INFOADDRT (INFOTEXTT+2*INFOTEXTD)
-
- #define INFOW (40*8) /* Dimensioni subitem info */
- #define INFOMAXH (INFOADDRT+4*INFOTEXTD+1+INFOT)
-
- #define NOTIMPVECTNUM 0 /* Numero di funzioni non ancora implementate */
- #define GADGNUM VECTNUM
-
- #define FLASHDELAY 300000 /* .3 secondi */
- #define QUITDELAY 200000
- #define CONFIGDELAY 200000
- #define OWNWINDOWDELAY 400000
-
- #define MINSTACK 1600 /* Minimo stack per poter fare l'ouput */
- #define ERRORTEXTLEN 80 /* Lunghezza massima del messaggio di errore */
- #define LOCKNAMELEN 60 /* Lunghezza massima del nome del lock */
- #define FHNAMELEN 39 /* Lunghezza massima nome FileHandle */
- #define BUFFERLEN 60 /* Lunghezza massima di buffer visualizzato */
- #define TEXTLEN 80 /* Lunghezza massima delle stringhe */
-
- #define ALLFHLIST for( fhn=(struct fhnode *)(fhlist.mlh_Head); fhn->node.mln_Succ; fhn=(struct fhnode *)(fhn->node.mln_Succ) )
-
- #define JMPCODE 0x4EF9 /* Opcode di JMP <address> */
-
- #define FINEHELP ((UBYTE *)-1)
-
- #define IO (struct IORequest *)
-
- #define fgadget gadgetopen
- #define itemactivated item00
- #define itemprinter item00b
-
-
-
- /***** Le mie proto *****/
- void quit( void );
- void saveconfig( void );
- BOOL writeitem( struct MenuItem *item );
- BOOL write( UBYTE *data, COUNT len );
- void loadconfig( void );
- BOOL readitem( struct MenuItem *item );
- BOOL read( UBYTE *data, COUNT len );
- BOOL getconfigname( UBYTE *saveorload );
- void goin( void );
- void goout( void );
- BOOL canoutput( void );
- void ownwindow( void );
- void initout( UBYTE *funname );
- void endout( void );
- void status( UBYTE *text );
- struct vect *vectadd( WORD v );
- void getoldvect( void );
- void setvect( WORD v );
- void resetvect( WORD v );
- void fsetvect( WORD v );
- void fresetvect( WORD v );
- void newline( void );
- void littlenewline( void );
- void prints( UBYTE *testo );
- void printname( UBYTE *name );
- void printpname( UBYTE *name );
- void printbuffer( UBYTE *buffer, LONG len );
- void printlock( BPTR lock );
- void spyprintlock( BPTR lock );
- void locknameadd( UBYTE *add );
- void printfh( BPTR fh );
- void printd( LONG numero );
- void printpd( LONG numero );
- void printh( ULONG numero );
- void printerprint( UBYTE *text );
- void spyprinterprint( UBYTE *text );
- void setprinter( void );
- void addfh( BPTR fh, UBYTE *name );
- void remfh( BPTR fh );
- struct fhnode *findfh( BPTR fh );
- void clearfh( void );
- void functions( void );
- void setfgadget( void );
- void openall( void );
- void openwindow( void );
- void fine( UBYTE *text );
-
-
- /***** Nuove Funzioni, definite in SPYFunc; non sono esatte ma e` piu` breve *****/
- extern void newopen();
- extern void newclose();
- extern void newread();
- extern void newwrite();
- extern void newinput();
- extern void newoutput();
- extern void newlock();
- extern void newunlock();
- extern void newduplock();
- extern void newexamine();
- extern void newexnext();
- extern void newinfo();
- extern void newdeletefile();
- extern void newrename();
- extern void newcreatedir();
- extern void newcurrentdir();
- extern void newparentdir();
- extern void newseek();
- extern void newexecute();
- extern void newloadseg();
- extern void newunloadseg();
- extern void newcreateproc();
- extern void newexit();
- extern void newioerr();
- extern void newallocmem();
- extern void newopendevice();
- extern void newclosedevice();
- extern void newadddevice();
- extern void newopenlibrary();
- extern void newoldopenlibrary();
- extern void newcloselibrary();
- extern void newaddlibrary();
- extern void newopenresource();
- extern void newaddresource();
- extern void newfindport();
- extern void newaddport();
- extern void newfindsemaphore();
- extern void newaddsemaphore();
- extern void newfindname();
-
-
-
-
- /***** Stringe ricorrenti *****/
- UBYTE topaz[]="topaz.font";
- UBYTE notimer[]="Cannot open timer.device";
-
-
- /***** Per la stampante *****/
- UBYTE prtnameon[]="";
- UBYTE prtnameoff[]="";
- UBYTE prtfunnameon[]="---w";
- UBYTE prtfunnameoff[]="w------";
-
-
- struct TextAttr tanormal=
- {
- topaz,
- 8,
- FS_NORMAL,
- FPF_ROMFONT,
- };
- struct TextAttr tai=
- {
- topaz,
- 8,
- FSF_ITALIC,
- FPF_ROMFONT
- };
- struct TextAttr tab=
- {
- topaz,
- 8,
- FSF_BOLD,
- FPF_ROMFONT
- };
- struct TextAttr taiu=
- {
- topaz,
- 8,
- FSF_ITALIC | FSF_UNDERLINED,
- FPF_ROMFONT
- };
- struct TextAttr tabu=
- {
- topaz,
- 8,
- FSF_BOLD | FSF_UNDERLINED,
- FPF_ROMFONT
- };
-
-
- UWORD __chip logoData[902] = {
- /* BitPlane 0 */
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x1E00,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x3FF0,0xFF80,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x7FFE,0xFFC0,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0xFFE1,0xFFE0,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0xFFCB,0xFFF0,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0001,0xFFFF,0xFFF8,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0001,0xFFFF,0xFFF8,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0002,0xFFFF,0xFFFF,0xF800,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x005F,0xFFE0,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x00FC,0x001F,0xFFE0,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0003,0xFFFF,0xFFF0,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0007,0xFC06,0xC078,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0007,0x8000,0x0008,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0004,0x7803,0x8020,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0007,0xF803,0x8038,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0007,0xFC07,0xC078,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0003,0xFFFF,0xFFF0,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x06EC,0x0001,0xFFFF,0xFFE0,0x000D,0xD800,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0FFE,0x0000,0xFFFF,0xFFC0,0x001F,0xFC00,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0FFF,0x0000,0x007F,0xF000,0x003F,0xFC00,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0EEF,0x0000,0x00FF,0xF000,0x003D,0xDC00,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0EEE,0x0000,0x3DFF,0xF800,0x1C1D,0xDC00,0x0000,0x0000,
- 0x0000,0x0000,0x000F,0xFFEC,0x0001,0xFFFF,0xF800,0x3C0D,0xD9E0,0x0000,0x0000,
- 0x0000,0x0000,0x007F,0xFFC0,0x0001,0xF3FF,0xFC00,0x0E00,0x03E0,0x0000,0x0000,
- 0x0000,0x0000,0x00D8,0x0000,0x0001,0xC3FF,0xFC00,0x0700,0x0F80,0x0000,0x0000,
- 0x0000,0x0000,0x0380,0x0000,0x0003,0xC3FF,0xFC00,0x0300,0x0E00,0x0000,0x0000,
- 0x0000,0x0000,0x0380,0x0000,0x0001,0xC1FF,0xFC00,0x0180,0x1C00,0x0000,0x0000,
- 0x0000,0x0000,0x0380,0x0000,0x0003,0xC1FF,0xF800,0x01C0,0x7800,0x0000,0x0000,
- 0x0000,0x0000,0x0780,0x0000,0x0001,0xC0FF,0xE000,0x0160,0x7000,0x0000,0x0000,
- 0x0000,0x0000,0x01FF,0xFFF8,0x0000,0xC03F,0x8000,0x00A1,0xD000,0x0000,0x0000,
- 0x0000,0x0000,0x007E,0xDDFC,0x0000,0x7FFC,0x0000,0x007F,0xE000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x001C,0x0000,0xFFB0,0x0000,0x001F,0x8000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x001E,0x0000,0x6000,0x0000,0x003E,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x001C,0x0000,0x7000,0x0000,0x001C,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x07FC,0x0000,0x7000,0x0000,0x0078,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x00FF,0x71F0,0x0000,0x7800,0x0000,0x0060,0x0000,0xFC3E,0x0000,
- 0x0000,0x0000,0x03FB,0x3800,0x0000,0x3C00,0x0000,0x00E0,0x0001,0x8060,0x0000,
- 0x0000,0x0000,0x01C0,0x0000,0x0000,0x1E00,0x0000,0x01C0,0x0001,0xF060,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x3E00,0x0000,0x03E0,0x0001,0x8067,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x03C0,0x0001,0x803C,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- /* BitPlane 1 */
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFC06,0xC07F,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x000F,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFC,0x7803,0x8027,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xF803,0x803F,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFC07,0xC07F,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
- 0xFFFF,0xFF80,0x0000,0x0FFF,0x0000,0x007F,0xF000,0x003F,0xFC00,0x003F,0xFFFF,
- 0xFFFF,0xFF3F,0xFFFF,0xFFFF,0xFF3F,0xFFFF,0xFFFF,0xFFBF,0xFFFF,0xFF9F,0xFFFF,
- 0xFFFF,0xFF7F,0xFFFF,0xFFFF,0xFFBF,0xC3FF,0xFFFF,0xE39F,0xFFFF,0xFFC5,0xFFFF,
- 0xFFFF,0xFF3F,0xFFF0,0x06FF,0xFF3E,0x01FF,0xFFFF,0xC39F,0xFE1F,0xFFFC,0x7FFF,
- 0xFFFF,0xFF3F,0xFF80,0x003F,0xFF3E,0x0FFF,0xFFFF,0xF19F,0xFC1F,0xFFFF,0x1FFF,
- 0xFFFF,0xFF3F,0xFF27,0xFFFF,0xFF3E,0x3FFF,0xFFFF,0xF89F,0xF07F,0xFFFF,0xCFFF,
- 0xFFFF,0xFF3F,0xFC7F,0xFFFF,0xFE3C,0x3FFF,0xFFFF,0xFC9F,0xF1FF,0xFFFF,0xCFFF,
- 0xFFF8,0x0000,0x0000,0x0000,0x0000,0x07FF,0xFC00,0x0000,0x0000,0x0000,0x5FFF,
- 0xFFF3,0xFFFF,0xFC7F,0xFE7F,0xFFFC,0x3FFF,0xFF1F,0xFE3F,0x87FF,0xFF3F,0xFFFF,
- 0xFFF3,0xFFFF,0xF87F,0xFE7F,0xFFFE,0x3FFF,0xFF3F,0xFE9F,0x8FFF,0xFF7F,0xFFFF,
- 0xFFF3,0xFFFF,0xFE00,0x0007,0xFFFF,0x3FFF,0xFF3F,0xFF5E,0x2FFF,0xFF3F,0xFFFF,
- 0xFFF3,0xFFFF,0xFF81,0x2203,0xFFFF,0x8003,0xFF3F,0xFF80,0x1FFF,0xFFBF,0xFFFF,
- 0xFFF3,0xFFFF,0xFFFF,0xFE63,0xFFFF,0x004F,0xFFBF,0xFFE0,0x7FFF,0xFF3F,0xFFFF,
- 0xFFF1,0xFFFF,0xFFFF,0xFE61,0xFFFF,0x9FFF,0xFF3F,0xFFC1,0xFFFF,0xFF3F,0xFFFF,
- 0xFF00,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x3FFF,
- 0xFE7F,0xFF07,0xFFFF,0xF803,0xFFF3,0x8FFF,0xFFFF,0xFF84,0x7FFF,0xFFFF,0xCFFF,
- 0xFEFF,0xFFE7,0xFF00,0x8E0F,0xFFFB,0x87FF,0xFFFF,0xFF9C,0xFFFF,0xFFFF,0xCFFF,
- 0xFE7F,0xFFE7,0xFC04,0xC7FF,0xFFF3,0xC3FF,0xFFFF,0xFF1C,0xFFFF,0xFFFF,0xCFFF,
- 0xFCFF,0xFFE7,0xFE3F,0xFFFF,0xFFF3,0xE1FF,0xFFFF,0xFE3C,0xFFFF,0xFFFF,0xCFFF,
- 0x81FF,0xFFF7,0xFFFF,0xFFFF,0xFFF3,0xC1FF,0xFFFF,0xFC1E,0xFFFF,0xFFFF,0xCFFF,
- 0x1FFF,0xFFE7,0xFFFF,0xFFFF,0xFFE3,0xFFFF,0xFFFF,0xFC3C,0xFFFF,0xFFFF,0xCFFF,
- 0x8000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x1FFF
- };
- struct Image logoImage = {
- 0, 0, /* LeftEdge, TopEdge */
- 164, 41, 2, /* Width, Height, Depth */
- &logoData[0], /* ImageData */
- 0x03, 0x00, /* PlanePick, PlaneOnOff */
- NULL /* NextImage */
- };
-
- UWORD __chip wallData[192/2] = {
- /* BitPlane 1 */
- 0x0000,0x0800,0x0000,0x0000,0x0000,0x0007,
- 0xE7FF,0xFF9F,0xFFFF,0x9FFF,0xFF9F,0xFFFF,
- 0xEFFF,0xFF9F,0xFFFF,0x9FFF,0xFF9F,0xFFFF,
- 0xE7FF,0xFF9F,0xFFFF,0xBFFF,0xFF9F,0xFFFF,
- 0xE7FF,0xFF9F,0xFFFF,0x9FFF,0xFF9F,0xFFFF,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0007,
- 0xFFF9,0xFFFF,0xF3FF,0xFFE7,0xFFFF,0xF3FF,
- 0xFFF9,0xFFFF,0xF3FF,0xFFE7,0xFFFF,0xF7FF,
- 0xFFF9,0xFFFF,0xF3FF,0xFFE7,0xFFFF,0xF3FF,
- 0xFFFD,0xFFFF,0xF3FF,0xFFE7,0xFFFF,0xF3FF,
- 0x0000,0x0000,0x0000,0x0000,0x0200,0x0007,
- 0xCFFF,0xFF3F,0xFFFF,0x7FFF,0xFF3F,0xFFFF,
- 0xCFFF,0xFF3F,0xFFFF,0x3FFF,0xFF3F,0xFFFF,
- 0xCFFF,0xFF3F,0xFFFF,0x3FFF,0xFF3F,0xFFFF,
- 0xDFFF,0xFF3F,0xFFFF,0x3FFF,0xFF3F,0xFFFF,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0007
- };
- struct Image wallImage = {
- 0, 0, /* LeftEdge, TopEdge */
- 93, 16, 2, /* Width, Height, Depth */
- &wallData[0], /* ImageData */
- 0x2, 0x00, /* PlanePick, PlaneOnOff */
- NULL /* NextImage */
- };
-
- UWORD __chip wallhData[64] = {
- /* BitPlane 0 */
- 0x0000,0x0007,0x0000,0x00FF,
- 0x0000,0x07DF,0x8000,0x00FF,
- 0x0000,0x0FBF,0xC000,0x00FF,
- 0x0000,0x0FFF,0xE000,0x00FF,
- 0x0000,0xFFFF,0xFC00,0x00FF,
- 0x0000,0x1FFF,0xE000,0x00FF,
- 0x4900,0x1000,0x0000,0x92FF,
- 0xFF80,0x0E18,0x6001,0xFFFF,
- /* BitPlane 1 */
- 0xFFFF,0xFFFF,0xFFFF,0xFF00,
- 0xFFFF,0xFFFF,0xFFFF,0xFF00,
- 0xFFFF,0xFFFF,0xFFFF,0xFF00,
- 0xFFFF,0xFFFF,0xFFFF,0xFF00,
- 0xFFFF,0xFFFF,0xFFFF,0xFF00,
- 0xFFFF,0xFFFF,0xFFFF,0xFF00,
- 0xFFFF,0xF000,0x1FFF,0xFF00,
- 0xFFFF,0xEE18,0x7FFF,0xFF00
- };
- struct Image wallhImage = {
- WALLHL, WALLHT, /* LeftEdge, TopEdge */
- 56, 8, 2, /* Width, Height, Depth */
- &wallhData[0], /* ImageData */
- 0x03, 0x00, /* PlanePick, PlaneOnOff */
- NULL /* NextImage */
- };
-
- struct Image wallhcImage = {
- WALLHL, WALLHT, /* LeftEdge, TopEdge */
- 56, 8, 2, /* Width, Height, Depth */
- &wallhData[0], /* ImageData */
- 0x00, 0x02, /* PlanePick, PlaneOnOff */
- NULL /* NextImage */
- };
-
-
- UWORD __chip checkData[16] = {
- /* BitPlane 0 */
- 0x0033,
- 0x0066,
- 0x00CC,
- 0x0198,
- 0xCF30,
- 0x6660,
- 0x33C0,
- 0x1980,
- /* BitPlane 1 */
- 0xFFC3,
- 0xFF87,
- 0xFF0F,
- 0xFE1F,
- 0x0C3F,
- 0x867F,
- 0xC3FF,
- 0xE1FF
- };
- struct Image checkImage = {
- 0, 0, /* LeftEdge, TopEdge */
- 16, 8, 2, /* Width, Height, Depth */
- &checkData[0], /* ImageData */
- 0x03, 0x00, /* PlanePick, PlaneOnOff */
- NULL /* NextImage */
- };
-
- struct Image nullimage = {
- 0, 0, /* LeftEdge, TopEdge */
- 16, 8, 2, /* Width, Height, Depth */
- NULL, /* ImageData */
- 0x0, 0x2, /* PlanePick, PlaneOnOff */
- NULL /* NextImage */
- };
-
-
- struct IntuiText logot3=
- {
- 3, 2,
- JAM1,
- (ALLLOGOW-20*8)/2+3*8, LOGOH+4+20,
- &tai,
- "Federico Giannici",
- NULL /* next */
- };
- struct IntuiText logot2=
- {
- 3, 2,
- JAM1,
- (ALLLOGOW-20*8)/2, LOGOH+4+20,
- &tanormal,
- "by",
- &logot3 /* next */
- };
- struct IntuiText logotext=
- {
- 3, 2,
- JAM1,
- (ALLLOGOW-5*8)/2, LOGOH+4,
- &tanormal,
- "V "VERSIONE,
- &logot2 /* next */
- };
-
-
- struct IntuiText ftext2=
- {
- 1, 2,
- JAM1,
- (FWINDW-14*8)/2, FGADGT2-13,
- &tabu,
- " EXEC Library ",
- NULL /* next */
- };
- struct IntuiText ftext= /* Testo della fwindow */
- {
- 1, 2,
- JAM1,
- (FWINDW-13*8)/2, FGADGT-13,
- &tabu,
- " DOS Library ",
- &ftext2 /* next */
- };
-
-
- struct IntuiText gadgettextfindname=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "FindName",
- NULL /* next */
- };
- struct Gadget gadgetfindname=
- {
- NULL,
- FGADGL+3*FGADGCOL, FGADGT2+2*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextfindname,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextaddsemaphore=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "AddSemaphore",
- NULL /* next */
- };
- struct Gadget gadgetaddsemaphore=
- {
- &gadgetfindname,
- FGADGL+3*FGADGCOL, FGADGT2+1*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextaddsemaphore,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextfindsemaphore=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "FindSemaphore",
- NULL /* next */
- };
- struct Gadget gadgetfindsemaphore=
- {
- &gadgetaddsemaphore,
- FGADGL+3*FGADGCOL, FGADGT2+0*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextfindsemaphore,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextaddport=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "AddPort",
- NULL /* next */
- };
- struct Gadget gadgetaddport=
- {
- &gadgetfindsemaphore,
- FGADGL+2*FGADGCOL, FGADGT2+3*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextaddport,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextfindport=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "FindPort",
- NULL /* next */
- };
- struct Gadget gadgetfindport=
- {
- &gadgetaddport,
- FGADGL+2*FGADGCOL, FGADGT2+2*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextfindport,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextaddresource=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "AddResource",
- NULL /* next */
- };
- struct Gadget gadgetaddresource=
- {
- &gadgetfindport,
- FGADGL+2*FGADGCOL, FGADGT2+1*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextaddresource,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextopenresource=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "OpenResource",
- NULL /* next */
- };
- struct Gadget gadgetopenresource=
- {
- &gadgetaddresource,
- FGADGL+2*FGADGCOL, FGADGT2+0*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextopenresource,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextaddlibrary=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "AddLibrary",
- NULL /* next */
- };
- struct Gadget gadgetaddlibrary=
- {
- &gadgetopenresource,
- FGADGL+1*FGADGCOL, FGADGT2+3*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextaddlibrary,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextcloselibrary=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "CloseLibrary",
- NULL /* next */
- };
- struct Gadget gadgetcloselibrary=
- {
- &gadgetaddlibrary,
- FGADGL+1*FGADGCOL, FGADGT2+2*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextcloselibrary,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextoldopenlibrary=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "OldOpenLibrary",
- NULL /* next */
- };
- struct Gadget gadgetoldopenlibrary=
- {
- &gadgetcloselibrary,
- FGADGL+1*FGADGCOL, FGADGT2+1*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextoldopenlibrary,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextopenlibrary=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "OpenLibrary",
- NULL /* next */
- };
- struct Gadget gadgetopenlibrary=
- {
- &gadgetoldopenlibrary,
- FGADGL+1*FGADGCOL, FGADGT2+0*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextopenlibrary,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextadddevice=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "AddDevice",
- NULL /* next */
- };
- struct Gadget gadgetadddevice=
- {
- &gadgetopenlibrary,
- FGADGL+0*FGADGCOL, FGADGT2+3*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextadddevice,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextclosedevice=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "CloseDevice",
- NULL /* next */
- };
- struct Gadget gadgetclosedevice=
- {
- &gadgetadddevice,
- FGADGL+0*FGADGCOL, FGADGT2+2*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextclosedevice,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextopendevice=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "OpenDevice",
- NULL /* next */
- };
- struct Gadget gadgetopendevice=
- {
- &gadgetclosedevice,
- FGADGL+0*FGADGCOL, FGADGT2+1*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextopendevice,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextallocmem=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "(fail)AllocMem",
- NULL /* next */
- };
- struct Gadget gadgetallocmem=
- {
- &gadgetopendevice,
- FGADGL+0*FGADGCOL, FGADGT2+0*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextallocmem,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- /***** Funzioni DOS *****/
-
- struct IntuiText gadgettextioerr=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "IoErr",
- NULL /* next */
- };
- struct Gadget gadgetioerr=
- {
- &gadgetallocmem,
- FGADGL+3*FGADGCOL, FGADGT+5*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextioerr,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextexit=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "Exit",
- NULL /* next */
- };
- struct Gadget gadgetexit=
- {
- &gadgetioerr,
- FGADGL+3*FGADGCOL, FGADGT+4*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextexit,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextcreateproc=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "CreateProc",
- NULL /* next */
- };
- struct Gadget gadgetcreateproc=
- {
- &gadgetexit,
- FGADGL+3*FGADGCOL, FGADGT+3*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextcreateproc,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextunloadseg=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "UnLoadSeg",
- NULL /* next */
- };
- struct Gadget gadgetunloadseg=
- {
- &gadgetcreateproc,
- FGADGL+3*FGADGCOL, FGADGT+2*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextunloadseg,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextloadseg=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "LoadSeg",
- NULL /* next */
- };
- struct Gadget gadgetloadseg=
- {
- &gadgetunloadseg,
- FGADGL+3*FGADGCOL, FGADGT+1*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextloadseg,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextexecute=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "Execute",
- NULL /* next */
- };
- struct Gadget gadgetexecute=
- {
- &gadgetloadseg,
- FGADGL+3*FGADGCOL, FGADGT+0*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextexecute,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextseek=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "Seek",
- NULL /* next */
- };
- struct Gadget gadgetseek=
- {
- &gadgetexecute,
- FGADGL+2*FGADGCOL, FGADGT+5*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextseek,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextparentdir=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "ParentDir",
- NULL /* next */
- };
- struct Gadget gadgetparentdir=
- {
- &gadgetseek,
- FGADGL+2*FGADGCOL, FGADGT+4*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextparentdir,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextcurrentdir=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "CurrentDir",
- NULL /* next */
- };
- struct Gadget gadgetcurrentdir=
- {
- &gadgetparentdir,
- FGADGL+2*FGADGCOL, FGADGT+3*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextcurrentdir,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextcreatedir=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "CreateDir",
- NULL /* next */
- };
- struct Gadget gadgetcreatedir=
- {
- &gadgetcurrentdir,
- FGADGL+2*FGADGCOL, FGADGT+2*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextcreatedir,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextrename=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "Rename",
- NULL /* next */
- };
- struct Gadget gadgetrename=
- {
- &gadgetcreatedir,
- FGADGL+2*FGADGCOL, FGADGT+1*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextrename,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextdeletefile=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "DeleteFile",
- NULL /* next */
- };
- struct Gadget gadgetdeletefile=
- {
- &gadgetrename,
- FGADGL+2*FGADGCOL, FGADGT+0*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextdeletefile,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextinfo=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "Info",
- NULL /* next */
- };
- struct Gadget gadgetinfo=
- {
- &gadgetdeletefile,
- FGADGL+1*FGADGCOL, FGADGT+5*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextinfo,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextexnext=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "ExNext",
- NULL /* next */
- };
- struct Gadget gadgetexnext=
- {
- &gadgetinfo,
- FGADGL+1*FGADGCOL, FGADGT+4*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextexnext,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextexamine=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "Examine",
- NULL /* next */
- };
- struct Gadget gadgetexamine=
- {
- &gadgetexnext,
- FGADGL+1*FGADGCOL, FGADGT+3*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextexamine,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextduplock=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "DupLock",
- NULL /* next */
- };
- struct Gadget gadgetduplock=
- {
- &gadgetexamine,
- FGADGL+1*FGADGCOL, FGADGT+2*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextduplock,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextunlock=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "UnLock",
- NULL /* next */
- };
- struct Gadget gadgetunlock=
- {
- &gadgetduplock,
- FGADGL+1*FGADGCOL, FGADGT+1*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextunlock,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextlock=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "Lock",
- NULL /* next */
- };
- struct Gadget gadgetlock=
- {
- &gadgetunlock,
- FGADGL+1*FGADGCOL, FGADGT+0*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextlock,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextoutput=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "Output",
- NULL /* next */
- };
- struct Gadget gadgetoutput=
- {
- &gadgetlock,
- FGADGL+0*FGADGCOL, FGADGT+5*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextoutput,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextinput=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "Input",
- NULL /* next */
- };
- struct Gadget gadgetinput=
- {
- &gadgetoutput,
- FGADGL+0*FGADGCOL, FGADGT+4*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextinput,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextwrite=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "Write",
- NULL /* next */
- };
- struct Gadget gadgetwrite=
- {
- &gadgetinput,
- FGADGL+0*FGADGCOL, FGADGT+3*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextwrite,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextread=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "Read",
- NULL /* next */
- };
- struct Gadget gadgetread=
- {
- &gadgetwrite,
- FGADGL+0*FGADGCOL, FGADGT+2*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextread,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextclose=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "Close",
- NULL /* next */
- };
- struct Gadget gadgetclose=
- {
- &gadgetread,
- FGADGL+0*FGADGCOL, FGADGT+1*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextclose,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText gadgettextopen=
- {
- 3, 2,
- JAM1,
- FTEXTL, 1,
- &tanormal,
- "Open",
- NULL /* next */
- };
- struct Gadget gadgetopen=
- {
- &gadgetclose,
- FGADGL+0*FGADGCOL, FGADGT+0*FGADGD, FGADGW, FGADGH,
- GADGHIMAGE | GADGIMAGE | SELECTED,
- TOGGLESELECT,
- BOOLGADGET,
- (APTR)&nullimage,
- (APTR)&checkImage, /* SelectRender */
- &gadgettextopen,
- NULL,
- NULL,
- NULL, /* ID */
- NULL
- };
-
- struct IntuiText fwindowgadgettext5=
- {
- 1, 2,
- JAM1,
- (FWGW-6*8)/2, FWGTT,
- &tanormal,
- "CANCEL",
- NULL /* next */
- };
- struct Gadget fwindowgadget5=
- {
- &fgadget,
- FWGL+4*FWGD, FWGT, FWGW, FWGH,
- GADGHIMAGE | GADGIMAGE,
- RELVERIFY,
- BOOLGADGET,
- (APTR)&wallhcImage,
- (APTR)&wallhImage, /* SelectRender */
- &fwindowgadgettext5,
- NULL,
- NULL,
- FCANCELID, /* ID */
- NULL
- };
-
- struct IntuiText fwindowgadgettext4=
- {
- 1, 2,
- JAM1,
- (FWGW-2*8)/2, FWGTT,
- &tab,
- "OK",
- NULL /* next */
- };
- struct Gadget fwindowgadget4=
- {
- &fwindowgadget5,
- FWGL, FWGT, FWGW, FWGH,
- GADGHIMAGE | GADGIMAGE,
- RELVERIFY,
- BOOLGADGET,
- (APTR)&wallhcImage,
- (APTR)&wallhImage, /* SelectRender */
- &fwindowgadgettext4,
- NULL,
- NULL,
- FOKID, /* ID */
- NULL
- };
-
- struct IntuiText fwindowgadgettext3=
- {
- 1, 2,
- JAM1,
- (FWGW-3*8)/2, FWGTT,
- &tanormal,
- "ALL",
- NULL /* next */
- };
- struct Gadget fwindowgadget3=
- {
- &fwindowgadget4,
- FWGL+FWGD, FWGT, FWGW, FWGH,
- GADGHIMAGE | GADGIMAGE,
- RELVERIFY,
- BOOLGADGET,
- (APTR)&wallhcImage,
- (APTR)&wallhImage, /* SelectRender */
- &fwindowgadgettext3,
- NULL,
- NULL,
- FALLID, /* ID */
- NULL
- };
-
- struct IntuiText fwindowgadgettext2=
- {
- 1, 2,
- JAM1,
- (FWGW-4*8)/2, FWGTT,
- &tanormal,
- "NONE",
- NULL /* next */
- };
- struct Gadget fwindowgadget2=
- {
- &fwindowgadget3,
- FWGL+2*FWGD, FWGT, FWGW, FWGH,
- GADGHIMAGE | GADGIMAGE,
- RELVERIFY,
- BOOLGADGET,
- (APTR)&wallhcImage,
- (APTR)&wallhImage, /* SelectRender */
- &fwindowgadgettext2,
- NULL,
- NULL,
- FNONEID, /* ID */
- NULL
- };
-
- struct IntuiText fwindowgadgettext1=
- {
- 1, 2,
- JAM1,
- (FWGW-7*8)/2, FWGTT,
- &tanormal,
- "RESTORE",
- NULL /* next */
- };
- struct Gadget fwindowgadget=
- {
- &fwindowgadget2,
- FWGL+3*FWGD, FWGT, FWGW, FWGH,
- GADGHIMAGE | GADGIMAGE,
- RELVERIFY,
- BOOLGADGET,
- (APTR)&wallhcImage,
- (APTR)&wallhImage, /* SelectRender */
- &fwindowgadgettext1,
- NULL,
- NULL,
- FRESTOREID, /* ID */
- NULL
- };
-
-
- struct IntuiText cwindowcancelgadgettext=
- {
- 1, 2,
- JAM1,
- (CWGW-6*8)/2, CWGTT,
- &tanormal,
- "CANCEL", /* Verra` messo poi */
- NULL /* next */
- };
- struct Gadget cwindowcancelgadget=
- {
- NULL,
- CWGL+CWGD, CWGT, CWGW, CWGH,
- GADGHIMAGE | GADGIMAGE,
- RELVERIFY,
- BOOLGADGET,
- (APTR)&wallhcImage,
- (APTR)&wallhImage, /* SelectRender */
- &cwindowcancelgadgettext,
- NULL,
- NULL,
- CCANCELID, /* ID */
- NULL
- };
-
- struct IntuiText cwindowokgadgettext=
- {
- 1, 2,
- JAM1,
- (CWGW-4*8)/2, CWGTT,
- &tab,
- NULL, /* Verra` messo poi */
- NULL /* next */
- };
- struct Gadget cwindowokgadget=
- {
- &cwindowcancelgadget,
- CWGL, CWGT, CWGW, CWGH,
- GADGHIMAGE | GADGIMAGE,
- RELVERIFY,
- BOOLGADGET,
- (APTR)&wallhcImage,
- (APTR)&wallhImage, /* SelectRender */
- &cwindowokgadgettext,
- NULL,
- NULL,
- COKID, /* ID */
- NULL
- };
-
- UBYTE gconfigname[ CSTRLEN ];
- struct StringInfo cwindowgadgetstrinfo=
- {
- gconfigname,
- NULL,
- 0,
- CSTRLEN,
- 0
- };
- struct Gadget cwindowgadget=
- {
- &cwindowokgadget, /* Next */
- (CWINDW-8*CGSTRLEN)/2, 30,
- 8*CGSTRLEN, 8,
- GADGHCOMP,
- RELVERIFY | STRINGCENTER,
- STRGADGET,
- NULL,
- NULL,
- NULL, /* Text */
- NULL,
- (APTR)&cwindowgadgetstrinfo,
- COKID, /* ID */
- NULL
- };
-
-
-
- struct IntuiText itemtextflashoff=
- {
- 3, 2,
- JAM1,
- ITEML+CHECKWIDTH, ITEMTEXTT,
- &tanormal,
- "Deactivated",
- NULL /* next */
- };
- struct MenuItem itemflashoff=
- {
- NULL, /* next */
- 0, 11*ITEMD+5*3,
- ITEM1W, ITEMH,
- ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
- 0x40, /* mutualexclude */
- (APTR)&itemtextflashoff,
- NULL,
- NULL, /* command */
- NULL, /* subitem */
- NULL
- };
- struct IntuiText itemtextflashonb=
- {
- 1, 2,
- JAM1,
- ITEML, ITEMTEXTT-ITEMD,
- &taiu,
- " ScreenFlash ",
- NULL /* next */
- };
- struct IntuiText itemtextflashon=
- {
- 3, 2,
- JAM1,
- ITEML+CHECKWIDTH, ITEMTEXTT,
- &tanormal,
- "Activated",
- &itemtextflashonb /* next */
- };
- struct MenuItem itemflashon=
- {
- &itemflashoff, /* next */
- 0, 10*ITEMD+5*3,
- ITEM1W, ITEMH,
- ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT | CHECKED,
- 0x80, /* mutualexclude */
- (APTR)&itemtextflashon,
- NULL,
- NULL, /* command */
- NULL, /* subitem */
- NULL
- };
- struct IntuiText itemtextimmediately=
- {
- 3, 2,
- JAM1,
- ITEML+CHECKWIDTH, ITEMTEXTT,
- &tanormal,
- "Immediately",
- NULL /* next */
- };
- struct MenuItem itemimmediately=
- {
- &itemflashon, /* next */
- 0, 8*ITEMD+5*2,
- ITEM1W, ITEMH,
- ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
- 0x10, /* mutualexclude */
- (APTR)&itemtextimmediately,
- NULL,
- NULL, /* command */
- NULL, /* subitem */
- NULL
- };
- struct IntuiText itemtextwaitforgob=
- {
- 1, 2,
- JAM1,
- ITEML, ITEMTEXTT-ITEMD,
- &taiu,
- " Go on ",
- NULL /* next */
- };
- struct IntuiText itemtextwaitforgo=
- {
- 3, 2,
- JAM1,
- ITEML+CHECKWIDTH, ITEMTEXTT,
- &tanormal,
- "Wait for GO",
- &itemtextwaitforgob /* next */
- };
- struct MenuItem itemwaitforgo=
- {
- &itemimmediately, /* next */
- 0, 7*ITEMD+5*2,
- ITEM1W, ITEMH,
- ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT | CHECKED,
- 0x20, /* mutualexclude */
- (APTR)&itemtextwaitforgo,
- NULL,
- NULL, /* command */
- NULL, /* subitem */
- NULL
- };
- struct IntuiText itemtextfailedonly=
- {
- 3, 2,
- JAM1,
- ITEML+CHECKWIDTH, ITEMTEXTT,
- &tanormal,
- "Failed only",
- NULL /* next */
- };
- struct MenuItem itemfailedonly=
- {
- &itemwaitforgo, /* next */
- 0, 5*ITEMD+5,
- ITEM1W, ITEMH,
- ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
- 0x4, /* mutualexclude */
- (APTR)&itemtextfailedonly,
- NULL,
- NULL, /* command */
- NULL, /* subitem */
- NULL
- };
- struct IntuiText itemtexteverytimeb=
- {
- 1, 2,
- JAM1,
- ITEML, ITEMTEXTT-ITEMD,
- &taiu,
- " Activation ",
- NULL /* next */
- };
- struct IntuiText itemtexteverytime=
- {
- 3, 2,
- JAM1,
- ITEML+CHECKWIDTH, ITEMTEXTT,
- &tanormal,
- "Every time",
- &itemtexteverytimeb /* next */
- };
- struct MenuItem itemeverytime=
- {
- &itemfailedonly, /* next */
- 0, 4*ITEMD+5,
- ITEM1W, ITEMH,
- ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT | CHECKED,
- 0x8, /* mutualexclude */
- (APTR)&itemtexteverytime,
- NULL,
- NULL, /* command */
- NULL, /* subitem */
- NULL
- };
- struct IntuiText itemtextbrief=
- {
- 3, 2,
- JAM1,
- ITEML+CHECKWIDTH, ITEMTEXTT,
- &tanormal,
- "Brief",
- NULL /* next */
- };
- struct MenuItem itembrief=
- {
- &itemeverytime, /* next */
- 0, 2*ITEMD,
- ITEM1W, ITEMH,
- ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT,
- 0x1, /* mutualexclude */
- (APTR)&itemtextbrief,
- NULL,
- NULL, /* command */
- NULL, /* subitem */
- NULL
- };
- struct IntuiText itemtextverboseb=
- {
- 1, 2,
- JAM1,
- ITEML, ITEMTEXTT-ITEMD,
- &taiu,
- " Description ",
- NULL /* next */
- };
- struct IntuiText itemtextverbose=
- {
- 3, 2,
- JAM1,
- ITEML+CHECKWIDTH, ITEMTEXTT,
- &tanormal,
- "Verbose",
- &itemtextverboseb /* next */
- };
- struct MenuItem itemverbose=
- {
- &itembrief, /* next */
- 0, ITEMD,
- ITEM1W, ITEMH,
- ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT | CHECKED,
- 0x2, /* mutualexclude */
- (APTR)&itemtextverbose,
- NULL,
- NULL, /* command */
- NULL, /* subitem */
- NULL
- };
- struct Menu menu1=
- {
- NULL, /* next */
- 100, 0,
- 14*8, 10,
- MENUENABLED,
- " Preferences",
- &itemverbose
- };
-
-
- struct IntuiText itemtext05=
- {
- 3, 2,
- JAM1,
- ITEML, ITEMTEXTT,
- &tanormal,
- "Quit",
- NULL /* next */
- };
- struct MenuItem item05=
- {
- NULL, /* next */
- 0, 7*ITEMD,
- ITEM0W, ITEMH,
- ITEMTEXT | ITEMENABLED | HIGHCOMP,
- NULL, /* mutualexclude */
- (APTR)&itemtext05,
- NULL,
- NULL, /* command */
- NULL, /* subitem */
- NULL
- };
-
- struct IntuiText subitemtext0addre=
- {
- 3, 2,
- JAM1,
- (INFOW-38*8)/2, INFOADDRT+3*INFOTEXTD,
- &tanormal,
- "Viale Francia 4, 90146 Palermo, Italy.",
- NULL /* next */
- };
- struct IntuiText subitemtext0addrd=
- {
- 3, 2,
- JAM1,
- (INFOW-20*8)/2+3*8, INFOADDRT+2*INFOTEXTD,
- &tai,
- "Federico Giannici",
- &subitemtext0addre /* next */
- };
- struct IntuiText subitemtext0addrc=
- {
- 3, 2,
- JAM1,
- (INFOW-20*8)/2, INFOADDRT+2*INFOTEXTD,
- &tanormal,
- "by",
- &subitemtext0addrd /* next */
- };
- struct IntuiText subitemtext04addrb=
- {
- 3, 2,
- JAM1,
- (INFOW-23*8)/2, INFOADDRT+1*INFOTEXTD,
- &tanormal,
- "Concept, Code & Graphic",
- &subitemtext0addrc /* next */
- };
- struct IntuiText subitemtext04addra=
- {
- 3, 2,
- JAM1,
- 0, INFOADDRT-4,
- &tab,
- "________________________________________",
- &subitemtext04addrb /* next */
- };
- struct IntuiText subitemtext04c=
- {
- 3, 2,
- JAM1,
- (INFOW-33*8)/2, INFOTEXTT+1*INFOTEXTD,
- &tanormal,
- "but you CANNOT modify or sell it!",
- &subitemtext04addra /* next */
- };
- struct IntuiText subitemtext04b=
- {
- 3, 2,
- JAM1,
- (INFOW-32*8)/2, INFOTEXTT+0*INFOTEXTD,
- &tanormal,
- "This is a Public Domain program,",
- &subitemtext04c /* next */
- };
- struct IntuiText subitemtext04=
- {
- 3, 2,
- JAM1,
- (INFOW-5*8)/2, LOGOH+INFOLOGOT+5-INFOT,
- &tanormal,
- "V "VERSIONE,
- &subitemtext04b /* next */
- };
- struct MenuItem subitem04c= /* Per il LOGO */
- {
- NULL, /* next */
- (INFOW-LOGOW)/2, INFOLOGOT,
- 0, 0,
- HIGHNONE,
- NULL, /* mutualexclude */
- (APTR)&logoImage,
- NULL,
- NULL, /* command */
- NULL, /* subitem */
- NULL
- };
- struct MenuItem subitem04b= /* Per la dimensione */
- {
- &subitem04c, /* next */
- INFOW, INFOMAXH,
- 0, 0,
- HIGHNONE,
- NULL, /* mutualexclude */
- NULL,
- NULL,
- NULL, /* command */
- NULL, /* subitem */
- NULL
- };
- struct MenuItem subitem04=
- {
- &subitem04b, /* next */
- 0, INFOT,
- 0, 0,
- ITEMTEXT | HIGHNONE,
- NULL, /* mutualexclude */
- (APTR)&subitemtext04,
- NULL,
- NULL, /* command */
- NULL, /* subitem */
- NULL
- };
- struct IntuiText itemtext04=
- {
- 3, 2,
- JAM1,
- ITEML, ITEMTEXTT,
- &tanormal,
- "Informations",
- NULL /* next */
- };
- struct MenuItem item04=
- {
- &item05, /* next */
- 0, 6*ITEMD,
- ITEM0W, ITEMH,
- ITEMTEXT | ITEMENABLED | HIGHCOMP,
- NULL, /* mutualexclude */
- (APTR)&itemtext04,
- NULL,
- NULL, /* command */
- &subitem04, /* subitem */
- NULL
- };
- struct IntuiText itemtext03b=
- {
- 3, 2,
- JAM1,
- ITEML, ITEMTEXTT,
- &tanormal,
- "Clear FileHandle mem",
- NULL /* next */
- };
- struct MenuItem item03b=
- {
- &item04, /* next */
- 0, 5*ITEMD,
- ITEM0W, ITEMH,
- ITEMTEXT | ITEMENABLED | HIGHCOMP,
- NULL, /* mutualexclude */
- (APTR)&itemtext03b,
- NULL,
- NULL, /* command */
- NULL, /* subitem */
- NULL
- };
- struct IntuiText itemtext03=
- {
- 3, 2,
- JAM1,
- ITEML, ITEMTEXTT,
- &tanormal,
- "Load configuration",
- NULL /* next */
- };
- struct MenuItem item03=
- {
- &item03b, /* next */
- 0, 4*ITEMD,
- ITEM0W, ITEMH,
- ITEMTEXT | ITEMENABLED | HIGHCOMP,
- NULL, /* mutualexclude */
- (APTR)&itemtext03,
- NULL,
- NULL, /* command */
- NULL, /* subitem */
- NULL
- };
- struct IntuiText itemtext02=
- {
- 3, 2,
- JAM1,
- ITEML, ITEMTEXTT,
- &tanormal,
- "Save configuration",
- NULL /* next */
- };
- struct MenuItem item02=
- {
- &item03, /* next */
- 0, 3*ITEMD,
- ITEM0W, ITEMH,
- ITEMTEXT | ITEMENABLED | HIGHCOMP,
- NULL, /* mutualexclude */
- (APTR)&itemtext02,
- NULL,
- NULL, /* command */
- NULL, /* subitem */
- NULL
- };
- struct IntuiText itemtext01=
- {
- 3, 2,
- JAM1,
- ITEML, ITEMTEXTT,
- &tanormal,
- "Functions",
- NULL /* next */
- };
- struct MenuItem item01=
- {
- &item02, /* next */
- 0, 2*ITEMD,
- ITEM0W, ITEMH,
- ITEMTEXT | ITEMENABLED | HIGHCOMP,
- NULL, /* mutualexclude */
- (APTR)&itemtext01,
- NULL,
- NULL, /* command */
- NULL, /* subitem */
- NULL
- };
- struct IntuiText itemtext00b=
- {
- 3, 2,
- JAM1,
- ITEML+CHECKWIDTH, ITEMTEXTT,
- &tanormal,
- "Printer",
- NULL /* next */
- };
- struct MenuItem item00b=
- {
- &item01, /* next */
- 0, ITEMD,
- ITEM0W, ITEMH,
- ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT | MENUTOGGLE | COMMSEQ,
- NULL, /* mutualexclude */
- (APTR)&itemtext00b,
- NULL,
- 'P', /* command */
- NULL, /* subitem */
- NULL
- };
- struct IntuiText itemtext00=
- {
- 3, 2,
- JAM1,
- ITEML+CHECKWIDTH, ITEMTEXTT,
- &tanormal,
- "Activated",
- NULL /* next */
- };
- struct MenuItem item00=
- {
- &item00b, /* next */
- 0, 0,
- ITEM0W, ITEMH,
- ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT | CHECKED | MENUTOGGLE | COMMSEQ,
- NULL, /* mutualexclude */
- (APTR)&itemtext00,
- NULL,
- 'A', /* command */
- NULL, /* subitem */
- NULL
- };
- struct Menu menu0=
- {
- &menu1, /* next */
- 0, 0,
- 10*8, 10,
- MENUENABLED,
- " General",
- &item00
- };
-
-
- struct IntuiText gadgetgoontext=
- {
- 3, 2,
- JAM1,
- 6, 1,
- &tab,
- "Click here or press a key to GO ON",
- NULL /* next */
- };
- struct Gadget gadgetgoon=
- {
- NULL,
- 4, -9, -20-2, 9,
- GADGHCOMP | GRELBOTTOM | GRELWIDTH | GADGDISABLED,
- RELVERIFY | BOTTOMBORDER,
- BOOLGADGET | GZZGADGET,
- NULL,
- NULL,
- &gadgetgoontext,
- NULL,
- NULL,
- 1, /* ID */
- NULL
- };
-
-
- struct NewWindow windowdata=
- {
- WINDL, WINDT, WINDW, WINDH,
- 3, 2,
- CLOSEWINDOW | REFRESHWINDOW | GADGETUP | VANILLAKEY | MENUPICK | MOUSEBUTTONS,
- WINDOWDRAG | WINDOWDEPTH | WINDOWCLOSE | WINDOWSIZING
- | SIZEBBOTTOM | SMART_REFRESH | ACTIVATE | GIMMEZEROZERO,
- &gadgetgoon, /* Gadget */
- &checkImage,
- "SPY v"VERSIONE" by Federico Giannici",
- NULL,
- NULL,
- LOGOW+10, LOGOH+22, 10000, 10000,
- WBENCHSCREEN,
- };
-
- struct NewWindow fwindowdata=
- {
- 0, 0, FWINDW, FWINDH,
- 3, 2,
- GADGETUP,
- WINDOWDRAG | WINDOWDEPTH | SMART_REFRESH | ACTIVATE | RMBTRAP,
- NULL, /* Gadget */
- NULL,
- "Activated functions of SPY",
- NULL,
- NULL,
- 0, 0, 0, 0,
- WBENCHSCREEN,
- };
-
- struct NewWindow cwindowdata=
- {
- 0, 0, CWINDW, CWINDH,
- 3, 2,
- GADGETUP,
- WINDOWDRAG | WINDOWDEPTH | SMART_REFRESH | ACTIVATE | RMBTRAP,
- NULL, /* Gadget */
- NULL,
- "Name of the Configuration file",
- NULL,
- NULL,
- 0, 0, 0, 0,
- WBENCHSCREEN,
- };
-
-
- struct SPYMsg
- {
- struct Message msg;
- ULONG data;
- };
-
- struct MsgPort goport=
- {
- { NULL, NULL, NT_MSGPORT, NULL, "SPY port for GO ON" }, /* node */
- PA_SIGNAL,
- NULL, /* mettere poi */
- NULL, /* mettere poi */
- { (struct Node *)(&(goport.mp_MsgList.lh_Tail)), NULL, (struct Node *)(&(goport.mp_MsgList.lh_Head)) }
- };
-
- struct Message gomsg=
- {
- { NULL }, /* node */
- &goport
- };
-
- struct MsgPort prtport=
- {
- { NULL, NULL, NT_MSGPORT, NULL, "SPY port for printing" }, /* node */
- PA_SIGNAL,
- NULL, /* mettere poi */
- NULL, /* mettere poi */
- { (struct Node *)(&(prtport.mp_MsgList.lh_Tail)), NULL, (struct Node *)(&(prtport.mp_MsgList.lh_Head)) }
- };
- struct SPYMsg prtmsg=
- {
- { /* Message */
- { NULL }, /* node */
- &prtport
- },
- NULL
- };
-
- struct MsgPort lockport=
- {
- { NULL, NULL, NT_MSGPORT, NULL, "SPY port for lock" }, /* node */
- PA_SIGNAL,
- NULL, /* mettere poi */
- NULL, /* mettere poi */
- { (struct Node *)(&(lockport.mp_MsgList.lh_Tail)), NULL, (struct Node *)(&(lockport.mp_MsgList.lh_Head)) }
- };
- struct SPYMsg lockmsg=
- {
- { /* Message */
- { NULL }, /* node */
- &lockport
- },
- NULL
- };
-
- struct timerequest tmflash= /* Per il flash */
- {
- { /* IORequest */
- { NULL }, /* message */
- NULL,
- NULL,
- TR_ADDREQUEST /* io_Command */
- }
- };
-
- struct timerequest tmquit= /* Per il Quit */
- {
- { /* IORequest */
- { NULL }, /* message */
- NULL,
- NULL,
- TR_ADDREQUEST /* io_Command */
- }
- };
-
- struct timerequest tmconfig= /* Per il Load Config */
- {
- { /* IORequest */
- { NULL }, /* message */
- NULL,
- NULL,
- TR_ADDREQUEST /* io_Command */
- }
- };
-
-
- struct MinList fhlist=
- {
- (struct MinNode *)&(fhlist.mlh_Tail),
- NULL,
- (struct MinNode *)&(fhlist.mlh_Head),
- };
- struct fhnode
- {
- struct MinNode node;
- BPTR fh;
- UBYTE name[FHNAMELEN+1];
- };
-
-
-
- /***** Questi sono necessari per CBack.o *****/
- long _stack = 4000; /* a reasonable amount of stack space */
- char *_procname = "SPY by FG";
- long _priority = SPYPRIORITY;
- long _BackGroundIO = 1; /* perform background I/O */
- extern BPTR _Backstdout; /* file handle we will write to with */
-
-
- UBYTE errtext[ERRORTEXTLEN]="\n\nSPY Error: ";
-
- UBYTE helptext[]="\nSPY V"VERSIONE" by Federico Giannici \n"
- "\n"
- "Usage: SPY [config.file]\n\n";
-
- UBYTE *paramtext[]=
- {
- "Verbose",
- "Brief",
- "Every time",
- "Failed only",
- "Wait for GO",
- "Return immediately",
- "ScreenFlash Activated",
- "ScreenFlash Deactivated",
- };
-
-
- UWORD vectoffset[ VECTNUM ]=
- {
- 0x1e, /* Open */
- 0x24, /* Close */
- 0x2a, /* Read */
- 0x30, /* Write */
- 0x36, /* Input */
- 0x3c, /* Output */
- 0x54, /* Lock */
- 0x5a, /* UnLock */
- 0x60, /* DupLock */
- 0x66, /* Examine */
- 0x6c, /* ExNext */
- 0x72, /* Info */
- 0x48, /* DeleteFile */
- 0x4e, /* Rename */
- 0x78, /* CreateDir */
- 0x7e, /* CurrentDir */
- 0xd2, /* ParentDir */
- 0x42, /* Seek */
- 0xde, /* Execute */
- 0x96, /* LoadSeg */
- 0x9c, /* UnLoadSeg */
- 0x8a, /* CreateProc */
- 0x90, /* Exit */
- 0x84, /* IoErr */
- /* Funzioni EXEC */
- 0xc6, /* AllocMem */
- 0x1bc, /* OpenDevice */
- 0x1c2, /* CloseDevice */
- 0x1b0, /* AddDevice */
- 0x228, /* OpenLibrary */
- 0x198, /* OldOpenLibrary */
- 0x19e, /* CloseLibrary */
- 0x18c, /* AddLibrary */
- 0x1f2, /* OpenResource */
- 0x1e6, /* AddResource */
- 0x186, /* FindPort */
- 0x162, /* AddPort */
- 0x252, /* FindSemaphore */
- 0x258, /* AddSemaphore */
- 0x114 /* FindName */
- };
-
- struct vect
- {
- UWORD vect1;
- ULONG vect2;
- };
-
- struct vect newvect[ VECTNUM ]=
- {
- /* Funzioni DOS */
- {JMPCODE}, {JMPCODE}, {JMPCODE}, {JMPCODE}, {JMPCODE}, {JMPCODE},
- {JMPCODE}, {JMPCODE}, {JMPCODE}, {JMPCODE}, {JMPCODE}, {JMPCODE},
- {JMPCODE}, {JMPCODE}, {JMPCODE}, {JMPCODE}, {JMPCODE}, {JMPCODE},
- {JMPCODE}, {JMPCODE}, {JMPCODE}, {JMPCODE}, {JMPCODE}, {JMPCODE},
- /* Funzioni EXEC */
- {JMPCODE}, {JMPCODE}, {JMPCODE}, {JMPCODE},
- {JMPCODE}, {JMPCODE}, {JMPCODE}, {JMPCODE},
- {JMPCODE}, {JMPCODE}, {JMPCODE}, {JMPCODE},
- {JMPCODE}, {JMPCODE}, {JMPCODE},
- };
-
- struct vect oldvect[ VECTNUM ];
-
- BOOL selectedfun[ VECTNUM ]= /* Nuove funzioni attualmente attive */
- {
- TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
- TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
- TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
- TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
- /* Funzioni EXEC */
- TRUE, TRUE, TRUE, TRUE,
- TRUE, TRUE, TRUE, TRUE,
- TRUE, TRUE, TRUE, TRUE,
- TRUE, TRUE, FALSE,
- };
-
- extern UBYTE *SysBase;
- struct IntuitionBase *IntuitionBase=NULL;
- struct GfxBase *GfxBase=NULL;
- struct Window *window=NULL;
- struct RastPort *rp;
-
- struct IntuiMessage *msg;
- ULONG class;
- UWORD code;
- ULONG seconds, micros, lastseconds, lastmicros;
-
- UBYTE configname[ CSTRLEN ]="spy.config"; /* Nome del config.file */
- BPTR configfile=NULL; /* File-Handle del file di configurazione */
- UBYTE configid[4]={ 'S', 'P', 'Y', 0 }; /* Identificativo, 4 caratteri */
-
- WORD executing=0; /* Numero di processi che stanno eseguendo SPY */
- BOOL quitting=FALSE; /* Sto per cancellare SPY */
- BOOL loading=FALSE; /* Sto attendedo di poter spostare window */
- BOOL goon=FALSE; /* E` stato dato il GO ON */
- BOOL gotvect=FALSE; /* Memorizzati i vecchi vettori */
- BOOL windowinuse=FALSE; /* Window gia` in uso */
- BOOL cannotwait; /* Non si puo` fare il WAIT FOR GO */
- BOOL customfile=FALSE; /* C'e` un argometo da CLI */
- struct Task *spytask; /* Puntatore al Task di SPY */
- COUNT flashcount; /* Contatore per ScreenFlash */
-
- UBYTE lockname[LOCKNAMELEN+1]; /* Usate da spyprintlock() */
- UBYTE locknametmp[LOCKNAMELEN+1];
- struct FileInfoBlock *lockfib;
-
- BPTR printerfh=NULL; /* Usate da printerprint */
- BOOL noprint=FALSE;
- BOOL notrapprt=FALSE;
-
-
-
- /***** Main *****/
- void main( int argc, char **argv)
- {
- if( argc>1 )
- {
- if( argc>2 )
- fine( "Too many arguments" );
- if( argv[1][0]=='?' )
- fine( FINEHELP );
- strncpy( configname, argv[1], CSTRLEN );
- customfile=TRUE;
- }
-
- loadconfig();
- openall();
- setprinter();
-
- getoldvect();
- setvect( TUTTIV );
-
- FOREVER
- {
- WaitPort( window->UserPort );
- msg=(struct IntuiMessage *)GetMsg( window->UserPort );
-
- if( (struct Message *)msg==&gomsg ) /* Wait fo GO */
- {
- if( SCREENFLASH )
- {
- flashcount=0;
- DisplayBeep( NULL );
- }
- goon=FALSE;
- OnGadget( &gadgetgoon, window, NULL );
- tmflash.tr_time.tv_micro=FLASHDELAY;
- SendIO( IO &tmflash );
- }
- else if( (struct timerequest *)msg==&tmflash ) /* Timer */
- {
- if( goon )
- {
- ReplyMsg( &gomsg );
- }
- else
- {
- if( SCREENFLASH )
- if( flashcount++==6 )
- {
- flashcount=0;
- DisplayBeep( NULL );
- }
- gadgetgoontext.FrontPen= gadgetgoontext.FrontPen==1 ? 3 : 1;
- RefreshGList( &gadgetgoon, window, NULL, 1);
- tmflash.tr_time.tv_micro=FLASHDELAY;
- SendIO( IO &tmflash );
- }
- }
- else if( (struct timerequest *)msg==&tmquit ) /* Quiting */
- {
- if( executing ) /* C'e` ancora qualcuno */
- {
- quitting=1;
- tmquit.tr_time.tv_micro=QUITDELAY;
- SendIO( IO &tmquit );
- }
- else
- {
- if( quitting==2 ) /* non c'e` nessuno per due volte consecutive */
- fine( NULL );
- else
- {
- ++quitting;
- tmquit.tr_time.tv_micro=QUITDELAY;
- SendIO( IO &tmquit );
- }
- }
- }
- else if( (struct timerequest *)msg==&tmconfig ) /* Loading Config */
- {
- Forbid();
- if( windowinuse )
- {
- Permit();
- tmconfig.tr_time.tv_micro=CONFIGDELAY;
- SendIO( IO &tmconfig );
- }
- else
- {
- windowinuse=TRUE;
- Permit();
- ClearMenuStrip( window );
- CloseWindow( window );
- openwindow();
- windowinuse=FALSE;
- loading=FALSE;
- setprinter();
- }
- }
- else if( (struct SPYMsg *)msg==&lockmsg ) /* Scrive un lock */
- {
- spyprintlock( (BPTR)(lockmsg.data) );
- ReplyMsg( (struct Message *)msg );
- }
- else if( (struct SPYMsg *)msg==&prtmsg ) /* Stampa una stringa */
- {
- spyprinterprint( (UBYTE *)(prtmsg.data) );
- ReplyMsg( (struct Message *)msg );
- }
- else if( msg->Class==NULL ) /* Mandato da newexit() */
- {
- setvect( EXITV );
- FreeMem( msg, sizeof(struct IntuiMessage) );
- }
- else
- {
- class=msg->Class;
- code=msg->Code;
- seconds=msg->Seconds;
- micros=msg->Micros;
- ReplyMsg( (struct Message *)msg );
-
- switch( class )
- {
- case CLOSEWINDOW:
- quit();
- break;
-
- case REFRESHWINDOW:
- BeginRefresh( window );
- SetRast( rp, 2 );
- EndRefresh( window, TRUE );
- break;
-
- case GADGETUP:
- case VANILLAKEY:
- if( goon==FALSE )
- {
- gadgetgoon.Flags|=GADGDISABLED;
- gadgetgoontext.FrontPen=3;
- RefreshWindowFrame( window );
- goon=TRUE;
- }
- break;
-
- case MOUSEBUTTONS:
- if( code==SELECTDOWN )
- {
- if( DoubleClick( lastseconds, lastmicros, seconds, micros ) )
- functions();
- else
- {
- lastseconds=seconds;
- lastmicros=micros;
- }
- }
- break;
-
- case MENUPICK:
- while( code!=MENUNULL )
- {
- switch( MENUNUM(code) )
- {
- case 0:
- switch( ITEMNUM(code) )
- {
- case 0: /* Activated */
- status( ACTIVATED ? "Activated" : "Deactivated" );
- break;
- case 1: /* Printer On/Off */
- setprinter();
- break;
- case 2:
- functions();
- break;
- case 3: /* Save Config */
- saveconfig();
- break;
- case 4: /* Load Config */
- loadconfig();
- break;
- case 5: /* Clear FileHandle */
- clearfh();
- status( "FileHandle memory cleared" );
- break;
- case 7: /* Quit */
- quit();
- break;
- default:
- status( "***ITEM NOT IMPLEMENTED" );
- }
- break;
- case 1:
- status( paramtext[ITEMNUM(code)] );
- break;
- default:
- status( "***MENU NOT IMPLEMENTED" );
- }
- code=ItemAddress( &menu0, code )->NextSelect;
- }
- break;
-
- default:
- fine( "INTERNAL ERROR #1" );
- }
- }
- }
- }
-
-
- /***** Quit *****/
- void quit( void )
- {
- if( !quitting )
- {
- status( "Quitting" );
- quitting=1;
- resetvect( TUTTIV ); /* Disabilita ulteriori chiamate */
- tmquit.tr_time.tv_micro=QUITDELAY;
- SendIO( IO &tmquit );
- }
- }
-
-
-
- /***** Save della configurazione *****/
- void saveconfig( void )
- {
- if( getconfigname( "SAVE" )==NULL )
- {
- configfile=Open( configname, MODE_NEWFILE );
- if( configfile==NULL )
- {
- status( "Cannot open config file!" );
- return;
- }
- if( write( configid, 4 ) ) /* ID */
- goto saveerr;
- if( write( (UBYTE *)selectedfun, sizeof(selectedfun) ) )
- goto saveerr;
- if( writeitem( &itemactivated ) ) /* Flag vari */
- goto saveerr;
- if( writeitem( &itemprinter ) )
- goto saveerr;
- if( writeitem( &itemverbose ) )
- goto saveerr;
- if( writeitem( &itemeverytime ) )
- goto saveerr;
- if( writeitem( &itemwaitforgo ) )
- goto saveerr;
- if( writeitem( &itemflashon ) )
- goto saveerr;
- if( write( (UBYTE *)&(window->LeftEdge), 4*2 ) ) /* Dimensioni window */
- goto saveerr;
- Close( configfile );
- status( "Saved current configuration" );
- }
- return;
-
- saveerr:
- status( "Error while saving config file!" );
- Close( configfile );
- return;
- }
-
- /***** Scrive un BOOL a seconda se l'item e` CHECKED *****/
- BOOL writeitem( struct MenuItem *item )
- {
- BOOL boolbuff;
-
- boolbuff= (item->Flags & CHECKED) ? TRUE : FALSE;
- return( write( (UBYTE *)&boolbuff, 2 ) );
- }
-
- /***** Versione sintetica di Write *****/
- BOOL write( UBYTE *data, COUNT len )
- {
- return( (BOOL)((Write( configfile, data, len )==len) ? FALSE : TRUE) );
- }
-
-
- /***** Load della configurazione *****/
- void loadconfig( void )
- {
- UBYTE buff[4];
- BOOL boolbuff;
- BPTR lock, oldlock;
-
- if( loading || quitting )
- return;
- if( window )
- if( getconfigname( "LOAD" ) )
- return;
- configfile=Open( configname, MODE_OLDFILE );
- if( configfile==NULL && IoErr()==ERROR_OBJECT_NOT_FOUND )
- {
- lock=Lock( "s:", ACCESS_READ );
- if( lock )
- {
- oldlock=CurrentDir( lock );
- configfile=Open( configname, MODE_OLDFILE );
- CurrentDir( oldlock );
- UnLock( lock );
- }
- }
- if( configfile==NULL )
- {
- if( !window && !customfile )
- return;
- if( IoErr()==ERROR_OBJECT_NOT_FOUND )
- status( "That config file doesn't exist!" );
- else
- status( "Cannot open the config file!" );
- return;
- }
- if( read( buff, 4 ) || strncmp( buff, configid, 4 )!=0 )
- {
- Close( configfile );
- status( "NOT a SPY config file (or old version)!" );
- return;
- }
- if( read( (UBYTE *)selectedfun, sizeof(selectedfun) ) )
- goto loaderr;
- if( read( (UBYTE *)&boolbuff, 2 ) )
- goto loaderr;
- if( boolbuff )
- itemactivated.Flags|=CHECKED;
- else
- itemactivated.Flags&= ~CHECKED;
- if( read( (UBYTE *)&boolbuff, 2 ) )
- goto loaderr;
- if( boolbuff )
- itemprinter.Flags|=CHECKED;
- else
- itemprinter.Flags&= ~CHECKED;
- if( readitem( &itemverbose ) )
- goto loaderr;
- if( readitem( &itemeverytime ) )
- goto loaderr;
- if( readitem( &itemwaitforgo ) )
- goto loaderr;
- if( readitem( &itemflashon ) )
- goto loaderr;
- if( read( (UBYTE *)&windowdata, 4*2 ) )
- goto loaderr;
- Close( configfile );
- if( !window )
- return;
- status( "Waiting for modifying window" );
- loading=TRUE;
- tmconfig.tr_time.tv_micro=CONFIGDELAY;
- SendIO( IO &tmconfig );
- setvect( TUTTIV );
- return;
-
- loaderr:
- Close( configfile );
- status( "Error while loading config file!" );
- return;
- }
-
- /***** Legge lo stato di un item dal config file *****/
- BOOL readitem( struct MenuItem *item )
- {
- BOOL buff;
-
- if( read( (UBYTE *)&buff, 2 ) )
- return( TRUE );
- if( buff )
- {
- item->Flags|=CHECKED;
- (item->NextItem)->Flags&= ~CHECKED;
- }
- else
- {
- item->Flags&= ~CHECKED;
- (item->NextItem)->Flags|=CHECKED;
- }
- return( FALSE );
- }
-
- /***** Versione sintetica di Read *****/
- BOOL read( UBYTE *data, COUNT len )
- {
- return( (BOOL)((Read( configfile, data, len )==len) ? FALSE : TRUE) );
- }
-
-
- /***** Input del nome del file di configurazione *****/
- BOOL getconfigname( UBYTE *saveorload )
- {
- struct Window *cwindow;
- struct RastPort *crp;
- USHORT gid;
- COUNT i;
-
- if( quitting )
- return( 1 );
-
- if( (cwindow=OpenWindow( &cwindowdata ))==NULL )
- {
- status( "Can't open CONFIGURATION window!" );
- return( 1 );
- }
-
- crp=cwindow->RPort;
- SetAPen( crp, 2 );
- RectFill( crp, 0, 10, CWINDW-1, CWINDH-1 );
- SetAPen( crp, 3 );
- RectFill( crp, 4, 12, CWINDW-4-1, CWINDH-2-1 );
- SetAPen( crp, 2 );
- RectFill( crp, 6, 13, CWINDW-6-1, CWINDH-3-1 );
- for( i=0; i<CWWALLNUM; i++ )
- DrawImage( crp, &wallImage, CWALLL+WALLW*i, CWALLT );
- cwindowokgadgettext.IText=saveorload;
- strcpy( gconfigname, configname );
- AddGList( cwindow, &cwindowgadget, 0, -1, NULL );
- RefreshGList( &cwindowgadget, cwindow, NULL, -1 );
-
- ActivateGadget( &cwindowgadget, cwindow, NULL );
-
- FOREVER
- {
- WaitPort( cwindow->UserPort );
- msg=(struct IntuiMessage *)GetMsg( cwindow->UserPort );
- gid=((struct Gadget *)msg->IAddress)->GadgetID;
- ReplyMsg( (struct Message *)msg );
- if( gid==COKID )
- {
- CloseWindow( cwindow );
- strcpy( configname, gconfigname );
- return( NULL );
- }
- else
- {
- CloseWindow( cwindow );
- return( 1 );
- }
- }
- }
-
-
-
- /***** Entra in SPY *****/
- void goin( void )
- {
- Forbid();
- ++executing;
- Permit();
- }
-
- /***** Esce da SPY *****/
- void goout( void )
- {
- Forbid();
- --executing;
- Permit();
- }
-
-
- /***** Controlla se si deve fare l'output delle informazioni *****/
- BOOL canoutput( void )
- {
- struct Task *task;
-
- task=FindTask( NULL );
- if( task==spytask ||
- !ACTIVATED ||
- (notrapprt && strcmp( task->tc_Node.ln_Name, "PRT" )==NULL) ||
- (LONG)task->tc_SPUpper-(LONG)task->tc_SPLower<MINSTACK)
- return( FALSE );
- else
- return( TRUE );
- }
-
-
- /***** Prende possesso della window, eventualmente aspetta, esce in Forbid *****/
- void ownwindow( void )
- {
- struct timerequest *tr;
- struct MsgPort *myport;
- LONG odret;
-
- FOREVER
- {
- Forbid();
- if( windowinuse==FALSE )
- {
- windowinuse=TRUE;
- break;
- }
- Permit(); /* Adesso attendiamo un po` */
- tr=NULL;
- myport=NULL;
- if( (tr=AllocMem( sizeof(struct timerequest), MEMF_CLEAR | MEMF_PUBLIC ))==NULL )
- status( "***NO MEMORY FOR TIMEREQUEST" );
- else
- {
- tr->tr_node.io_Command=TR_ADDREQUEST;
- tr->tr_time.tv_micro=OWNWINDOWDELAY;
- myport=CreatePort( NULL, 0 );
- if( myport==NULL )
- status( "***CANNOT CREATE PORT" );
- else
- {
- tr->tr_node.io_Message.mn_ReplyPort=myport;
- fresetvect( OPENDEVICEV );
- odret=OpenDevice( TIMERNAME, UNIT_VBLANK, IO tr, NULL );
- fsetvect( OPENDEVICEV );
- if( odret!=NULL )
- status( "***CANNOT OPEN TIMER" );
- else
- {
- SendIO( IO tr );
- WaitPort( myport );
- fresetvect( CLOSEDEVICEV );
- CloseDevice( IO tr );
- fsetvect( CLOSEDEVICEV );
- }
- DeletePort( myport );
- }
- FreeMem( tr, sizeof(struct timerequest) );
- }
- }
- /* Adesso e` in Forbid */
- }
-
-
- /***** Prende possesso della finestra, disabilita multitasking, *****/
- /***** ed inizia l'output delle informazioni *****/
- void initout( UBYTE *funname )
- {
- ownwindow();
- /* Da qui e` in forbid */
- cannotwait=FALSE;
- if( strcmp(FindTask( NULL )->tc_Node.ln_Name, "input.device")==NULL )
- cannotwait=TRUE;
- if( VERBOSE )
- {
- newline();
- littlenewline();
- Move( rp, 0, window->GZZHeight-7 );
- Draw( rp, window->GZZWidth, window->GZZHeight-7 );
- Move( rp, 0, window->GZZHeight-4 );
- Draw( rp, window->GZZWidth, window->GZZHeight-4 );
- Move( rp, 25, window->GZZHeight-3 );
- SetDrMd( rp, INVERSVID | JAM2 );
- printerprint( prtfunnameon );
- prints( " " );
- prints( funname );
- prints( " " );
- SetDrMd( rp, JAM1 );
- printerprint( prtfunnameoff );
- newline();
- prints( "TaskName: " );
- prints( FindTask( NULL )->tc_Node.ln_Name );
- newline();
- }
- else
- {
- newline();
- prints( funname );
- prints( ": " );
- }
- }
-
-
- /***** Ripristina multitasking, se necessario aspetta il GO *****/
- /***** e infine rilascia la finestra *****/
- void endout( void )
- {
- Permit();
-
- if( WAITGO )
- {
- if( cannotwait )
- {
- status( "Cannot wait for GO" );
- }
- else
- {
- if( (goport.mp_SigBit=AllocSignal(-1))==-1 )
- status( "Cannot wait for GO (no free signal)" );
- else
- {
- goport.mp_SigTask=FindTask( NULL );
- PutMsg( window->UserPort, &gomsg );
- WaitPort( &goport );
- if( GetMsg( &goport )!=&gomsg )
- fine( "INTERNAL ERROR #3" );
- FreeSignal( goport.mp_SigBit );
- }
- }
- }
-
- windowinuse=FALSE; /* Rilascia la finestra */
- }
-
-
- /***** Scrive un messaggio di SPY nella finestra, senza interferenze *****/
- void status( UBYTE *text )
- {
- if( window ) /* Finestra gia` aperta */
- {
- Forbid();
- littlenewline();
- newline();
- prints( "<" );
- prints( text );
- prints( ">" );
- littlenewline();
- Permit();
- }
- else
- fine( text );
- }
-
-
- /***** Restituisce l'indirizzo di un vettore *****/
- struct vect *vectadd( WORD v )
- {
- if( v<DOSVECTNUM )
- return( ((struct vect *)(((UBYTE *)DOSBase)-vectoffset[v])) );
- else
- return( ((struct vect *)(((UBYTE *)SysBase)-vectoffset[v])) );
- }
-
-
- /***** Registra i veri indirizzi *****/
- void getoldvect( void )
- {
- COUNT i;
-
- newvect[ OPENV ].vect2=(ULONG)newopen;
- newvect[ CLOSEV ].vect2=(ULONG)newclose;
- newvect[ READV ].vect2=(ULONG)newread;
- newvect[ WRITEV ].vect2=(ULONG)newwrite;
- newvect[ INPUTV ].vect2=(ULONG)newinput;
- newvect[ OUTPUTV ].vect2=(ULONG)newoutput;
- newvect[ LOCKV ].vect2=(ULONG)newlock;
- newvect[ UNLOCKV ].vect2=(ULONG)newunlock;
- newvect[ DUPLOCKV ].vect2=(ULONG)newduplock;
- newvect[ EXAMINEV ].vect2=(ULONG)newexamine;
- newvect[ EXNEXTV ].vect2=(ULONG)newexnext;
- newvect[ INFOV ].vect2=(ULONG)newinfo;
- newvect[ DELETEFILEV ].vect2=(ULONG)newdeletefile;
- newvect[ RENAMEV ].vect2=(ULONG)newrename;
- newvect[ CREATEDIRV ].vect2=(ULONG)newcreatedir;
- newvect[ CURRENTDIRV ].vect2=(ULONG)newcurrentdir;
- newvect[ PARENTDIRV ].vect2=(ULONG)newparentdir;
- newvect[ SEEKV ].vect2=(ULONG)newseek;
- newvect[ EXECUTEV ].vect2=(ULONG)newexecute;
- newvect[ LOADSEGV ].vect2=(ULONG)newloadseg;
- newvect[ UNLOADSEGV ].vect2=(ULONG)newunloadseg;
- newvect[ CREATEPROCV ].vect2=(ULONG)newcreateproc;
- newvect[ EXITV ].vect2=(ULONG)newexit;
- newvect[ IOERRV ].vect2=(ULONG)newioerr;
- /* Funzioni EXEC */
- newvect[ ALLOCMEMV ].vect2=(ULONG)newallocmem;
- newvect[ OPENDEVICEV ].vect2=(ULONG)newopendevice;
- newvect[ CLOSEDEVICEV ].vect2=(ULONG)newclosedevice;
- newvect[ ADDDEVICEV ].vect2=(ULONG)newadddevice;
- newvect[ OPENLIBRARYV ].vect2=(ULONG)newopenlibrary;
- newvect[ OLDOPENLIBRARYV ].vect2=(ULONG)newoldopenlibrary;
- newvect[ CLOSELIBRARYV ].vect2=(ULONG)newcloselibrary;
- newvect[ ADDLIBRARYV ].vect2=(ULONG)newaddlibrary;
- newvect[ OPENRESOURCEV ].vect2=(ULONG)newopenresource;
- newvect[ ADDRESOURCEV ].vect2=(ULONG)newaddresource;
- newvect[ FINDPORTV ].vect2=(ULONG)newfindport;
- newvect[ ADDPORTV ].vect2=(ULONG)newaddport;
- newvect[ FINDSEMAPHOREV ].vect2=(ULONG)newfindsemaphore;
- newvect[ ADDSEMAPHOREV ].vect2=(ULONG)newaddsemaphore;
- newvect[ FINDNAMEV ].vect2=(ULONG)newfindname;
-
- for( i=0; i<VECTNUM-NOTIMPVECTNUM; i++ )
- oldvect[i]=*vectadd(i);
- gotvect=TRUE;
- }
-
- /***** Setta le nuove routines, se si devono settare *****/
- void setvect( WORD v )
- {
- COUNT i;
-
- if( !quitting )
- {
- if( v==TUTTIV )
- {
- for( i=0; i<VECTNUM-NOTIMPVECTNUM; i++ )
- *vectadd(i)= selectedfun[i] ? newvect[i] : oldvect[i];
- }
- else
- *vectadd(v)= selectedfun[v] ? newvect[v] : oldvect[v];
-
- /* ((struct Library *)DOSBase)->lib_Flags|=LIBF_CHANGED; */
- /* ((struct Library *)SysBase)->lib_Flags|=LIBF_CHANGED; */
- /* SumLibrary( (struct Library *)DOSBase ); */
- /* SumLibrary( (struct Library *)SysBase ); */
- }
- }
-
- /***** Resetta le vecchie routines *****/
- void resetvect( WORD v )
- {
- COUNT i;
-
- if( v==TUTTIV )
- {
- for( i=0; i<VECTNUM-NOTIMPVECTNUM; i++ )
- *vectadd(i)=oldvect[i];
- }
- else
- *vectadd(v)=oldvect[v];
-
- /* ((struct Library *)DOSBase)->lib_Flags|=LIBF_CHANGED; */
- /* ((struct Library *)SysBase)->lib_Flags|=LIBF_CHANGED; */
- /* SumLibrary( (struct Library *)DOSBase ); */
- /* SumLibrary( (struct Library *)SysBase ); */
- }
-
-
- /***** Setta le nuove routines, se si devono settare, e va in Forbid *****/
- void fsetvect( WORD v )
- {
- Forbid();
- setvect( v );
- }
-
-
- /***** Resetta le vecchie routines, ed esce dal Forbid *****/
- void fresetvect( WORD v )
- {
- resetvect( v );
- Permit();
- }
-
-
- /***** Inizio routines di scrittura *****/
-
- /***** Scrolla la finestra di un rigo *****/
- void newline( void )
- {
- ScrollRaster( rp, 0, 9, 0, 0, window->GZZWidth-1, window->GZZHeight-1 );
- Move( rp, 0, window->GZZHeight-3 );
- printerprint( "\n" );
- }
-
-
- /***** Scrolla la finestra di mezzo rigo *****/
- void littlenewline( void )
- {
- ScrollRaster( rp, 0, 3, 0, 0, window->GZZWidth-1, window->GZZHeight-1 );
- Move( rp, 0, window->GZZHeight-3 );
- printerprint( "\n" );
- }
-
-
- /***** Scrive una stringa *****/
- void prints( UBYTE *testo )
- {
- if( !testo )
- prints( "*NULL*" );
- else
- {
- Text( rp, testo, MIN( strlen(testo), TEXTLEN ) );
- printerprint( testo );
- }
- }
-
-
- /***** Scrive un nome in HighLight *****/
- void printname( UBYTE *name )
- {
- if( name )
- {
- SetAPen( rp, 1 );
- printerprint( prtnameon );
- prints( name );
- SetAPen( rp, 3 );
- printerprint( prtnameoff );
- }
- else
- prints( "NULL" );
- }
-
-
- /***** Scrive il contenuto di un buffer come stringa ASCII, solo schermo *****/
- void printbuffer( UBYTE *buffer, LONG len )
- {
- printh( (ULONG)buffer );
- Text( rp, " (", 3 );
- Text( rp, buffer, MIN(len, BUFFERLEN) );
- Text( rp, ")", 1 );
- }
-
-
- /***** Scrive un nome in HighLight tra parenteri *****/
- void printpname( UBYTE *name )
- {
- prints( " (" );
- printname( name );
- prints( ")" );
- }
-
-
- /***** Chiede a SPY di scrivere un lock *****/
- /***** Non posso scriverlo io perche` si modifica IoErr() *****/
- void printlock( BPTR lock )
- {
- if( (lockport.mp_SigBit=AllocSignal(-1))==-1 )
- prints( "Cannot print lock (no free signal)" );
- else
- {
- lockport.mp_SigTask=FindTask( NULL );
- lockmsg.data=(ULONG)lock;
- PutMsg( window->UserPort, (struct Message *)&lockmsg );
- WaitPort( &lockport );
- if( GetMsg( &lockport )!=(struct Message *)&lockmsg )
- fine( "INTERNAL ERROR #4" );
- FreeSignal( lockport.mp_SigBit );
- }
- }
-
-
-
- /***** Scrive un lock, indirizzo e nome *****/
- void spyprintlock( BPTR lock )
- {
- BPTR plock;
-
- printh( (ULONG)lock );
-
- /* if( !lock ) */
- /* { */
- /* prints( " (Root)" ); */
- /* return; */
- /* } */
-
- lockname[0]='\0';
- lock=DupLock( lock );
- do
- {
- if( Examine( lock, lockfib )==DOSFALSE )
- break;
- plock=ParentDir( lock );
- UnLock( lock );
- lock=plock;
- if( lockfib->fib_DirEntryType>0 )
- locknameadd( plock ? "/" : ":" );
- locknameadd( lockfib->fib_FileName );
- }while( lock );
- printpname( lockname );
- }
- /***** Aggiunge una stringa all'inizio di lockname, max LOCKNAMELEN *****/
- void locknameadd( UBYTE *add )
- {
- strncpy( locknametmp, add, LOCKNAMELEN );
- strncat( locknametmp, lockname, LOCKNAMELEN );
- strcpy( lockname, locknametmp );
- }
-
-
- /***** Scrive un FileHandle, eventualmente anche il nome *****/
- void printfh( BPTR fh )
- {
- struct fhnode *fhn;
-
- printh( (ULONG)fh );
- fhn=findfh( fh );
- if( fhn )
- printpname( fhn->name );
- }
-
-
- /***** Scrive un numero in decimale *****/
- void printd( LONG numero )
- {
- BYTE buff[12];
-
- stci_d( buff, numero );
- prints( buff );
- }
-
-
- /***** Scrive un numero decimale fra parentesi *****/
- void printpd( LONG numero )
- {
- prints( " (" );
- printd( numero );
- prints( ")" );
- }
-
-
- /***** Scrive un numero in esadecimale *****/
- void printh( ULONG numero )
- {
- BYTE buff[12]="$";
-
- if( numero==0 )
- prints( "NULL" );
- else if( numero==-1 )
- prints( "-1" );
- else
- {
- stci_h( &buff[1], numero );
- prints( buff );
- }
- }
-
-
- /***** Manda del testo alla stampante *****/
- /***** Dobbiamo chiedere a SPY di farlo *****/
- void printerprint( UBYTE *text )
- {
- if( printerfh && !noprint )
- {
- noprint=TRUE;
- if( FindTask( NULL )==spytask )
- spyprinterprint( text );
- else if( (prtport.mp_SigBit=AllocSignal(-1))==-1 )
- {
- prints( "Cannot print (no free signal)" );
- }
- else
- {
- prtport.mp_SigTask=FindTask( NULL );
- prtmsg.data=(ULONG)text;
- PutMsg( window->UserPort, (struct Message *)&prtmsg );
- WaitPort( &prtport );
- if( GetMsg( &prtport )!=(struct Message *)&prtmsg )
- fine( "INTERNAL ERROR #5" );
- FreeSignal( prtport.mp_SigBit );
- }
- noprint=FALSE;
- }
- }
-
- /***** Stampa del testo *****/
- void spyprinterprint( UBYTE *text )
- {
- LONG len;
-
- len=MIN( strlen(text), 80 );
- if( Write( printerfh, text, len )!=len )
- {
- status( "Problems with the printer" );
- }
- }
-
-
- /***** Accende o spegne la stampante *****/
- void setprinter( void )
- {
- LONG oldpri;
-
- if( PRINTER )
- {
- status( "Printer is ON" );
- status( "Be SURE your printer is really ON!" );
- if( !printerfh )
- {
- notrapprt=TRUE;
- printerfh=Open( "PRT:", MODE_OLDFILE );
- notrapprt=FALSE;
- if( printerfh==NULL )
- status( "Cannot open the printer!" );
- }
- }
- else
- {
- if( printerfh )
- {
- notrapprt=TRUE;
- oldpri=SetTaskPri( FindTask(NULL), -10 ); /* Attende che si chiuda la stampante */
- Close( printerfh );
- SetTaskPri( FindTask(NULL), oldpri );
- notrapprt=FALSE;
- }
- printerfh=NULL;
- status( "Printer is OFF" );
- }
- }
-
-
- /***** Funzioni di gestione della lista nomi dei FileHandle *****/
-
- /***** Aggiunge un FH *****/
- void addfh( BPTR fh, UBYTE *name )
- {
- struct fhnode *fhn;
-
- fhn=AllocMem( sizeof(struct fhnode), MEMF_PUBLIC );
- if( !fhn )
- {
- status( "Cannot memorize the FileHandle name" );
- return;
- }
- fhn->fh=fh;
- strncpy( fhn->name, name, FHNAMELEN );
- AddHead( (struct List *)&fhlist, (struct Node *)fhn );
- }
-
- /***** Cancella un FH *****/
- void remfh( BPTR fh )
- {
- struct fhnode *fhn;
-
- fhn=findfh( fh );
- if( !fhn )
- return; /* Non esiste */
- Remove( (struct Node *)fhn );
- FreeMem( fhn, sizeof(struct fhnode) );
- }
-
- /***** Cerca un FH *****/
- struct fhnode *findfh( BPTR fh )
- {
- struct fhnode *fhn;
-
- ALLFHLIST
- {
- if( fhn->fh==fh )
- return( fhn );
- }
- return( NULL );
- }
-
- /***** Cancella tutta la lista dei FH *****/
- void clearfh( void )
- {
- struct fhnode *fhn;
-
- while( fhn=(struct fhnode *)RemHead((struct List *)&fhlist) )
- FreeMem( fhn, sizeof(struct fhnode) );
- }
-
-
-
- /***** Apre e gestisce la finestra per attivare/disattivare le nuove funzioni *****/
- void functions( void )
- {
- struct Window *fwindow;
- struct RastPort *frp;
- USHORT gid;
- struct Gadget *g;
- COUNT i;
-
- if( quitting )
- return;
-
- setfgadget();
-
- if( (fwindow=OpenWindow( &fwindowdata ))==NULL )
- {
- status( "Can't open FUNCTIONS window!" );
- return;
- }
- frp=fwindow->RPort;
- SetAPen( frp, 2 );
- RectFill( frp, 0, 10, FWINDW-1, FWINDH-1 );
- SetAPen( frp, 3 );
- RectFill( frp, 4, 12, FWINDW-4-1, FWINDH-2-1 );
- SetAPen( frp, 2 );
- RectFill( frp, 6, 13, FWINDW-6-1, FWINDH-3-1 );
- for( i=0; i<FWWALLNUM; i++ )
- DrawImage( frp, &wallImage, FWALLL+WALLW*i, FWALLT );
- PrintIText( frp, &ftext, 0, 0 );
- AddGList( fwindow, &fwindowgadget, 0, -1, NULL );
- RefreshGList( &fwindowgadget, fwindow, NULL, -1 );
-
- FOREVER
- {
- WaitPort( fwindow->UserPort );
- msg=(struct IntuiMessage *)GetMsg( fwindow->UserPort );
- gid=((struct Gadget *)msg->IAddress)->GadgetID;
- ReplyMsg( (struct Message *)msg );
- if( gid==FOKID )
- {
- for( i=0, g=&fgadget; i<GADGNUM && g; i++, g=g->NextGadget )
- selectedfun[i]= g->Flags & SELECTED ? TRUE : FALSE;
- setvect( TUTTIV );
- break;
- }
- else if( gid==FCANCELID )
- break;
- else if( gid==FRESTOREID )
- setfgadget();
- else
- {
- for( i=0, g=&fgadget; i<GADGNUM && g; i++, g=g->NextGadget )
- if( gid==FALLID )
- g->Flags|=SELECTED;
- else
- g->Flags&=~SELECTED;
- gadgetfindname.Flags&=~SELECTED;
- }
- RefreshGList( &fgadget, fwindow, NULL, -1 );
- }
- CloseWindow( fwindow );
- }
-
- /***** Setta i gadget della fwindow *****/
- void setfgadget( void )
- {
- COUNT i;
- struct Gadget *g;
-
- for( i=0, g=&fgadget; i<GADGNUM && g; i++, g=g->NextGadget )
- if( selectedfun[i] )
- g->Flags|=SELECTED;
- else
- g->Flags&=~SELECTED;
- }
-
-
- /***** Apri: la mia porta, screen, window, e i due timer *****/
- void openall( void )
- {
- if( FindPort( goport.mp_Node.ln_Name ) )
- fine( "SPY is already installed" );
- AddPort( &goport );
- spytask=FindTask( NULL );
- if( (lockfib=AllocMem( sizeof(struct FileInfoBlock), MEMF_PUBLIC ))==NULL )
- fine( "No memory for lockfib" );
- if( (IntuitionBase=(struct IntuitionBase *)OpenLibrary( "intuition.library", LIBVER ))==NULL )
- fine( "Intution.library not found" );
- if( (GfxBase=(struct GfxBase *)OpenLibrary( "graphics.library", LIBVER ))==NULL )
- fine( "Graphics.library not found" );
-
- if( OpenDevice( TIMERNAME, UNIT_VBLANK, IO &tmflash, NULL )!=NULL )
- fine( notimer );
- if( OpenDevice( TIMERNAME, UNIT_VBLANK, IO &tmquit, NULL )!=NULL )
- fine( notimer );
- if( OpenDevice( TIMERNAME, UNIT_VBLANK, IO &tmconfig, NULL )!=NULL )
- fine( notimer );
-
- openwindow();
-
- fwindowdata.LeftEdge=(window->WScreen->Width-FWINDW)/2;
- fwindowdata.TopEdge=(window->WScreen->Height-FWINDH)/2;
- cwindowdata.LeftEdge=(window->WScreen->Width-CWINDW)/2;
- cwindowdata.TopEdge=(window->WScreen->Height-CWINDH)/2;
- }
-
- /***** Apre la finestra principale *****/
- void openwindow( void )
- {
- LONG logox, logoy;
-
- if( (window=(struct Window *)OpenWindow( &windowdata ))==NULL )
- fine( "Cannot open window" );
- rp=window->RPort;
- SetBPen( rp, 2 );
- SetRast( rp, 2 );
- SetMenuStrip( window, &menu0 );
- logox=(IWINDW-ALLLOGOW)/2;
- logoy=MAX( (IWINDH-ALLLOGOH)/2+10, 0 );
- DrawImage( rp, &logoImage, logox, logoy );
- PrintIText( rp, &logotext, logox, logoy );
-
- tmflash.tr_node.io_Message.mn_ReplyPort=window->UserPort;
- tmquit.tr_node.io_Message.mn_ReplyPort=window->UserPort;
- tmconfig.tr_node.io_Message.mn_ReplyPort=window->UserPort;
- }
-
-
- /***** Chiudi tutto e muori *****/
- void fine( UBYTE *text )
- {
- if( text && gotvect ) /* Se non c'e` errore non e` necessario */
- resetvect( TUTTIV );
-
- clearfh();
- if( printerfh ) Close( printerfh );
- if( tmflash.tr_node.io_Device ) CloseDevice( IO &tmflash );
- if( tmquit.tr_node.io_Device ) CloseDevice( IO &tmquit );
- if( tmconfig.tr_node.io_Device ) CloseDevice( IO &tmconfig );
- if( window )
- {
- ClearMenuStrip( window );
- CloseWindow( window );
- }
- if( GfxBase ) CloseLibrary( (struct Library *)GfxBase );
- if( IntuitionBase ) CloseLibrary( (struct Library *)IntuitionBase );
- if( goport.mp_Node.ln_Succ ) RemPort( &goport );
- if( lockfib ) FreeMem( lockfib, sizeof(struct FileInfoBlock) );
-
- if( text && _Backstdout )
- {
- if( text==FINEHELP )
- Write( _Backstdout, helptext, strlen(helptext) );
- else
- {
- strcat( errtext, text );
- strcat( errtext, "!\n\n" );
- Write( _Backstdout, errtext, strlen(errtext) );
- }
- }
-
- exit( NULL );
- }
-
-