Revision history for ExtLibFfi


Revision [19999]

Last edited on 2016-02-10 15:50:19 by DkLwikki [Update link format]
Additions:
@cif, _ ' call interface object
FFI_DEFAULT_ABI, _ ' binary interface type
1, _ ' number of arguments
@ffi_type_uint, _ ' return type
@args(0) _ ' arguments
' Open console file to send to PrinterBinding as user data
Dim ConsoleFile As Integer = FreeFile()
Open Cons For Output As ConsoleFile

' Initialize the closure, setting user data to the console file
prep_result = ffi_prep_closure_loc( _
closure, _ ' closure object
@cif, _ ' call interface object
@Printer, _ ' actual closure function
@ConsoleFile, _ ' user data, our console file #
PrinterBinding _ ' pointer to binding
)
If prep_result = FFI_OK Then
' Call binding as a natural function call
Dim Result As Integer
Result = PrinterBinding("Hello World!")
Print Using "Returned &"; Result
End IF

Close ConsoleFile
Deletions:
@cif, _ ' call interface object
FFI_DEFAULT_ABI, _ ' binary interface type
1, _ ' number of arguments
@ffi_type_uint, _ ' return type
@args(0) _ ' arguments
' Open console file to send to PrinterBinding as user data
Dim ConsoleFile As Integer = FreeFile()
Open Cons For Output As ConsoleFile

' Initialize the closure, setting user data to the console file
prep_result = ffi_prep_closure_loc( _
closure, _ ' closure object
@cif, _ ' call interface object
@Printer, _ ' actual closure function
@ConsoleFile, _ ' user data, our console file #
PrinterBinding _ ' pointer to binding
)
If prep_result = FFI_OK Then
' Call binding as a natural function call
Dim Result As Integer
Result = PrinterBinding("Hello World!")
Print Using "Returned &"; Result
End IF

Close ConsoleFile


Revision [17373]

Edited on 2014-11-07 17:40:24 by DkLwikki [New version in Git]
Additions:
Header version: 3.1
Deletions:
Header version: 3.0.10


Revision [15939]

Edited on 2012-02-02 10:48:08 by DkLwikki [Add version]
Additions:
Header version: 3.0.10


Revision [15323]

Edited on 2011-10-02 06:44:51 by DkLwikki [Add jofers' libffi examples]
Additions:
Hello world:
{{fbdoc item="filename" value="examples/manual/libraries/ffi/helloworld.bas"}}%%(freebasic)
Closures:
{{fbdoc item="filename" value="examples/manual/libraries/ffi/closures.bas"}}%%(freebasic)
Deletions:
{{fbdoc item="filename" value="examples/manual/libraries/ffi/helloworld.bas"}}%%(freebasic)%%
{{fbdoc item="filename" value="examples/manual/libraries/ffi/closures.bas"}}%%(freebasic)%%


Revision [15322]

The oldest known version of this page was created on 2011-10-02 06:43:28 by DkLwikki [Add jofers' libffi examples]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode