OC Updated for version 2.0
Functions
Node Management

Functions

OCerror oc_dds_properties (OCobject link, OCobject ddsnode, char **namep, OCtype *octypep, OCtype *atomtypep, OCobject *containerp, size_t *rankp, size_t *nsubnodesp, size_t *nattrp)
OCerror oc_dds_name (OCobject link, OCobject ddsnode, char **namep)
OCerror oc_dds_nsubnodes (OCobject link, OCobject ddsnode, size_t *nsubnodesp)
OCerror oc_dds_atomictype (OCobject link, OCobject ddsnode, OCtype *typep)
OCerror oc_dds_class (OCobject link, OCobject ddsnode, OCtype *typep)
OCerror oc_dds_rank (OCobject link, OCobject ddsnode, size_t *rankp)
OCerror oc_dds_attr_count (OCobject link, OCobject ddsnode, size_t *nattrp)
OCerror oc_dds_root (OCobject link, OCobject ddsnode, OCobject *rootp)
OCerror oc_dds_container (OCobject link, OCobject ddsnode, OCobject *containerp)
OCerror oc_dds_ithfield (OCobject link, OCobject ddsnode, size_t index, OCobject *fieldnodep)
OCerror oc_dds_gridarray (OCobject link, OCobject grid, OCobject *arraynodep)
OCerror oc_dds_gridmap (OCobject link, OCobject grid, size_t index, OCobject *mapnodep)
OCerror oc_dds_dimensions (OCobject link, OCobject ddsnode, OCobject *dims)
OCerror oc_dds_ithdimension (OCobject link, OCobject ddsnode, size_t index, OCobject *dimidp)
OCerror oc_dimension_properties (OCobject link, OCobject ddsnode, size_t *sizep, char **namep)
OCerror oc_dds_dimensionsizes (OCobject link, OCobject ddsnode, size_t *dimsizes)
OCerror oc_dds_attr (OCobject link, OCobject ddsnode, size_t index, char **namep, OCtype *octypep, size_t *nvaluesp, char **strings)
void oc_reclaim_strings (size_t n, char **svec)
OCerror oc_das_attr_count (OCobject link, OCobject dasnode, size_t *nvaluesp)
OCerror oc_das_attr (OCobject link, OCobject dasnode, size_t index, OCtype *etypep, char **valuep)

Function Documentation

OCerror oc_das_attr ( OCobject  link,
OCobject  dasnode,
size_t  index,
OCtype etypep,
char **  valuep 
)

The procedure oc_das_attr returns the i'th string value associated with a DAS object of type OC_Attribute. Note carefully that this operation applies to DAS nodes and not to DDS or DATADDS nodes. Note also that the returned value is always a string and it is the caller;'s responsibility to free the returned string.

Parameters:
[in]linkThe link through which the server is accessed.
[in]dasnodeThe DAS node of interest.
[in]indexThe index of the das value to return.
[in]etypepA pointer into which is stored the atomic type of the attribute.
[out]valuepA vector into which the attribute's string values are stored. Caller must allocate and free.
Return values:
OC_NOERRThe procedure executed normally.
OC_EBADTPEIf the node is not of type OC_Attribute.
OC_EINDEXIf the index is larger than the number of attributes.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 750 of file oc.c.

References OC_Attribute, OC_EBADTYPE, OC_EINDEX, OC_NOERR, OCDEREF, and OCVERIFY.

OCerror oc_das_attr_count ( OCobject  link,
OCobject  dasnode,
size_t *  nvaluesp 
)

Return the count of DAS attribute values.

Parameters:
[in]linkThe link through which the server is accessed.
[in]dasnodeThe node of interest
[out]nvaluespA pointer into which the number of attributes is stored.
Return values:
OC_NOERRThe procedure executed normally.
OC_EBADTPEIf the node is not of type OC_Attribute.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 717 of file oc.c.

References OC_Attribute, OC_EBADTYPE, OC_NOERR, OCDEREF, and OCVERIFY.

