However, I am still working on how to pass a "pointer to an unsigned
int" as a C callout. The page
http://www.gnu.org/software/smalltalk/manual/gst.html#C-data-types
shows how to pass a pointer to a scalar when in a struct, e.g.
(#example (#ptr #long)).
So I changed my script to have a similar definition:
CNote class >> newBlankNote: retVal [
<cCall: 'newBlankNote' returning: #{CNote} args: #((#ptr #uint)>
]
And here is the result when the library is called... (the first two
lines come from printf statements inside the C library. The second
line shows that the pointer was not actually passed into the library,
it is nil)
Inside newBlankNote: Size in bytes allocated to struct 'Note': 8
Inside newBlankNote: resultCode pointer: [(nil)]
./ccall2.st:30: Aborted
./ccall2.st:30: Error occurred while not in byte code interpreter!!
/usr/local/lib64/libgst.so.7(+0x71ca7)[0x7f8d8d996ca7]
/lib64/libc.so.6(+0x37c50)[0x7f8d8ceb2c50]
/lib64/libc.so.6(gsignal+0x35)[0x7f8d8ceb2bd5]
/lib64/libc.so.6(abort+0x17b)[0x7f8d8ceb404b]
/usr/local/lib64/libgst.so.7(+0x2c9bb)[0x7f8d8d9519bb]
/usr/lib64/libsigsegv.so.2(+0xe7c)[0x7f8d8cc77e7c]
/lib64/libc.so.6(+0x37c50)[0x7f8d8ceb2c50]
/home/stephenw/devel_gst/ccall2/bug1/libccall2.so(newBlankNote+0x74)[0x7f8d8b7196d0]
/usr/lib64/libffi.so.6(ffi_call_unix64+0x4c)[0x7f8d8ca74ecc]
/usr/lib64/libffi.so.6(ffi_call+0x19d)[0x7f8d8ca7489d]
Aborted
Regards
Stephen
_______________________________________________
help-smalltalk mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-smalltalk