Up: GEOS SDK TechDocs | Up | Prev: ObjVarDeleteDataAt() ... | Next: ParallelClose() ...

ObjVarScanData()

void	ObjVarScanData(
        optr		obj,					/* object to be scanned */
        word		numHandlers,					/* number of handlers in table */
        VarDataCHandler		* handlerTable,					/* pointer to handler table */
        void		* handlerData);					/* pointer to handler data */

This routine scans an object's vardata and calls all the vardata handlers specified in the passed handler table. Pass it the following parameters:

obj
The optr of the object whose variable data table is to be scanned.
numHandlers
The number of handlers specified in the passed handler table.
handlerTable
A pointer to a list of VarDataCHandler structures. Each of these structures contains a vardata data type and a pointer to the routine that is to handle it. All the handler routines must be in the same segment as the handler table.
handlerData
A pointer to a buffer that is passed on to the handlers. This can contain any information of specific interest to the application or handlers.

Vardata Handler Format:
A vardata handler routine must have the following format:

void _pascal (MemHandle mh, ChunkHandle chnk,
	VarDataEntry *extraData, word dataType,
	void *handlerData)

The handler should not free the object chunk or destroy the object; it can do anything else it pleases. The handler returns nothing and takes the following parameters:

mh:chnk
The memory handle and chunk handle of the object being referenced. Together, these comprise the optr of the object.
extraData
A pointer to the data type's extra data, if it has any. This pointer may be parsed with the macros VarDataTypePtr() , VarDataFlagsPtr() , and VarDataSizePtr() .
dataType
The data type of the data entry being handled. This is a record of type VardataKey .
handlerData
A pointer to a buffer passed through by ObjVarScanData() . This buffer may be used for passing additional data to the handlers.

Structures: The VarDataCHandler structure contains two elements:

typedef struct {
    word		VDCH_dataType;
    void	_pascal 	(*VDCH_handler) (
			MemHandle		mh,
			ChunkHandle		chnk,
			VarDataEntry		* extraData,
			word		dataType
			void		* handlerData);
} VarDataCHandler;

The first element is the data type, a record containing the data type and the vardata flags. The second element is a far pointer to the handler routine for the type.

Include: object.h

ObjVarScanDataHandles()

void	ObjVarScanDataHandles(
        MemHandle		mh,				/* handle portion of optr */
        ChunkHandle		ch,				/* chunk portion of optr */
        word		numHandlers,					/* number of handlers in table */
        VarDataCHandler		* handlerTable,					/* pointer to handler table */
        void		* handlerData);					/* pointer to handler data */

This routine is the same as ObjVarScanData() except that the object is specified via its handles rather than its optr.

Include: object.h

offsetof()

word	offsetof(struc, field);

This macro returns the offset of the specified field within the specified structure.

OptrToChunk()

ChunkHandle OptrToChunk(op);
        optr	op;

This macro extracts the chunk handle portion of the given optr.

See Also: ConstructOptr(), OptrToHandle().

OptrToHandle()

MemHandle OptrToHandle(op);
        optr	op;

This macro extracts the MemHandle portion of the given optr.

See Also: ConstructOptr(), OptrToChunk().


Up: GEOS SDK TechDocs | Up | Prev: ObjVarDeleteDataAt() ... | Next: ParallelClose() ...