OCerror oc_dds_atomictype ( OCobject  link,
OCobject  ddsnode,
OCtype typep 
)

Specialized accessor function as an alternative to oc_dds_properties.

Parameters:
[in]linkThe link through which the server is accessed.
[in]ddsnodeThe node whose properties are of interest.
[out]typepA pointer into which the atomictype is stored.
Return values:
OC_NOERRThe procedure executed normally.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 318 of file oc.c.

References OC_NOERR, OCDEREF, and OCVERIFY.

OCerror oc_dds_attr ( OCobject  link,
OCobject  ddsnode,
size_t  index,
char **  namep,
OCtype octypep,
size_t *  nvaluesp,
char **  strings 
)

Return the name, type, length, and values associated with the i'th attribute of a specified node. The actual attribute strings are returned and the user must do any required conversion based on the octype. The strings argument must be allocated and freed by caller. Standard practice is to call twice, once with the strings argument == NULL so we get the number of values, then the second time with an allocated char** vector. The caller should reclaim the contents of the returned string vector using oc_reclaim_strings.

Parameters:
[in]linkThe link through which the server is accessed.
[in]ddsnodeThe node of interest
[in]indexReturn the information of the index'th attribute.
[out]namepA pointer into which the attribute's name is stored. It must be freed by the caller.
[out]octypepA pointer into which the attribute's atomic type is stored.
[out]nvaluespA pointer into which the number of attribute values is stored.
[out]stringsA vector into which the values of the attribute are stored. It must be allocated and free'd by the caller.
Return values:
OC_NOERRThe procedure executed normally.
OC_EINDEXIf the index is more than the number of attributes.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 663 of file oc.c.

References OC_EINDEX, OC_NOERR, OCDEREF, and OCVERIFY.

OCerror oc_dds_attr_count ( OCobject  link,
OCobject  ddsnode,
size_t *  nattrp 
)

Specialized accessor function as an alternative to oc_dds_properties.

Parameters:
[in]linkThe link through which the server is accessed.
[in]ddsnodeThe node whose properties are of interest.
[out]nattrpA pointer into which the number of attributes is stored.
Return values:
OC_NOERRThe procedure executed normally.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 381 of file oc.c.

References OC_Attribute, OC_NOERR, OCDEREF, and OCVERIFY.

OCerror oc_dds_class ( OCobject  link,
OCobject  ddsnode,
OCtype typep 
)

Specialized accessor function as an alternative to oc_dds_properties.

Parameters:
[in]linkThe link through which the server is accessed.
[in]ddsnodeThe node whose properties are of interest.
[out]typepA pointer into which the octype is stored.
Return values:
OC_NOERRThe procedure executed normally.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 339 of file oc.c.

References OC_NOERR, OCDEREF, and OCVERIFY.

OCerror oc_dds_container ( OCobject  link,
OCobject  ddsnode,
OCobject containerp 
)

Specialized accessor function as an alternative to oc_dds_properties.

Parameters:
[in]linkThe link through which the server is accessed.
[in]ddsnodeThe node whose properties are of interest.
[out]containerpA pointer into which the the immediate container ddsnode is stored.
Return values:
OC_NOERRThe procedure executed normally.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 431 of file oc.c.

References OC_NOERR, OCDEREF, and OCVERIFY.

OCerror oc_dds_dimensions ( OCobject  link,
OCobject  ddsnode,
OCobject dims 
)

Obtain the dimension nodes (of octype OC_Dimension) associated with the node of interest.

Parameters:
[in]linkThe link through which the server is accessed.
[in]ddsnodeThe dds node of interest.
[out]dimsA vector into which the dimension nodes are stored. The caller must allocate based on the rank of the node.
Return values:
OC_NOERRThe procedure executed normally.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 527 of file oc.c.

References OC_ESCALAR, OC_NOERR, OCDEREF, and OCVERIFY.

OCerror oc_dds_dimensionsizes ( OCobject  link,
OCobject  ddsnode,
size_t *  dimsizes 
)

