Up: GEOS SDK TechDocs | Up | Prev: GeodeGetAppObject() ... | Next: GeoFree() ...

GeodeLoadDGroup

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

GeodePrivAlloc()

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

GeodePrivFree()

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

GeodePrivRead()

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
The geode handle of the owner of the private data to be read.
offset
The offset to the private data as returned by GeodePrivAlloc() .
numWords
The number of words to read.
dest
A pointer to a locked or fixed buffer into which the words should be read. It must be at least numWords words long.

Include: geode.h

GeodePrivWrite()

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
The geode handle of the owner of the private data space.
offset
The offset to begin writing to, as returned by GeodePrivAlloc() .
numWords
The number of words to be written. This should be no more than had been previously allocated.
src
A pointer to the locked or fixed buffer containing the data to be written.

Include: geode.h

GeodeSetDefaultDriver()

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

GeodeSetUIData()

void	GeodeSetUIData(
        GeodeHandle		gh,
        word		data)

GeodeUseDriver()

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
A pointer to the driver's null-terminated full path and file name.
protoMajor
The expected major protocol of the driver. If zero, any protocol is acceptable.
protoMinor
The expected minor protocol of the driver.
err
A pointer to a 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

GeodeUseLibrary()

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
A pointer to the library's null-terminated file name.
protoMajor
The expected major protocol of the library. If zero, any protocol is acceptable.
protoMinor
The expected minor protocol of the library.
err
A pointer to a 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


Up: GEOS SDK TechDocs | Up | Prev: GeodeGetAppObject() ... | Next: GeoFree() ...