Blame view

testlib/Testlib.st 897 Bytes
70473583   Göran Krampe   First sample and ...
1
  ExternalLibrary subclass: #Testlib
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Nim'!

!Testlib class methodsFor: 'primitives' stamp: 'gk 11/2/2014 13:05'!
ffiAdd: a with: b
	"self ffiAdd: 13 with: 29"
	
	<cdecl: long 'add' (long long) module: 'testlib'>
	^self externalCallFailed!

ffiConcat: a with: b
	"self ffiConcat: 'a' with: 'b' "
	
	<cdecl: char* 'concat' (char* char*) module: 'testlib'>
	^self externalCallFailed!

ffiFoo
	"self ffiFoo"
	
	<cdecl: char* 'foo' () module: 'testlib'>
	^self externalCallFailed!

ffiHello
	"self ffiHello"
	
	"long is int in Nim"
	
	<cdecl: long 'hello' () module: 'testlib'>
	^self externalCallFailed!

ffiLength: x
	"self ffiLen: 'hey' "
	
	<cdecl: long 'length' (char*) module: 'testlib'>
	^self externalCallFailed! !


!Testlib class methodsFor: 'accessing' stamp: 'gk 2/18/2015 23:13'!
moduleName
	^'testlib'! !