Re: [Pharo-project] NB How can I pass a NULL argument?

2012-02-24 Thread Jan van de Sandt
Hi, Well, it works if I don't use the ICUEnumeration class. The first call returns an NBExternalAddress instance. If I pass this instance to the second call than it works fine. The native call looks like this: self nbCall: #( char* uenum_next_48(void* aHandle, nil, ICUErrorCodeNB* anErrorCode )

Re: [Pharo-project] NB How can I pass a NULL argument?

2012-02-24 Thread Igor Stasenko
On 24 February 2012 12:10, Jan van de Sandt jvdsa...@gmail.com wrote: Hi, Well, it works if I don't use the ICUEnumeration class. The first call returns an NBExternalAddress instance. If I pass this instance to the second call than it works fine. The native call looks like this: self

Re: [Pharo-project] NB How can I pass a NULL argument?

2012-02-24 Thread Jan van de Sandt
Thanks for the explanation, it starts to make sense to me now. But when I change the return type of the first call from void* to ICUEnumerationNB I end up here: NBExternalStructureTypecoerceReturn: gen ... should we support handling return of external structures? self error: 'returning pointer

Re: [Pharo-project] NB How can I pass a NULL argument?

2012-02-24 Thread Igor Stasenko
On 24 February 2012 15:02, Jan van de Sandt jvdsa...@gmail.com wrote: Thanks for the explanation, it starts to make sense to me now. But when I change the return type of the first call from void* to ICUEnumerationNB I end up here: NBExternalStructureTypecoerceReturn: gen ... should we

Re: [Pharo-project] NB How can I pass a NULL argument?

2012-02-24 Thread Igor Stasenko
And one more thing which i missed initially: ICUEnumerationNB is a subclass of NBExternalHandle. This class was actually done for holding a handle but not interact directly with marchalling types, and subclassing from it makes little sense actually unless you override #asNBExternalType: on class

Re: [Pharo-project] NB How can I pass a NULL argument?

2012-02-24 Thread Jan van de Sandt
Ah Yes!! After changing the superclass it works perfectly. Thank you very much Igor! Jan. PS: ICU binaries can be downloaded from http://apps.icu-project.org/icu-jsp/downloadPage.jsp?ver=4.8.1base=cUnfortunately no binary downloads for OSX and making a 32 bit version for Lion is a bit of a

Re: [Pharo-project] NB How can I pass a NULL argument?

2012-02-24 Thread Igor Stasenko
On 24 February 2012 16:44, Jan van de Sandt jvdsa...@gmail.com wrote: Ah Yes!! After changing the superclass it works perfectly. Thank you very much Igor! Thanks for feedback. Now i know what to do to prevent such mistakes. I will add class comment and override #asNBExternalType: to raise an

Re: [Pharo-project] NB How can I pass a NULL argument?

2012-02-14 Thread Jan van de Sandt
Hello Stef, I'm using the latest packages from http://www.squeaksource.com/NativeBoostand Pharo version 1.3 Jan. On Mon, Feb 13, 2012 at 11:12 PM, Stéphane Ducasse stephane.duca...@inria.fr wrote: Thanks for the question. Which version do you use? Stef Hello list, I want to call

Re: [Pharo-project] NB How can I pass a NULL argument?

2012-02-14 Thread Igor Stasenko
On 13 February 2012 22:40, Jan van de Sandt jvdsa...@gmail.com wrote: Hello list, I want to call the following C function using NativeBoost: const char* uenum_next(UEnumeration * en, int32_t * resultLength, UErrorCode * status) According to the (icu4c) documentation you can pass NULL for

Re: [Pharo-project] NB How can I pass a NULL argument?

2012-02-14 Thread Jan van de Sandt
I started with a new image and loaded ConfigurationOfNativeBoost. But it's still not working. First I do a call to get a handle: UEnumeration* ucal_openTimeZones(UErrorCode * ec) self nbCall: #( void* ucal_openTimeZones_48( ICUErrorCodeNB* anErrorCode ) ) module: 'libicui18n.dylib' This call

Re: [Pharo-project] NB How can I pass a NULL argument?

2012-02-14 Thread Igor Stasenko
On 14 February 2012 22:59, Jan van de Sandt jvdsa...@gmail.com wrote: I started with a new image and loaded ConfigurationOfNativeBoost. But it's still not working. First I do a call to get a handle: UEnumeration* ucal_openTimeZones(UErrorCode * ec) self nbCall: #( void*

[Pharo-project] NB How can I pass a NULL argument?

2012-02-13 Thread Jan van de Sandt
Hello list, I want to call the following C function using NativeBoost: const char* uenum_next(UEnumeration * en, int32_t * resultLength, UErrorCode * status) According to the (icu4c) documentation you can pass NULL for the resultLenth argument [1]. But when I try: self nbCall: #( char*

Re: [Pharo-project] NB How can I pass a NULL argument?

2012-02-13 Thread Stéphane Ducasse
Thanks for the question. Which version do you use? Stef Hello list, I want to call the following C function using NativeBoost: const char* uenum_next(UEnumeration * en, int32_t * resultLength, UErrorCode * status) According to the (icu4c) documentation you can pass NULL for the