RosettaCodeData/Task/Call-a-function-in-a-shared-library/Smalltalk/call-a-function-in-a-shared-library.st
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

14 lines
440 B
Smalltalk

DLD addLibrary: 'fakeimglib'.
Object subclass: ExtLib [
ExtLib class >> openimage: aString [
(CFunctionDescriptor isFunction: 'openimage')
ifTrue: [
(CFunctionDescriptor for: 'openimage'
returning: #int
withArgs: #( #string ) ) callInto: (ValueHolder null).
] ifFalse: [ ('internal open image %1' % { aString }) displayNl ]
]
].
ExtLib openimage: 'test.png'.