|
From: | Paolo Bonzini |
Subject: | Re: [Help-smalltalk] DLD Usage |
Date: | Fri, 01 Feb 2008 15:49:30 +0100 |
User-agent: | Thunderbird 2.0.0.9 (Macintosh/20071031) |
There is a utility named gtk-server (http://www.gtk-server.org) wich offers a stream-oriented interface to the GTK library. The streaminterface is easily implemented in GNU smalltalk, but there is also a shared library version which provide a simple function('char* gtk(char*)').
Interesting.
Do i miss something when the C function descriptor is build ?
You don't need building a C function descriptor. It is just an internal detail.
Invoke "DLD addLibrary: 'libgtk-server.so'" just once, outside GtkServer completely. Then, implement #call: like this:
call: aString [ <cCall: 'gtk' returning: #string args: #(#string)> ]The pragma <cCall:...> will be compiled to the invocation of #callInto: for the CFunctionDescriptor.
Also, the first time you call it, it will automatically invoke #defineExternFunc: and call the gtk function.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |