home *** CD-ROM | disk | FTP | other *** search
Wrap
; $VER: UseFD2Pragma 1.0 (20.11.1999) (Freeware) by Dirk Stöcker <stoecker@amigaworld.com> RequestChoice "Select the language you want to make files for" "1: C (pragmas, protos, stubs, linker libs)*n2: Pascal (stubs, linker libs, units)*n3: Assembler (lvo files)*n4: Basic (BMAP files)*n*n5: FD files" 1 2 3 4 5 >ENV:UseFDA1 IF $UseFDA1 EQ 0 ;**** FD file **** RequestFile TITLE "Select the pragma input file" >ENV:UseFDInFile RequestFile TITLE "Select the output drawer (or file)" >ENV:UseFDOutFile FD2Pragma SPECIAL 200 INFILE $UseFDInFile TO $UseFDOutFile Skip CleanUp EndIF IF $UseFDA1 EQ 1 ;**** C **** RequestChoice "Select the file type" "1: pragma files*n2: stubs, link library*n3: local libbase stubs*n4: protos*n5: GCC stuff*n6: PPC stuff (GCC, SAS-C, proto)*n7: VBCC stuff (68K, WOS, PPC)" 1 2 3 4 5 6 7 >ENV:UseFDA2 IF $UseFDA2 EQ 1 Set UseFDMode 1 RequestChoice "Select the pragma type" "1: Aztec*n2: DICE*n3: SAS*n4: MAXON*n5: STORM*n6: all [default]*n7: all + GCC redirect*n8: GCC redirect" 1 2 3 4 5 6 7 8 >ENV:UseFDA3 IF $UseFDA3 EQ 1 Set UseFDSPECIAL 1 EndIF IF $UseFDA3 EQ 2 Set UseFDSPECIAL 2 EndIF IF $UseFDA3 EQ 3 Set UseFDSPECIAL 3 EndIF IF $UseFDA3 EQ 4 Set UseFDSPECIAL 4 EndIF IF $UseFDA3 EQ 5 Set UseFDSPECIAL 5 EndIF IF $UseFDA3 EQ 6 Set UseFDSPECIAL 6 EndIF IF $UseFDA3 EQ 7 Set UseFDSPECIAL 7 EndIF IF $UseFDA3 EQ 0 Set UseFDSPECIAL 8 Set UseFDMode 0 EndIF EndIF If $UseFDA2 EQ 2 Set UseFDMode 2 RequestChoice "Select the stub type" "1: C text*n2: assembler text*n3: link library" 1 2 3 >ENV:UseFDA3 IF $UseFDA3 EQ 1 Set UseFDSPECIAL 10 Set UseFDMode 0 EndIF IF $UseFDA3 EQ 2 Set UseFDSPECIAL 11 EndIF IF $UseFDA3 EQ 0 Set UseFDSPECIAL 12 EndIF EndIF If $UseFDA2 EQ 3 Set UseFDMode 2 RequestChoice "Select the type" "1: register call*n2: stack call" 1 2 >ENV:UseFDA3 IF $UseFDA3 EQ 1 Set UseFDSPECIAL 13 EndIF IF $UseFDA3 EQ 0 Set UseFDSPECIAL 14 EndIF EndIF If $UseFDA2 EQ 4 RequestChoice "Select the proto type" "1: with pragma/..._lib.h call*n2: with pragma/..._pragmas.h call*n3: with pragmas/..._lib.h call*n4: with pragmas/..._pragmas.h call*n5: with local/..._loc.h call*n6: all compilers*n7: GNU-C compiler only*n8: without lib definition" 1 2 3 4 5 6 7 >ENV:UseFDA3 IF $UseFDA3 EQ 1 Set UseFDSPECIAL 30 EndIF IF $UseFDA3 EQ 2 Set UseFDSPECIAL 31 EndIF IF $UseFDA3 EQ 3 Set UseFDSPECIAL 32 EndIF IF $UseFDA3 EQ 4 Set UseFDSPECIAL 33 EndIF IF $UseFDA3 EQ 5 Set UseFDSPECIAL 34 EndIF IF $UseFDA3 EQ 6 Set UseFDSPECIAL 35 EndIF IF $UseFDA3 EQ 7 Set UseFDSPECIAL 36 EndIF IF $UseFDA3 EQ 0 Set UseFDSPECIAL 37 EndIF EndIF If $UseFDA2 EQ 5 Set UseFDMode 2 RequestChoice "Select inline file type" "1: new*n2: old*n3: lib stubs" 1 2 3 >ENV:UseFDA3 IF $UseFDA3 EQ 1 Set UseFDSPECIAL 40 EndIF IF $UseFDA3 EQ 2 Set UseFDSPECIAL 41 EndIF IF $UseFDA3 EQ 0 Set UseFDSPECIAL 42 EndIF EndIF If $UseFDA2 EQ 6 Set UseFDMode 2 RequestChoice "Select PPC file type" "1: new inlines*n2: old inlines*n3: lib stub inlines*n4: SAS-C PPC file*n5: PPC proto file" 1 2 3 4 5 >ENV:UseFDA3 IF $UseFDA3 EQ 1 Set UseFDSPECIAL 50 EndIF IF $UseFDA3 EQ 2 Set UseFDSPECIAL 51 EndIF IF $UseFDA3 EQ 3 Set UseFDSPECIAL 52 EndIF IF $UseFDA3 EQ 4 Set UseFDSPECIAL 53 EndIF IF $UseFDA3 EQ 0 Set UseFDSPECIAL 42 Set UseFDMode 0 EndIF EndIF If $UseFDA2 EQ 0 Set UseFDMode 2 RequestChoice "Select file type" "1: 68K inlines*n2: WOS stubs (ASM)*n3: WOS stubs (ASM, libbase)*n4: WOS stubs (link)*n5: WOS stubs (link, libbase)*n6: PPC stubs (ASM)*n7: PPC stubs(link)" 1 2 3 4 5 6 7 >ENV:UseFDA3 IF $UseFDA3 EQ 1 Set UseFDSPECIAL 70 Set UseFDMode 0 EndIF IF $UseFDA3 EQ 2 Set UseFDSPECIAL 71 EndIF IF $UseFDA3 EQ 3 Set UseFDSPECIAL 72 EndIF IF $UseFDA3 EQ 4 Set UseFDSPECIAL 73 EndIF IF $UseFDA3 EQ 5 Set UseFDSPECIAL 74 EndIF IF $UseFDA3 EQ 6 Set UseFDSPECIAL 75 EndIF IF $UseFDA3 EQ 0 Set UseFDSPECIAL 76 EndIF EndIF EndIF IF $UseFDA1 EQ 2 ;**** Pascal **** RequestChoice "Select the file type" "1: stub-functions - assembler text*n2: stub-functions - link library*n3: FPC unit text" 1 2 3 >ENV:UseFDA2 IF $UseFDA2 EQ 1 Set UseFDSPECIAL 15 ; stub-functions for Pascal - assembler text EndIF IF $UseFDA2 EQ 2 Set UseFDSPECIAL 16 ; stub-functions for Pascal - link library EndIF IF $UseFDA2 EQ 0 Set UseFDSPECIAL 60 ; FPC pascal unit text EndIF Set UseFDNeedCLIB 1 EndIF IF $UseFDA1 EQ 3 ;**** Assembler **** RequestChoice "Select the file type" "1: lvo _lvo.i file*n2: lvo _lib.i file*n3: lvo _lvo.i file no XDEF*n4: lvo _lib.i file no XDEF*n5: link library" 1 2 3 4 5 >ENV:UseFDA2 IF $UseFDA2 EQ 1 Set UseFDSPECIAL 20 ; assembler lvo _lvo.i file EndIF IF $UseFDA2 EQ 2 Set UseFDSPECIAL 21 ; assembler lvo _lib.i file EndIF IF $UseFDA2 EQ 3 Set UseFDSPECIAL 22 ; assembler lvo _lvo.i file no XDEF EndIF IF $UseFDA2 EQ 4 Set UseFDSPECIAL 23 ; assembler lvo _lib.i file no XDEF EndIF IF $UseFDA2 EQ 0 Set UseFDSPECIAL 24 ; assembler lvo link library EndIF Set UseFDNeedCLIB 0 EndIF IF $UseFDA1 EQ 4 ;**** Basic **** Set UseFDSPECIAL 17 ; BMAP file for AmigaBASIC and MaxonBASIC Set UseFDNeedCLIB 0 EndIF ; **** scan options here **** Set UseFDCOMMENT "" Set UseFDEXTERNC "" Set UseFDFPUONLY "" Set UseFDNEWSYNTAX "" Set UseFDNOFPU "" Set UseFDNOPPC "" Set UseFDNOSYMBOL "" Set UseFDOPT040 "" Set UseFDPPCONLY "" Set UseFDPRIVATE "" Set UseFDSECTION "" Set UseFDSMALLDATA "" Set UseFDSORTED "" Set UseFDSTORMFD "" Set UseFDUSESYSCALL "" Lab ScanOpts RequestChoice "Select Option" "See Dokumentation for Option description.*n*nThis request reappears, as long as you do not*nselect 'XX'*n 1=COMMENT 2=EXTERNC 3=FPUONLY*n 4=NEWSYNTAX 5=NOFPU 6=NOPPC*n 7=NOSYMBOL 8=OPT040 9=PPCONLY*n10=PRIVATE 11=SECTION 12=SMALLDATA*n13=SORTED 14=STORMFD 15=USESYSCALL" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 XX >ENV:UseFDOption IF $UseFDOption EQ 0 Skip EndScanOpts EndIf IF $UseFDOption EQ 1 Set UseFDCOMMENT COMMENT EndIf IF $UseFDOption EQ 2 Set UseFDEXTERNC EXTERNC EndIf IF $UseFDOption EQ 3 Set UseFDFPUONLY FPUONLY EndIf IF $UseFDOption EQ 4 Set UseFDNEWSYNTAX NEWSYNTAX EndIf IF $UseFDOption EQ 5 Set UseFDNOFPU NOFPU EndIf IF $UseFDOption EQ 6 Set UseFDNOPPC NOPPC EndIf IF $UseFDOption EQ 7 Set UseFDNOSYMBOL NOSYMBOL EndIf IF $UseFDOption EQ 8 Set UseFDOPT040 OPT040 EndIf IF $UseFDOption EQ 9 Set UseFDPPCONLY PPCONLY EndIf IF $UseFDOption EQ 10 Set UseFDPRIVATE PRIVATE EndIf IF $UseFDOption EQ 11 Set UseFDSECTION SECTION EndIf IF $UseFDOption EQ 12 Set UseFDSMALLDATA SMALLDATA EndIf IF $UseFDOption EQ 13 Set UseFDSORTED SORTED EndIf IF $UseFDOption EQ 14 Set UseFDSTORMFD STORMFD EndIf IF $UseFDOption EQ 15 Set UseFDUSESYSCALL USESYSCALL EndIf Skip ScanOpts BACK Lab EndScanOpts Set UseFDArgs "" $UseFDCOMMENT $UseFDEXTERNC $UseFDFPUONLY $UseFDNEWSYNTAX $UseFDNOFPU $UseFDNOPPC $UseFDNOSYMBOL $UseFDOPT040 $UseFDPPCONLY $UseFDPRIVATE $UseFDSECTION $UseFDSMALLDATA $UseFDSORTED $UseFDSTORMFD $UseFDUSESYSCALL RequestChoice "Do you want to insert a header?" "Select*nHEADERFILE to enter a file or*nSCANHEADER to scan the destionation file." HEADERFILE SCANHEADER NoHeader >ENV:UseFDHeader IF $UseFDHeader EQ 1 RequestFile TITLE "Select the header file" >ENV:UseFDHeaderFile Set UseFDArgs $UseFDArgs HEADER $UseFDHeaderFile EndIF IF $UseFDHeader EQ 2 Set UseFDArgs $UseFDArgs HEADER=@ EndIF IF $UseFDMode EQ 1 RequestChoice "Select definition mode" "1: _INCLUDE_PRAGMA_..._LIB_H [default]*n2: _PRAGMAS_..._LIB_H*n3: _PRAGMAS_..._PRAGMAS_H*n4: no definition" 1 2 3 4 >ENV:UseFDMode2 IF $UseFDMode2 EQ 1 Set UseFDArgs $UseFDArgs MODE 1 EndIF IF $UseFDMode2 EQ 2 Set UseFDArgs $UseFDArgs MODE 2 EndIF IF $UseFDMode2 EQ 3 Set UseFDArgs $UseFDArgs MODE 3 EndIF IF $UseFDMode2 EQ 0 Set UseFDArgs $UseFDArgs MODE 4 EndIF EndIF IF $UseFDMode EQ 2 RequestChoice "Select work mode" "1: all functions, normal interface*n2: only tag-functions, tagcall interface*n3: all functions, both interfaces [default]" 1 2 3 >ENV:UseFDMode2 IF $UseFDMode2 EQ 1 Set UseFDArgs $UseFDArgs MODE 1 EndIF IF $UseFDMode2 EQ 2 Set UseFDArgs $UseFDArgs MODE 2 EndIF IF $UseFDMode2 EQ 0 Set UseFDArgs $UseFDArgs MODE 3 EndIF EndIF RequestFile TITLE "Select the FD input file" >ENV:UseFDInFile IF $UseFDNeedCLIB EQ 1 RequestFile TITLE "Select the clib prototype file" >ENV:UseFDCLIB EndIF RequestFile TITLE "Select the output drawer (or file)" >ENV:UseFDOutFile IF $UseFDNeedCLIB EQ 1 Set UseFDArgs $UseFDArgs CLIB $UseFDCLIB EndIF Echo "Executing following command:" Echo "FD2Pragma SPECIAL" $UseFDSPECIAL "INFILE" $UseFDInFile "TO" $UseFDOutFile $UseFDArgs FD2Pragma SPECIAL $UseFDSPECIAL INFILE $UseFDInFile TO $UseFDOutFile $UseFDArgs Lab CleanUp Delete >NIL: ENV:UseFD#? Echo "All Done. You can close this window now."