Obtain just the set of sizes of the dimensions associated with a dds node.

Parameters:
[in]linkThe link through which the server is accessed.
[in]ddsnodeThe node of interest
[out]dimsizesA vector into which the sizes of all the dimensions of a node are stored. Its size is determined by the rank of the node and must be allocated and free'd by the caller.
Return values:
OC_NOERRThe procedure executed normally.
OC_ESCALARIf the node is a scalar.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 618 of file oc.c.

References OC_ESCALAR, OC_NOERR, OCDEREF, and OCVERIFY.

OCerror oc_dds_gridarray ( OCobject  link,
OCobject  grid,
OCobject arraynodep 
)

Obtain the DDS node corresponding to the array of a Grid container. Equivalent to oc_dds_ithfield(link,grid-container,0,arraynode).

Parameters:
[in]linkThe link through which the server is accessed.
[in]gridThe grid container node of interest.
[out]arraynodepA pointer into which the grid array node is stored.
Return values:
OC_NOERRThe procedure executed normally.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 487 of file oc.c.

References oc_dds_ithfield().

OCerror oc_dds_gridmap ( OCobject  link,
OCobject  grid,
size_t  index,
OCobject mapnodep 
)

Obtain the DDS node corresponding to the i'th map of a Grid container. Equivalent to oc_dds_ithfield(link,grid-container,index+1,arraynode). Note the map index starts at zero.

Parameters:
[in]linkThe link through which the server is accessed.
[in]gridThe grid container node of interest.
[in]indexThe (zero-based) index of the map node to return.
[out]mapnodepA pointer into which the grid map node is stored.
Return values:
OC_NOERRThe procedure executed normally.
OC_EINDEXThe map index is illegal.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 508 of file oc.c.

References oc_dds_ithfield().

OCerror oc_dds_ithdimension ( OCobject  link,
OCobject  ddsnode,
size_t  index,
OCobject dimidp 
)

Obtain the i'th dimension node (of octype OC_Dimension) associated with the node of interest.

Parameters:
[in]linkThe link through which the server is accessed.
[in]ddsnodeThe dds node of interest.
[in]indexThe index of the dimension to be returned.
[out]dimidpA pointer into which the index'th dimension is stored.
Return values:
OC_NOERRThe procedure executed normally.
OC_EINDEXThe index is greater than the node's rank.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 560 of file oc.c.

References OC_EINDEX, OC_ESCALAR, OC_NOERR, OCDEREF, and OCVERIFY.

OCerror oc_dds_ithfield ( OCobject  link,
OCobject  ddsnode,
size_t  index,
OCobject fieldnodep 
)

Obtain the DDS node corresponding to the i'th field of a node that itself is a container (Dataset, Structure, Sequence, or Grid)

Parameters:
[in]linkThe link through which the server is accessed.
[in]ddsnodeThe container node of interest.
[in]indexThe index (starting at zero) of the field to return.
[out]fieldnodepA pointer into which the i'th field node is stored.
Return values:
OC_NOERRThe procedure executed normally.
OC_EINDEXThe index was greater than the number of fields.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 456 of file oc.c.

References OC_EBADTYPE, OC_EINDEX, OC_NOERR, OCDEREF, and OCVERIFY.

Referenced by oc_dds_gridarray(), and oc_dds_gridmap().

OCerror oc_dds_name ( OCobject  link,
OCobject  ddsnode,
char **  namep 
)

Specialized accessor function as an alternative to oc_dds_properties.

Parameters:
[in]linkThe link through which the server is accessed.
[in]ddsnodeThe node whose properties are of interest.
[out]namepA pointer into which the node name is stored as a null terminated string. The caller must free this value when no longer needed.
Return values:
OC_NOERRThe procedure executed normally.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 271 of file oc.c.

References OC_EINVAL, OC_NOERR, OCDEREF, and OCVERIFY.

OCerror oc_dds_nsubnodes ( OCobject  link,
OCobject  ddsnode,
size_t *  nsubnodesp 
)

