Download Programmer`s Access Kit

Transcript
OBJECT DEFINITIONS
Object CT Overview
The Object CT API is a data abstracted set of functions. Its usage generally
follows some for variant of the following sequence:
1 Open the application’s object table.
2 Search for definitions for one or more objects.
3 Close the object table.
Code Scrap: Printing all objects in a particular domain
#include <objct.h>
/*
* Function print_objs4dom writes to standard output
all objects
*
configured for a particular domain.
*/
int print_objs4dom(char *flapp, char *tgt_dom)
{
FLOBJREC
rec;
u32
nrecs;
u32
k;
CT
objct;
if (ct_open_obj(&objct, flapp) != GOOD)
return ERROR
nrecs = ct_nrecs_obj(objct);
for (k = 0; k < nrecs; k++)
{
FactoryLink ECS / Programmer’s Access Kit / 373
10
Object Definitions
directly. A function-based interface, included with the Object CT API, should be
used to query FLOBJREC’s values. Using the API shields the PAK task from
future changes that alter the object’s structure and its members, yet leave the
interface alone.