Squeak Class Documentation category index | class index  
 
ExternalFunction
  category: FFI-Kernel
  superclass: ExternalObject
  subclasses: ExternalLibraryFunction

This class represents an external function called from Smalltalk. Instances of ExternalFunction can be created if the address/parameters of the function are known by some other means than loading from a shared library or compiling the appropriate primitive specification.

Instance variables:
flags <Integer> a set of flags encoding the calling convention
args <Array of: ExternalType> the parameters of the function

Implementation notes:

The arguments consist of an array with the first element defining the return type, the remaining arguments defining the parameters of the call.

instance methods
  accessing
  argTypes
flags
module
name

  initialize-release
  initialize

  invoking
  invoke
invokeWith:
invokeWith:with:
invokeWith:with:with:
invokeWith:with:with:with:
invokeWith:with:with:with:with:
invokeWith:with:with:with:with:with:
invokeWithArguments:

  printing
  callingConventionString
printOn:

class methods
  class initialization
  initialize
initializeCallingConventions
initializeErrorConstants

  compiler support
  atomicTypeNamed:
callingConventionFor:
forceTypeNamed:
isValidType:
structTypeNamed:

  constants
  callTypeAPI
callTypeCDecl

  error handling
  errorMessageFor:
externalCallFailed
getLastError

instance methods
  accessing top  
 

argTypes


 

flags


 

module


 

name

Answer a name for the receiver. This is used generically in the title of certain inspectors, such as the referred-to inspector, and specificially by various subsystems. By default, we let the object just print itself out..


  initialize-release top  
 

initialize

Initialize the receiver


  invoking top  
 

invoke


 

invokeWith:


 

invokeWith:with:


 

invokeWith:with:with:


 

invokeWith:with:with:with:


 

invokeWith:with:with:with:with:


 

invokeWith:with:with:with:with:with:


 

invokeWithArguments:

Manually invoke the receiver, representing an external function.


  printing top  
 

callingConventionString


 

printOn:

Append to the argument, aStream, a sequence of characters that
identifies the receiver.


class methods
  class initialization top  
 

initialize

ExternalFunction initialize


 

initializeCallingConventions

ExternalFunction initializeCallingConventions


 

initializeErrorConstants

ExternalFunction initializeErrorConstants


  compiler support top  
 

atomicTypeNamed:


 

callingConventionFor:

Return the constant describing the calling convention for the given string specification or nil if unknown.


 

forceTypeNamed:


 

isValidType:


 

structTypeNamed:


  constants top  
 

callTypeAPI


 

callTypeCDecl


  error handling top  
 

errorMessageFor:

Return the error message for the given error code from the foreign function interface


 

externalCallFailed

Raise an error after a failed call to an external function


 

getLastError

Return the last error from an external call.
Only valid immediately after the external call failed.