sharedlibraryfunction
Description
A sharedlibraryfunction object represents a function in a shared
library that has been previously retrieved using the
findfunction()
method. To call the function, it
is necessary to use the call()
method and pass
the appropriate parameters (if any) in accordance to the way the function
expects them. It is currently not possible to pass a SIMPOL type in the
place where a pointer to a structure is expected. Instead, each member of
the type must be passed explicitly.
Type Tags
None
Object Value
The value of a sharedlibraryfunction object is undefined and it is an error to attempt to set or get it.
Properties
Property | Type | Description |
---|---|---|
_ | type(*) | This property is provided for use by the user to attach any object of any type to the type in which this property is provided. |
__ | type(*) | This property is provided for use by the user to attach any object of any type to the type in which this property is provided. It has the additional feature of being marked with the resolve keyword, so that object resolution can continue down this property. |
functionname | string | The name of the function in the shared library. |
library | sharedlibrary | This contains a reference to the shared library object that contains the function. |
name | string |
The name of the sharedlibraryfunction object. Using this name and
the member operator it is possible to call the function from the
sharedlibrary object without the need to store a
reference to the function. For example, assuming a library object
referenced by a variable called foo, with a function named bar:
foo!bar.call() .
|
next | sharedlibraryfunction |
This is a reference to the next function in the ring of functions that have
been retrieved for the shared library using the
findfunction() method. Only functions
retrieved in this way appear in the ring.
|
type | type | Specifies the sharedlibraryfunction type object. |
Methods
call()
Description
Calls the shared library function. Depending on the definition of the function, it may have any number of parameters and may or may not have a return value. The use of this functionality can cause unexpected results, including the crash of the program, the operating system, etc. Using these functions goes outside the safeguards provided by the SIMPOL programming language and is completely at the users own risk. As a general rule of thumb, do not allocate resources without giving them back. Do not hog resources (retain control of resources for longer than necessary).
Prototype
sharedlibraryfunctionvar
.call
(
,
…
)
…
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
… | None | Function-dependent. | |
… | None |