[Pharo-project] [ANN] NativeBoost v 1.7

Igor Stasenko siguctua at gmail.com
Mon Nov 26 13:41:55 CET 2012

Hi, there

i'd like to announce new version of NativeBoost - 1.7.

Here's an overview of changes comparing to previous version:

 - indirect argument in signatures.
You can now use special syntax to indicate that argument to external
function should be taken from n-th element of variable object (like
from method's argument or instance variable.


myMethod: args
<primitive: .... >
^ self nbCall: #( void funFoo( int args at 1 , float args at 2 ))


self myMethod: { 1 .  1.2 }

Thanks to Ciprian Teodorov who proposed and implemented it.

- Win32, features and examples:

NBWin32Shell - an interface to use windows shell api
(executing commands, showing control panel settings)

different examples for using HDC, message box etc.

Thanks to Torsten Bergmann for contribution!

And last bits, from me:

A public API changes to avoid use of NBFFICallout global, and instead
use message(s) to denote FFI callout.

Old syntax:

NBFFICallout cdecl: #(...) emitCall: [ … ]

New syntax:

self nbCallout function: #(…) emit: […]

Old syntax:

NBFFICallout cdecl: #(...) module: ..

New syntax:

self nbCallout cdecl function: #(…) module: …
self nbCallout function: #(…) module: …

because cdecl is default

Old syntax:

NBFFICallout cdecl: #(...) module: .. options: #(…)

New syntax:

self nbCallout cdecl;
 options: #(…);
 function: #(…) module: …

Old syntax:

NBFFICallout stdcall: #(...) module: .. options: #(…)

New syntax:

self nbCallout stdcall;
 options: #(…);
 function: #(…) module: …


New API and syntax:

self nbCallout function: <signature> address: [ address block ]

generate code for calling a function located at given address with
given signature.
The address of function is provided by user in address block, which
should return a pointer to the function (NBExternalAddress or Unsigned
integer value, representing an absolute address of function).
This API is useful, when you need to call some function which is not
exported by via DLL symbol directly, but indirectly.

The old NBFFICallout API is still there, but use of it is strongly
discouraged. And it will be removed eventually. So be warned! :)

Best regards,
Igor Stasenko.

More information about the Pharo-project mailing list