Up: GEOS SDK TechDocs | Up | Prev: NameArrayAdd() ... | Next: ObjCompFindChildByOptr() ...

NameArrayFind()

word	NameArrayFind(
        optr 		array,				/* optr to name array */
        const char		* nameToFind,				/* Find element with this name */
        word		nameLength,				/* Pass zero if name string is
						 * null-terminated */
        void *		returnData);				/* Copy data section into this
						 * buffer */

This routine locates the element with the specified name. It returns the token of the element and copies its data section into the passed buffer. If there is no element with the specified name, the routine will return CA_NULL_ELEMENT. The routine takes the following arguments:

array
The optr of the name array.
nameToAdd
The name of the element to find. This string may contain nulls.
nameLength
The length of the name string, in bytes. If you pass zero, NameArrayFind() will assume the string is null-terminated.
returnData
The data section of the element is written to this buffer.

Include: chunkarr.h

Warnings: You must make sure the returnData buffer is large enough to hold an element's data portion; otherwise, data after the buffer will be overwritten.

NameArrayFindHandles()

word	NameArrayFindHandles(
        MemHandle		mh,				/* Handle of LMem heap */
        ChunkHandle 		array,				/* Handle of name array */
        const char *		nameToFind,				/* Find element with this name */
        word		nameLength,				/* Pass zero if name string is
						 * null-terminated */
        void *		returnData);				/* Copy data section into this
						 * buffer */

This routine is exactly like NameArrayFind() above, except that the name array is specified by its global and chunk handles (instead of with an optr).

Include: chunkarr.h

NEC()

NEC(line)

This macro defines a line of code that will only be compiled into the non -error-checking version of the geode. The line parameter of the macro is the actual line of code. When the non-EC version of the program is compiled, the line will be treated as a normal line of code; when the EC version is compiled, the line will be ignored.

See Also: EC().

Include: ec.h

ObjBlockGetOutput()

optr	ObjBlockGetOutput(
        MemHandle mh);			/* handle of the subject object block */

This routine returns the optr of the output destination object set for the specified object block. The output object is stored in the object block's header in the OLMBH_output field. If the block has no output set, NullOptr will be returned.

Include: object.h

See Also: ObjLMemBlockHeader.

ObjBlockSetOutput()

void	ObjBlockSetOutput(
        MemHandle		mh,			/* handle of the subject object block */
        optr		o);			/* optr of the new output object */

This routine sets the OLMBH_output field in the specified object block's header. The optr passed in o will be set as the block's output.

Include: object.h

See Also: ObjLMemBlockHeader.

ObjCompAddChild()

void	ObjCompAddChild(
        optr	obj,		/* optr of parent composite */
        optr	objToAdd,		/* optr of new child */
        word	flags,		/* CompChildFlags */
        word	masterOffset,		/* offset to master part */
        word	compOffset,		/* offset to comp field in master part */
        word	linkOffset);		/* offset to link field in master part */

This routine adds the given object to an object tree as the child of another specified object. It returns nothing. You will not likely want to use this routine; instead, you will probably use the messages listed below under "See Also." The parameters of this routine are

obj
The optr of the parent composite object. The parent must be a composite; if it is not, an error will result.
objToAdd
The optr of the child object. The child must have a link instance field (defined with @link ).
flags
A record of CompChildFlags . These flags indicate whether the object should initially be marked dirty as well as where in the parent's child list the new child should be placed (first, second, last, etc.).
masterOffset
The offset within the parent's instance chunk to the master group's offset. (The value that would appear in the parent class' Class_masterOffset field in its ClassStruct structure.)
compOffset
The offset within the parent's instance chunk to the composite field.
linkOffset
The offset within the parent's instance chunk to the link field.

Warnings: This routine may resize and move LMem and Object blocks on the heap, thereby invalidating all segment addresses and pointers.

Include: metaC.goh

See Also: MSG_VIS_ADD_CHILD, MSG_GEN_ADD_CHILD.

ObjCompFindChildByNumber()

optr	ObjCompFindChildByNumber(
        optr	obj,		/* parent's optr */
        word	childToFind,		/* zero-based child number */
        word	masterOffset,		/* offset to master part */
        word	compOffset,		/* offset to comp field in master part */
        word	linkOffset);		/* offset to link field in master part */

This routine returns the optr of the passed object's child; the child is specified based on its position in the object's child list. You will not often use this routine, but you will probably use the messages listed under "See Also" instead. The routine's parameters are listed below:

obj
The optr of the parent object.
childToFind
The zero-based number of the child to be found. For example, to return the first child's optr, pass zero or CCO_FIRST; to return the last child's optr, pass CCO_LAST.
masterOffset
The offset within the parent's instance chunk to the master group's offset. (The value that would appear in the parent class' Class_masterOffset field in its ClassStruct structure.)
compOffset
The offset within the parent's instance chunk to the composite field.
linkOffset
The offset within the parent's instance chunk to the link field.

Include: metaC.goh

See Also: MSG_GEN_FIND_CHILD, MSG_VIS_FIND_CHILD.


Up: GEOS SDK TechDocs | Up | Prev: NameArrayAdd() ... | Next: ObjCompFindChildByOptr() ...