void GeodeLoadDGroup(
MemHandle mh);
This routine forces the
dgroup
segment into the data-segment register. This routine expects the
MemHandle
of the code resource, which can be retrieved with
GeodeGetCodeProcessHandle()
.
Include: resource.h
word GeodePrivAlloc(
GeodeHandle gh, /* handle of the owner of the
* newly-allocated private data */
word numWords); /* number of words to allocate */
This routine allocates a string of contiguous words in all geodes' private data areas; each set of words will be owned by the geode specified in
gh
. The data allocated can be accessed with
GeodePrivWrite()
and
GeodePrivRead()
and must be freed with
GeodePrivFree()
. The return value will be the offset to the start of the allocated range, or zero if the routine could not allocate the space.
Each geode has a block of private data the is accessed using the
GeodePriv...()
routines. A specific geode's private data block is expanded only when a valid
GeodePrivWrite()
is performed for the geode. Space is "allocated" in the data blocks of all geodes (loaded or yet-to-be loaded) simultaneously via a call to
GeodePrivAlloc()
. Data that have never been written are returned as all zeros.
Include: geode.h
void GeodePrivFree(
word offset, /* offset returned by GeodePrivAlloc() */
word numWords); /* number of words to free */
This routine frees a group of contiguous words from all geodes' private data areas. The space must previously have been allocated with
GeodePrivAlloc()
. Pass the offset to the words as returned by
GeodePrivAlloc()
as well as the number of words to be freed.
Include: geode.h
void GeodePrivRead(
GeodeHandle gh, /* handle of owner of private data */
word offset, /* offset returned by
* GeodePrivAlloc() */
word numWords, /* number of words to read */
word * dest); /* pointer to buffer into which data
* will be copied */
This routine reads a number of words from the geode's private data area. Pass the following:
gh
offset
GeodePrivAlloc()
.
numWords
dest
numWords
words long.Include: geode.h
void GeodePrivWrite(
GeodeHandle gh, /* handle of owner of private data */
word offset, /* offset returned by
* GeodePrivAlloc() */
word numWords, /* number of words to be written */
word * src); /* buffer containing data */
This routine writes a number of words into a geode's private data area. The area being written must have been allocated previously with
GeodePrivAlloc()
. Pass the following:
gh
offset
GeodePrivAlloc()
.
numWords
src
Include: geode.h
void GeodeSetDefaultDriver(
GeodeDefaultDriverType type, /* type of default driver to set */
GeodeHandle gh); /* driver to set as the default */
This routine sets the default driver for the indicated driver type. Pass the type of default driver in
type
and the handle of the driver in
gh
. The type must be a value of
GeodeDefaultDriverType
.
Include: driver.h
GeodeHandle GeodeUseDriver(
const char * name, /* file name of driver to load */
word protoMajor, /* expected major protocol */
word protoMinor, /* expected minor protocol */
GeodeLoadError * err); /* pointer to returned error */
This routine dynamically loads a driver geode given the driver's file name. It returns the geode handle of the driver if successful; if unsuccessful, it returns an error code of type
GeodeLoadError
pointed to by
err
. Pass this routine the following:
name
protoMajor
protoMinor
err
GeodeLoadError
in which any error values will be returned.Tips and Tricks: It is much easier to automatically load the drivers you need by noting them in your geode parameters file.
Be Sure To: If you use
GeodeUseDriver()
to dynamically load a driver, you must also use
GeodeFreeDriver()
to free it when you are done using it.
Include: driver.h
GeodeHandle GeodeUseLibrary(
const char * name, /* file name of library to load */
word protoMajor, /* expected major protocol */
word protoMinor, /* expected minor protocol */
GeodeLoadError * err); /* pointer to returned error */
This routine dynamically loads a library geode when given the library's file name. (The library must be in the thread's working directory.) It returns the geode handle of the loaded library if successful; if unsuccessful, it returns an error code (
GeodeLoadError
) pointed to by
err
. Pass this routine the following parameters:
name
protoMajor
protoMinor
err
GeodeLoadError
which will contain any returned error values.
Be Sure To: If you dynamically load a library with
GeodeUseLibrary()
, you must manually free it when finished, with
GeodeFreeLibrary()
.
Include: library.h
GEOS SDK TechDocs
|
|
GeodeGetAppObject() ...
|
GeoFree() ...