Function CDM_AnnotationSetGetElements


Definition:#include <CDM.h>
Prototype:int CDM_AnnotationSetGetElements(CDM_AnnotationSet AnnotationSet, int *objcPtr, CDM_Annotation **objvPtr);
Arguments:

AnnotationSet: The Annotation set whose elements will be placed in the array. (CDM_AnnotationSet)
objcPtr: A pointer to an integer, where the number of Annotation objects placed in the array will be saved. (int *)
objvPtr: A location where the pointer to the array of Annotation objects will be stored. (CDM_Annotation **)

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 (Annotations) in an Annotation set object (of type CDM_AnnotationSet). 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_Annotation **). 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 (Annotations) in an Annotation set object (of type CDM_AnnotationSet). 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_Annotation **). 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_Annotation **objv;
      CDM_AnnotationSet set = CDM_GetAnnotations(Doc);
      int status = CDM_AnnotationSetGetElements(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 Annotations...
      for (int i = 0; i < objc, i++) {
        // Now, objv[i] is an Annotation...
      }
      

See Also:

CDM_AttributeSetGetElements, CDM_SpanSetGetElements


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