Specialized accessor function as an alternative to oc_dds_properties.

Parameters:
[in]linkThe link through which the server is accessed.
[in]ddsnodeThe node whose properties are of interest.
[out]nsubnodespA pointer into which the number of subnodes is stored.
Return values:
OC_NOERRThe procedure executed normally.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 297 of file oc.c.

References OC_NOERR, OCDEREF, and OCVERIFY.

OCerror oc_dds_properties ( OCobject  link,
OCobject  ddsnode,
char **  namep,
OCtype octypep,
OCtype atomtypep,
OCobject containerp,
size_t *  rankp,
size_t *  nsubnodesp,
size_t *  nattrp 
)

This procedure returns a variety of properties associated with a specific node. Any of the pointers may be NULL in the following procedure call; If the node is of type Dataset, then return # of global attributes If the node is of type Attribute, then return the # of values in nattrp.

Parameters:
[in]linkThe link through which the server is accessed.
[in]ddsnodeThe node whose properties are of interest.
[out]namepPointer for storing the node's associated name. The caller must free the returned name.
[out]octypepPointer for storing the node's octype.
[out]atomtypepPointer for storing the object's atomic type (i.e. OC_NAT .. OC_URL);only defined when the object's octype is OC_Atomic
[out]containerpPointer for storing the OCnode for which this object is a subnode. The value OCNULL is stored if the object is a root object.
[out]rankpPointer for storing the rank (i.e. the number of dimensions) for this object; zero implies a scalar.
[out]nsubnodespPointer for storing the number of subnodes of this object.
[out]nattrpPointer for storing the number of attributes associated with this object.
Return values:
OC_NOERRThe procedure executed normally.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 228 of file oc.c.

References OC_Attribute, OC_NOERR, OCDEREF, and OCVERIFY.

OCerror oc_dds_rank ( OCobject  link,
OCobject  ddsnode,
size_t *  rankp 
)

Specialized accessor function as an alternative to oc_dds_properties.

Parameters:
[in]linkThe link through which the server is accessed.
[in]ddsnodeThe node whose properties are of interest.
[out]rankpA pointer into which the rank is stored.
Return values:
OC_NOERRThe procedure executed normally.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 360 of file oc.c.

References OC_NOERR, OCDEREF, and OCVERIFY.

OCerror oc_dds_root ( OCobject  link,
OCobject  ddsnode,
OCobject rootp 
)

Specialized accessor function as an alternative to oc_dds_properties.

Parameters:
[in]linkThe link through which the server is accessed.
[in]ddsnodeThe node whose properties are of interest.
[out]rootpA pointer into which the the root of the tree containing the node is stored.
Return values:
OC_NOERRThe procedure executed normally.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 409 of file oc.c.

References OC_NOERR, OCDEREF, and OCVERIFY.

OCerror oc_dimension_properties ( OCobject  link,
OCobject  ddsnode,
size_t *  sizep,
char **  namep 
)

Obtain the properties of a dimension node.

Parameters:
[in]linkThe link through which the server is accessed.
[in]ddsnodeThe dimension node.
[out]sizepA pointer into which to store the size of the dimension.
[out]namepA pointer into which to store the name of the dimension. If the dimension is anonymous, then the value NULL is returned as the name. The caller must free the returned name.
Return values:
OC_NOERRThe procedure executed normally.
OC_BADTYPEIf the node is not of type OC_Dimension.
OtherErrorOne of the arguments (link, etc.) was invalid.

Definition at line 590 of file oc.c.

References OC_Dimension, OC_EBADTYPE, OC_NOERR, OCDEREF, and OCVERIFY.

void oc_reclaim_strings ( size_t  n,
char **  svec 
)

Given a counted vector of strings, free up all of the strings, BUT NOT THE VECTOR since that was allocated by the caller.

Parameters:
[in]nThe link through which the server is accessed.
[in]svecThe node of interest.

Definition at line 697 of file oc.c.