Programmer's Reference
Instances of PlatformLibrary are used to look up function or
data addresses in operating system shared libraries.
PlatformLibrary is used implicitly by instances of
PlatformFunction.
Each instance has a logical name and a physical name. The logical
name is the name used to refer to the library in Smalltalk (for example, the
library name used in a PlatformFunction). The physical name
(which can be the same as the logical name) is the name that is passed to the
operating system. The PlatformLibrary class keeps a list of
all instances that it creates. This way, multiple instances with the
same logical name are never created.
- logicalName
- Answers the logical name of the receiver (a String).
- physicalName
- Answers the physical name of the receiver (a String or
nil).
- getAddress:
- Answers the address (a positive Integer) of the library object
in the receiver. The library object must be a String or an
Integer. If the library object cannot be found, a walkback
occurs.
- close
- Closes the receiver. All PlatformFunctions
that reside in the receiver are unbound.
- mapLogicalName:toPhysicalName:
- Sets the mapping for the platform library's logical name to the
specified physical name. If a PlatformLibrary with the
specified logical name exists, closes it and sets its physical name as
indicated. If a new instance of PlatformLibrary with the
logical name is created at some later time, its physical name is set as
indicated. The logical name and the physical name must be a
String. The physical name must be either a String
or nil. If the physical name is nil, all
functions in the library are looked up in the user primitive table instead of
an operating system shared library.
- removeMappingForLogicalName:
- Removes the mapping for the logical name, if any. If a
PlatformLibrary with the logical name exists, closes it, and sets
its physical name to the logical name. If a new instance of
PlatformLibrary with the logical name is created at some later
time, its physical name is set to the logical name. The logical name
must be a String.
- logicalName:
- If a PlatformLibrary with the logical name already exists,
answers it. Otherwise, answers a new instance whose logical name is as
indicated and whose physical name is set according to the mappings. The
logical name must be a String.
- removeUnreferencedLibraries
- Closes all instances of PlatformLibrary. Discards any
instances that are not referenced from at least one
PlatformFunction. This method does not remove any
mappings.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]