; $VER: usefd2pragma 1.6 (04.06.2001) (Freeware) by Dirk Stöcker <stoecker@epost.de>
; ToDo: Lots of Options need to be disabled for types >10
Delete >NIL: ENV:UseFD#?
SetEnv UseFDOnCOMMENT " A"
SetEnv UseFDOnEXTERNC " B"
SetEnv UseFDOnFPUONLY " C"
SetEnv UseFDOnNEWSYNTAX " D"
SetEnv UseFDOnNOFPU " E"
SetEnv UseFDOnNOPPC " F"
SetEnv UseFDOnNOPPCREGNAME " G"
SetEnv UseFDOnNOSYMBOL " H"
SetEnv UseFDOnONLYCNAMES " I"
SetEnv UseFDOnOPT040 " J"
SetEnv UseFDOnPPCONLY " K"
SetEnv UseFDOnPRIVATE " L"
SetEnv UseFDOnSECTION " M"
SetEnv UseFDOnSMALLCODE " N"
SetEnv UseFDOnSMALLDATA " O"
SetEnv UseFDOnSORTED " P"
SetEnv UseFDOnSYSTEMRELEASE " Q"
SetEnv UseFDOnUSESYSCALL " R"
RequestChoice "Select the language you want to make files for" "NOTE: This script may take several seconds from one to next step!*n*n1: C (pragmas, protos, stubs, linker libs)*n2: Pascal (stubs, linker libs, units)*n3: Assembler (lvo files)*n4: PPC Assembler (lvo files)*n5: Basic (BMAP files)*n6: E (Module)*n7: FD/SFD/Clib files*n*n8: FD files (from Pragma)" 1 2 3 4 5 6 7 8 >ENV:UseFDA1
IF $UseFDA1 EQ 0 ;**** FD file ****
RequestFile TITLE "Select the pragma input file" >ENV:UseFDInFile
RequestFile DRAWERSONLY TITLE "Select the output drawer" >ENV:UseFDOutDrawer
Echo "Executing following command:"
Echo "fd2pragma SPECIAL 200 INFILE" $UseFDInFile "TO" $UseFDOutDrawer
fd2pragma SPECIAL 200 INFILE $UseFDInFile TO $UseFDOutDrawer
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*n9: with VBCC inline call*n10: with PPC specials" 1 2 3 4 5 6 7 8 9 10 >ENV:UseFDA3
IF $UseFDA3 EQ 1
SetEnv UseFDSPECIAL 30
EndIF
IF $UseFDA3 EQ 2
SetEnv UseFDSPECIAL 31
EndIF
IF $UseFDA3 EQ 3
SetEnv UseFDSPECIAL 32
EndIF
IF $UseFDA3 EQ 4
SetEnv UseFDSPECIAL 33
EndIF
IF $UseFDA3 EQ 5
SetEnv UseFDSPECIAL 34
EndIF
IF $UseFDA3 EQ 6
SetEnv UseFDSPECIAL 35
EndIF
IF $UseFDA3 EQ 7
SetEnv UseFDSPECIAL 36
EndIF
IF $UseFDA3 EQ 8
SetEnv UseFDSPECIAL 37
EndIF
IF $UseFDA3 EQ 9
SetEnv UseFDSPECIAL 38
EndIF
IF $UseFDA3 EQ 0
SetEnv UseFDSPECIAL 39
EndIF
EndIF
If $UseFDA2 EQ 5
RequestChoice "Select inline file type" "1: new*n2: old*n3: lib stubs*n4: new style macros*n5: new style inlines*n6: new style inlines (with include lines)" 1 2 3 4 5 6 >ENV:UseFDA3
IF $UseFDA3 EQ 1
SetEnv UseFDSPECIAL 40
EndIF
IF $UseFDA3 EQ 2
SetEnv UseFDSPECIAL 41
EndIF
IF $UseFDA3 EQ 3
SetEnv UseFDSPECIAL 42
EndIF
IF $UseFDA3 EQ 4
SetEnv UseFDSPECIAL 43
EndIF
IF $UseFDA3 EQ 5
SetEnv UseFDSPECIAL 44
EndIF
IF $UseFDA3 EQ 0
SetEnv UseFDSPECIAL 45
EndIF
EndIF
If $UseFDA2 EQ 6
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
RequestChoice "Select Option" "`Type ENV:UseFDOptionText`" $UseFDOptions "x" >ENV:UseFDOption
IF $UseFDOption EQ 0
Skip EndScanOpts
EndIF
SetEnv UseFDNum 1
IF $UseFDOnCOMMENT
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " COMMENT"
SetEnv UseFDOnCOMMENT ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
IF $UseFDOnEXTERNC
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " EXTERNC"
SetEnv UseFDOnEXTERNC ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
IF $UseFDOnFPUONLY
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " FPUONLY"
SetEnv UseFDOnFPUONLY ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
IF $UseFDOnNEWSYNTAX
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " NEWSYNTAX"
SetEnv UseFDOnNEWSYNTAX ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
IF $UseFDOnNOFPU
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " NOFPU"
SetEnv UseFDOnNOFPU ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
IF $UseFDOnNOPPC
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " NOPPC"
SetEnv UseFDOnNOPPC ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
IF $UseFDOnNOPPCREGNAME
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " NOPPCREGNAME"
SetEnv UseFDOnNOPPCREGNAME ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
IF $UseFDOnNOSYMBOL
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " NOSYMBOL"
SetEnv UseFDOnNOSYMBOL ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
IF $UseFDOnONLYCNAMES
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " ONLYCNAMES"
SetEnv UseFDOnONLYCNAMES ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
IF $UseFDOnOPT040
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " OPT040"
SetEnv UseFDOnOPT040 ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
IF $UseFDOnPPCONLY
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " PPCONLY"
SetEnv UseFDOnPPCONLY ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
IF $UseFDOnPRIVATE
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " PRIVATE"
SetEnv UseFDOnPRIVATE ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
IF $UseFDOnSECTION
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " SECTION"
SetEnv UseFDOnSECTION ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
IF $UseFDOnSMALLCODE
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " SMALLCODE"
SetEnv UseFDOnSMALLCODE ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
IF $UseFDOnSMALLDATA
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " SMALLDATA"
SetEnv UseFDOnSMALLDATA ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
IF $UseFDOnSORTED
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " SORTED"
SetEnv UseFDOnSORTED ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
IF $UseFDOnSYSTEMRELEASE
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " SYSTEMRELEASE"
SetEnv UseFDOnSYSTEMRELEASE ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
IF $UseFDOnUSESYSCALL
IF $UseFDOption EQ $UseFDNum
Echo NOLINE >>ENV:UseFDArgs " USESYSCALL"
SetEnv UseFDOnUSESYSCALL ""
EndIF
SetEnv UseFDNum `Eval $UseFDNum+1`
EndIF
Skip ScanOpts BACK
Lab EndScanOpts
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
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
Echo NOLINE >>ENV:UseFDArgs " MODE 1"
EndIF
IF $UseFDMode2 EQ 2
Echo NOLINE >>ENV:UseFDArgs " MODE 2"
EndIF
IF $UseFDMode2 EQ 0
Echo NOLINE >>ENV: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
IF $UseFDCLIB
Echo NOLINE >>ENV:UseFDArgs "CLIB=*""
Echo NOLINE >>ENV:UseFDArgs $UseFDCLIB
Echo NOLINE >>ENV:UseFDArgs "*""
EndIF
EndIF
RequestFile DRAWERSONLY TITLE "Select the output drawer" >ENV:UseFDOutDrawer
Echo NOLINE >>ENV:UseFDArgs " INFILE=*""
Echo NOLINE >>ENV:UseFDArgs $UseFDInFile
Echo NOLINE >>ENV:UseFDArgs "*""
IF $UseFDOutDrawer
Echo NOLINE >>ENV:UseFDArgs " TO=*""
Echo NOLINE >>ENV:UseFDArgs $UseFDOutDrawer
Echo NOLINE >>ENV:UseFDArgs "*""
EndIF
Echo NOLINE >>ENV:UseFDArgs " SPECIAL="
Echo NOLINE >>ENV:UseFDArgs $UseFDSPECIAL
Echo NOLINE "Executing following command:*nfd2pragma"