FreeBASIC
0.91.0
|
#include "fb.bi"
#include "hlp.bi"
#include "hash.bi"
#include "list.bi"
#include "objinfo.bi"
#include "file.bi"
Go to the source code of this file.
Data Structures | |
class | FBC_EXTOPT |
class | FBCIOFILE |
class | FBC_OBJINF |
class | FBCCTX |
Macros | |
#define | ENABLE_GORC |
#define | safeKill(f) |
Typedefs | |
using | fo = any if(len(fbc.xpm.srcfile)=0) then return TRUE end if ''Remember *.xpm file name xpmfile=fbc.xpm.srcfile ''Set *.bas name based on input file name or-o< file >:if(len(*fbc.xpm.objfile) > 0) then fbc.xpm.srcfile=hStripExt(*fbc.xpm.objfile) end if ''foo.xpm-> foo.xpm.bas to avoid collision with foo.bas fbc.xpm.srcfile &=".bas"if(fbc.verbose) then print"parsing xpm: ", xpmfile &" -o "&fbc.xpm.srcfile end if if(hParseXpm(xpmfile, code)=FALSE) then ''TODO:show error message exit function end if fo=freefile() if(open(fbc.xpm.srcfile, for output, as#fo)) then ''TODO:show error message exit function end if print#fo, code |
Enumerations | |
enum | { FBCTOOL_AS = 0, FBCTOOL_AR, FBCTOOL_LD, FBCTOOL_GCC, FBCTOOL_LLC, FBCTOOL_DLLTOOL, FBCTOOL_GORC, FBCTOOL_WINDRES, FBCTOOL_CXBE, FBCTOOL__COUNT } |
enum | { OPT_A = 0, OPT_ARCH, OPT_ASM, OPT_B, OPT_C, OPT_CKEEPOBJ, OPT_D, OPT_DLL, OPT_DYLIB, OPT_E, OPT_EX, OPT_EXX, OPT_EXPORT, OPT_FORCELANG, OPT_FPMODE, OPT_FPU, OPT_G, OPT_GEN, OPT_HELP, OPT_I, OPT_INCLUDE, OPT_L, OPT_LANG, OPT_LIB, OPT_M, OPT_MAP, OPT_MAXERR, OPT_MT, OPT_NODEFLIBS, OPT_NOERRLINE, OPT_O, OPT_OPTIMIZE, OPT_P, OPT_PP, OPT_PREFIX, OPT_PRINT, OPT_PROFILE, OPT_R, OPT_RKEEPASM, OPT_RR, OPT_RRKEEPASM, OPT_S, OPT_STATIC, OPT_T, OPT_TARGET, OPT_TITLE, OPT_V, OPT_VEC, OPT_VERSION, OPT_W, OPT_WA, OPT_WC, OPT_WL, OPT_X, OPT_Z, OPT__COUNT } |
Functions | |
then Invalid XPM header close exit function end if Check for lines containing | strings (color and pixel lines) ''Other lines(declaration line |
then Invalid XPM header close exit function end if Check for lines containing empty C aren t explicitely but should automatically be as long as they don t contain strings dim as integer ln Strip everything in front of the first in a new separated by a if it s not the first one | if (saw_rows) then code+ |
close Clean up the temp bas if R wasn t given | if (fbc.keepasm=FALSE) then fbcAddTemp(fbc.xpm.srcfile) end if hCompileBas(@fbc.xpm |
FB isn t strict about it don t let gcc make assumptions because they cause incompatibilities with the ASM backend For however with the C backend gcc ffast math optimizes out the | subtraction (even under-O0) and inserts 0 instead. ''Avoid gcc exception handling bloat ln+ |
sub | fbcFindBin (byval_as_integer tool, byref_as_string path, byref_as_integer relying_on_system=FALSE) |
function_as_integer | fbcRunBin (byval_as_zstring_ptr action, byval_as_integer tool, byref_as_string ln) |
private sub | fbcInit () |
private sub | hSetOutName () |
private sub | fbcEnd (byval_as_integer errnum) |
private sub | fbcAddTemp (byref_as_string file) |
private function_as_string_ptr | fbcAddObj (byref_as_string file) |
private function_as_string | fbcFindLibFile (byval_as_zstring_ptr file) |
private sub | fbcAddDefLibPath (byref_as_string path) |
private sub | fbcAddLibPathFor (byval_as_zstring_ptr libname) |
private function_as_integer | hPutLdArgsIntoFile (byref_as_string ldcline) |
private function_as_integer | clearDefList (byref_as_string deffile) |
private function_as_integer | hGenerateEmptyDefFile (byref_as_string deffile) |
private function_as_integer | makeImpLib (byref_as_string dllname, byref_as_string deffile) |
private function_as_string | hFindLib (byval_as_zstring_ptr file) |
private function_as_integer | hLinkFiles () |
private sub | hReadObjinfo () |
private sub | hCollectObjinfo () |
private sub | hFatalInvalidOption (byref_as_string arg) |
private sub | hCheckWaitingObjfile () |
private sub | hSetIofile (byval_as_FBCIOFILE_ptr module, byref_as_string srcfile, byval_as_integer is_rc) |
private sub | hAddBas (byref_as_string basfile) |
private sub | hParseTargetId (byref_as_string os, byref_as_string arch) |
private function_as_integer | hParseTargetOS (byref_as_string os) |
private sub | handleOpt (byval_as_integer optid, byref_as_string arg) |
private function_as_integer | parseOption (byval_as_zstring_ptr opt) |
sub | parseArgsFromFile (byref_as_string filename) |
private sub | handleArg (byref_as_string arg) |
private sub | hParseArgs (byval_as_integer argc, byval_as_zstring_ptr_ptr argv) |
private sub | fbcInit2 () |
private function_as_string | hGetAsmName (byval_as_FBCIOFILE_ptr module, byval_as_integer stage) |
private sub | hCompileBas (byval_as_FBCIOFILE_ptr module, byval_as_integer is_main, byval_as_integer is_fbctinf) |
private sub | hCompileModules () |
private function_as_integer | hParseXpm (byref_as_string xpmfile, byref_as_string code) |
private function_as_integer | hCompileXpm () |
private function_as_integer | hCompileStage2Module (byval_as_FBCIOFILE_ptr module) |
private sub | hCompileStage2Modules () |
private function_as_integer | hAssembleModule (byval_as_FBCIOFILE_ptr module) |
private sub | hAssembleModules () |
private function_as_integer | hAssembleRc (byval_as_FBCIOFILE_ptr rc) |
private sub | hAssembleRcs () |
private sub | hAssembleXpm () |
private function_as_integer | hCompileFbctinf () |
private function_as_integer | hArchiveFiles () |
private sub | hSetDefaultLibPaths () |
private sub | fbcAddDefLib (byval_as_zstring_ptr libname) |
private sub | hAddDefaultLibs () |
private sub | hPrintOptions () |
private sub | hAppendConfigInfo (byref_as_string config, byval_as_zstring_ptr info) |
private sub | hPrintVersion () |
Variables | |
then Invalid XPM header close exit function end if Check for lines containing empty | lines |
then Invalid XPM header close exit function end if Check for lines containing empty C | comments |
then Invalid XPM header close exit function end if Check for lines containing empty C aren t explicitely | handled |
then Invalid XPM header close exit function end if Check for lines containing empty C aren t explicitely but should automatically be | ignored |
then Invalid XPM header close exit function end if Check for lines containing empty C aren t explicitely but should automatically be as long as they don t contain strings dim as integer | saw_rows |
then Invalid XPM header close exit function end if Check for lines containing empty C aren t explicitely but should automatically be as long as they don t contain strings dim as integer ln Strip everything in front of the first | ln |
then Invalid XPM header close exit function end if Check for lines containing empty C aren t explicitely but should automatically be as long as they don t contain strings dim as integer ln Strip everything in front of the first in a new | line |
then Invalid XPM header close exit function end if Check for lines containing empty C aren t explicitely but should automatically be as long as they don t contain strings dim as integer ln Strip everything in front of the first in a new separated by a | comma |
close Clean up the temp bas if R wasn t given | FALSE |
close Clean up the temp bas if R wasn t given FALSE | function |
close Clean up the temp bas if R wasn t given FALSE asmfile | asmfile |
FB isn t strict about it don t let gcc make assumptions because they cause incompatibilities with the ASM backend For | example |
FB isn t strict about it don t let gcc make assumptions because they cause incompatibilities with the ASM backend For however with the C backend | with |
FB isn t strict about it don t let gcc make assumptions because they cause incompatibilities with the ASM backend For however with the C backend gcc ffast math optimizes out the not even * | o |
FB isn t strict about it don t let gcc make assumptions because they cause incompatibilities with the ASM backend For however with the C backend gcc ffast math optimizes out the not even so we need to make it *obj and then rename it afterwards dim as integer | need_rename |
static zstring | toolnames [toFBCTOOL__COUNT+1] = |
FBCCTX | fbc |
integer | option_takes_argument [to[OPT__COUNT+1]+1] = |
#define safeKill | ( | f) |
using fo = any if( len( fbc.xpm.srcfile ) = 0 ) then return TRUE end if '' Remember *.xpm file name xpmfile = fbc.xpm.srcfile '' Set *.bas name based on input file name or -o <file>: if( len( *fbc.xpm.objfile ) > 0 ) then fbc.xpm.srcfile = hStripExt( *fbc.xpm.objfile ) end if '' foo.xpm -> foo.xpm.bas to avoid collision with foo.bas fbc.xpm.srcfile &= ".bas" if( fbc.verbose ) then print "parsing xpm: ", xpmfile & " -o " & fbc.xpm.srcfile end if if( hParseXpm( xpmfile, code ) = FALSE ) then '' TODO: show error message exit function end if fo = freefile( ) if( open( fbc.xpm.srcfile, for output, as #fo ) ) then '' TODO: show error message exit function end if print #fo, code |
anonymous enum |
anonymous enum |
private function_as_integer clearDefList | ( | byref_as_string | deffile) |
private sub fbcAddDefLib | ( | byval_as_zstring_ptr | libname) |
private sub fbcAddDefLibPath | ( | byref_as_string | path) |
private sub fbcAddLibPathFor | ( | byval_as_zstring_ptr | libname) |
private function_as_string_ptr fbcAddObj | ( | byref_as_string | file) |
private sub fbcAddTemp | ( | byref_as_string | file) |
private sub fbcEnd | ( | byval_as_integer | errnum) |
sub fbcFindBin | ( | byval_as_integer | tool, |
byref_as_string | path, | ||
byref_as_integer | relying_on_system = FALSE |
||
) |
private function_as_string fbcFindLibFile | ( | byval_as_zstring_ptr | file) |
private sub fbcInit | ( | ) |
private sub fbcInit2 | ( | ) |
function_as_integer fbcRunBin | ( | byval_as_zstring_ptr | action, |
byval_as_integer | tool, | ||
byref_as_string | ln | ||
) |
private sub hAddBas | ( | byref_as_string | basfile) |
private sub hAddDefaultLibs | ( | ) |
private sub handleArg | ( | byref_as_string | arg) |
private sub handleOpt | ( | byval_as_integer | optid, |
byref_as_string | arg | ||
) |
private sub hAppendConfigInfo | ( | byref_as_string | config, |
byval_as_zstring_ptr | info | ||
) |
private function_as_integer hArchiveFiles | ( | ) |
private function_as_integer hAssembleModule | ( | byval_as_FBCIOFILE_ptr | module) |
private sub hAssembleModules | ( | ) |
private function_as_integer hAssembleRc | ( | byval_as_FBCIOFILE_ptr | rc) |
private sub hAssembleRcs | ( | ) |
private sub hAssembleXpm | ( | ) |
private sub hCheckWaitingObjfile | ( | ) |
private sub hCollectObjinfo | ( | ) |
private sub hCompileBas | ( | byval_as_FBCIOFILE_ptr | module, |
byval_as_integer | is_main, | ||
byval_as_integer | is_fbctinf | ||
) |
private function_as_integer hCompileFbctinf | ( | ) |
private sub hCompileModules | ( | ) |
private function_as_integer hCompileStage2Module | ( | byval_as_FBCIOFILE_ptr | module) |
private sub hCompileStage2Modules | ( | ) |
private function_as_integer hCompileXpm | ( | ) |
private sub hFatalInvalidOption | ( | byref_as_string | arg) |
private function_as_string hFindLib | ( | byval_as_zstring_ptr | file) |
private function_as_integer hGenerateEmptyDefFile | ( | byref_as_string | deffile) |
private function_as_string hGetAsmName | ( | byval_as_FBCIOFILE_ptr | module, |
byval_as_integer | stage | ||
) |
private function_as_integer hLinkFiles | ( | ) |
private sub hParseArgs | ( | byval_as_integer | argc, |
byval_as_zstring_ptr_ptr | argv | ||
) |
private sub hParseTargetId | ( | byref_as_string | os, |
byref_as_string | arch | ||
) |
private function_as_integer hParseTargetOS | ( | byref_as_string | os) |
private function_as_integer hParseXpm | ( | byref_as_string | xpmfile, |
byref_as_string | code | ||
) |
private sub hPrintVersion | ( | ) |
private function_as_integer hPutLdArgsIntoFile | ( | byref_as_string | ldcline) |
private sub hReadObjinfo | ( | ) |
private sub hSetDefaultLibPaths | ( | ) |
private sub hSetIofile | ( | byval_as_FBCIOFILE_ptr | module, |
byref_as_string | srcfile, | ||
byval_as_integer | is_rc | ||
) |
private sub hSetOutName | ( | ) |
then Invalid XPM header close exit function end if Check for lines containing empty C aren t explicitely but should automatically be as long as they don t contain strings dim as integer ln Strip everything in front of the first in a new separated by a if it s not the first one if | ( | saw_rows | ) |
close Clean up the temp bas if R wasn t given if | ( | fbc. | keepasm = FALSE ) |
private function_as_integer makeImpLib | ( | byref_as_string | dllname, |
byref_as_string | deffile | ||
) |
private sub parseArgsFromFile | ( | byref_as_string | filename) |
private function_as_integer parseOption | ( | byval_as_zstring_ptr | opt) |
then Invalid XPM header close exit function end if Check for lines containing strings | ( | color and pixel | lines) |
FB isn t strict about it don t let gcc make assumptions because they cause incompatibilities with the ASM backend For however with the C backend gcc ffast math optimizes out the subtraction | ( | even under- | O0) |
FB isn t strict about it don t let gcc make assumptions because they cause incompatibilities with the ASM backend For example |
FB isn t strict about it don t let gcc make assumptions ln |
FB isn t strict about it don t let gcc make assumptions because they cause incompatibilities with the ASM backend For however with the C backend gcc ffast math optimizes out the not even so we need to make it* obj and then rename it afterwards dim as integer need_rename |
integer option_takes_argument[to[OPT__COUNT+1]+1] = |