Function CDM_AttributeSetGetElements


Definition:#include <CDM.h>
Prototype:int CDM_AttributeSetGetElements(CDM_AttributeSet AttributeSet, int *objcPtr, CDM_Attribute **objvPtr);
Arguments:

AttributeSet: The Attribute set whose elements will be placed in the array. (CDM_AttributeSet)
objcPtr: A pointer to an integer, where the number of Attribute objects placed in the array will be saved. (int *)
objvPtr: A location where the pointer to the array of Attribute objects will be stored. (CDM_Attribute **)

C/C++ API Sections
Tcl API Sections
Description
Return Value
Notes
See Also
Index

Description:

This function returns a count and a pointer to an array of the elements (Attributes) in an Attribute set object (of type CDM_AttributeSet). It returns the count by storing it in the address pointed by the "objcPtr" parameter (of type int *). Similarly, it returns the array pointer by storing it in the address pointed by the "objvPtr" parameter (of type CDM_Attribute **). The memory pointed to is managed by CDM and should not be freed by the caller.

In case of an error, TCL_ERROR will be returned and an error message will be left in the current active Tcl interpreter (CDM_Interp). Otherwise TCL_OK will be returned after storing the count and array pointer.

Return Value:

This function returns a count and a pointer to an array of the elements (Attributes) in an Attribute set object (of type CDM_AttributeSet). It returns the count by storing it in the address pointed by the "objcPtr" parameter (of type int *). Similarly, it returns the array pointer by storing it in the address pointed by the "objvPtr" parameter (of type CDM_Attribute **). The memory pointed to is managed by CDM and should not be freed by the caller.

In case of an error, TCL_ERROR will be returned and an error message describing the error will be left at the current Tcl interpreter (CDM_Interp). Otherwise TCL_OK will be returned.

Notes:

Usage example:
      int objc;
      CDM_Attribute **objv;
      CDM_AttributeSet set = CDM_GetAttributes(Doc);
      int status = CDM_AttributeSetGetElements(set, objc, objv);
      if (status != TCL_OK) {
        // An error occured. What is the error message?
        Tcl_interp *interp = CDM_GetActiveInterpreter();
        if (interp) {
          const char* msg = Tcl_GetStringResult(interp);
        }
      }
      // Make an iteration over all Attributes...
      for (int i = 0; i < objc, i++) {
        // Now, objv[i] is an Attribute...
      }
      

See Also:

CDM_AnnotationSetGetElements, CDM_SpanSetGetElements


Generated by: petasis@aias on Wed Aug 16 10:31:57 PM EEST 2006.