FWClassResponse(3sadm)


FWClassResponse -- examine responses from the FWClassOperations routines

Synopsis

CC ... -lsysadm -lvtcl -ltclx -ltcl -lsocket -lgen -lm

#include <scoadmin/basicIncl.h> #include <scoadmin/callBack.h> #include <scoadmin/statusLst.h> #include <scoadmin/CAPI.h>

bool_t FWExamineNextObject(bmipSubmission_cl *bmipSubmissionPtr, errStatus_cl *errStatusPtr);

bool_t FWExamineNextObjectGet(bmipSubmission_cl *bmipSubmissionPtr, attributeList_pt *attributeListPtr, errStatus_cl *errStatusPtr);

bool_t FWExamineNextObjectAction(bmipSubmission_cl *bmipSubmissionPtr, actionInfo_pt *actionInfoPtr, errStatus_cl *errStatusPtr);

Description

These routines examine responses generated by the FWClassOperations(3sadm) routines when multiple responses are expected as in the case of a "scoped" object request. The initial response will be returned to the calling FWClassOperations 3sadm function. Subsequent responses can be obtained using these routines. All three routines return TRUE if an additional response is found in the bmipSubmissionPtr, otherwise they return FALSE.

FWExamineNextObject() simply checks if an additional response is present.

FWExamineNextObjectGet() will assign the parameter attributeListPtr to point to the next response's Tcl keyed list of attribute-value pairs.

FWExamineNextObjectAction() will assign the parameter actionInfoPtr to point to the next response's "action" information.

Arguments


bmipSubmissionPtr
object class specific data pointer obtained from a prior call to FWInitObjectSubmission(3sadm).

attributeListPtr
pointer to a string of attributes along with their associated values in Tcl keyed-list format (see documentation on Tcl).

actionInfoPtr
pointer to a string of data returned by the FWObjectAction() defined in FWObjectOperations(3sadm).

errStatusPtr
A pointer to the error stack data structure. If an error occurs the appropriate error will be placed in the error stack. This data can be referenced using the library functions defined in Error(3sadm).

Examples

/* Obtain the information about all CD-ROM devices on the system */

#include <scoadmin/basicIncl.h> #include <scoadmin/callBack.h> #include <scoadmin/statusLst.h> #include <scoadmin/CAPI.h>

main() { frameWorkCClientData_cl *clientDataPtr; bmipSubmission_cl *bmipSubmissionPtr;

/* Set scoping and filtering parameters for later use. */ scopeParameter_pt scope ="1"; filterParameter_pt filter="type eq cdrom";

/* * Since we are looking at all of the devices, there is no specific * instance. */ objectInstance_pt instance="NULL";

/* Specifically look at the desc and mountpt attributes. */ char **attributes={"desc", "mountpt", "\0"};

/* Initialize the SCOadmin error stack. */ errStatus_cl *errStatusPtr=ErrorNew();

/* Variable used for the return value of ObjectGet(). */ attributeList_pt *attributeList;

/* Initialize general SCOadmin data structure. */ clientDataPtr=FWInitializeFrameWork();

/* Initialize class-specific SCOadmin data structures. */

/* Initialize communications to the "sco devices" class. */ bmipSubmissionPtr=FWInitObjectSubmission(clientDataPtr, "sco devices");

/* Identify this as a scoped request */ FWSetScope(bmipSubmissionPtr, scope);

/* Filter against the "type" attribute. Search only for type "cdrom". */ FWSetFilter(bmipSubmissionPtr, filter);

/* Actually get information from the object classes. */ attributeList=ObjectGet(bmipSubmissionPtr,instance,attributes,errStatusPtr); if( ! ErrorIsOk(errStatusPtr) ) { ErrorOutput(errStatusPtr, stderr, 0, argv[0]); exit(1); }

/* Output TCL keyedlist of attribute-values for each device */ while( FWExamineNextObjectGet( bmipSubmissionPtr, attributeList, errStatusPtr) == TRUE ) { if( ! ErrorIsOk(errStatusPtr) ) { puts(attributeList); } else { ErrorOutput(errStatusPtr, stderr, 0, argv[0]); } }

/* Unset filter parameters. */ FWUnSetScope(bmipSubmissionPtr); FWUnSetFilter(bmipSubmissionPtr);

/* Cleanup */ FWShutdownObjectSubmission(bmipSubmissionPtr); FWShutdownFrameWork(clientDataPtr); }

References

FWInitializeFrameWork(3sadm), FWInitObjectSubmission(3sadm), FWClassOperations(3sadm).
25 April 2004
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004