AW: Re: ODBC and Mac OS X

Petr Fischer petr.fischer at praguesoft.cz
Tue Oct 16 19:53:35 UTC 2007


Thanks for detailed clarifications. pf

On 16.10.2007, at 21:37, John M McIntosh wrote:

> We have lots of FFI in Sophie.
>
> The key to it is
>
> (a) being able to find the module that is in the FFI call.  Or a  
> derived name which is based on the module name.
> (b) being able to find the module in some path that the Squeak VM  
> will search in.
>
> For the os-x carbon VM
> See SqueakPluginsBuiltInOrLocalOnly
> http://www.smalltalkconsulting.com/html/squeakinfoplist.html
>
> Once the module is found we find the procedure name, again based on  
> the information in the Smalltalk method. So for the example below we
> expect to find NavCreateNewFolderDialog in Carbon.framework which  
> is in /System/Library/Frameworks a place where we look  
> automatically for frameworks.
>
> Of course the input parms and return value must match expectations,  
> otherwise you crash the VM, or get an error coecering variables  
> between Smalltalk objects and C types.
>
> apiNavCreateNewFolderDialog: aMacNavDialogCreationOptions  
> eventProc: aEventProc client: data dialogRef: aNavDialogRef
> 	<cdecl: long  
> 'NavCreateNewFolderDialog' ( MacNavDialogCreationOptions*  long  
> long MacNavDialogRef*) module:'Carbon.framework'>
> 	^ self externalCallFailed
>
> "OSStatus NavCreateNewFolderDialog (
>    const NavDialogCreationOptions * inOptions,
>    NavEventUPP inEventProc,
>    void * inClientData,
>    NavDialogRef * outDialog
> );"
>
>
> The usual problems you run into is finding and loading the module.
> The os-x carbon VM has a SqueakDebug info.plist value you can set  
> to 1 to help debug this issue.
> After finding the module the next issue likely is coding a proper  
> parm list and then giving it the correct objects.
> save image often, cross fingers...
>
>
> On Oct 16, 2007, at 12:20 PM, Petr Fischer wrote:
>
>> Yes. It works... and reads data from Firebird SQL.
>
> --
> ====================================================================== 
> =====
> John M. McIntosh <johnmci at smalltalkconsulting.com>
> Corporate Smalltalk Consulting Ltd.  http:// 
> www.smalltalkconsulting.com
> ====================================================================== 
> =====
>
>
>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2435 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20071016/377eea32/smime.bin


More information about the Squeak-dev mailing list