cgio_get_node_id(int cgio_num, double pid, const char *pathname, double *id)¶cgio_num |
IN: Database identifier. |
pid |
IN: Parent node identifier. |
pathname |
IN: Absolute or relative path name for a node. |
id |
OUT: Node identifier. |
ier - Error status
r w m
Gets the node identifier for the node specified by pathname in the database given by cgio_num.
if pathname starts with '/', then it is taken as an absolute path and is located based on the root id of the database,
otherwise it is taken to be a relative path from the parent node identifed by pid.
The function returns 0 and the node identifier in id on success, else an error code.
cgio_get_name(int cgio_num, double id, char *name)¶cgio_num |
IN: Database identifier. |
id |
IN: Node identifier. |
name |
OUT: Node name (max length 32). |
ier - Error status
r w m
Gets the name of the node identified by id in the database given by cgio_num.
The name is returned in name, and has a maximum length of CGIO_MAX_NAME_LENGTH (32).
In C, name should be dimensioned at least 33 to allow for the terminating '0'.
The function returns 0 for success, else an error code.
cgio_set_name(int cgio_num, double pid, double id, const char *name)¶cgio_num |
IN: Database identifier. |
pid |
IN: Parent node identifier. |
id |
IN: Node identifier. |
name |
IN: Node name (max length 32). |
ier - Error status
- w m
Sets (renames) the node identied by id in the database given by cgio_num to name.
The parent node identifier is given by pid. There must not already exist a child node of pid with that name. The function return 0 on success, else an error code.
cgio_get_label(int cgio_num, double id, char *label)¶cgio_num |
IN: Database identifier. |
id |
IN: Node identifier. |
label |
OUT: Node label (max length 32). |
ier - Error status
r w m
Gets the label of the node identified by id in the database given by cgio_num. The label is returned in label, and has a maximum length of CGIO_MAX_LABEL_LENGTH (32). In C, label should be dimensioned at least 33 to allow for the terminating ‘0’. The function returns 0 for success, else an error code.
cgio_set_label(int cgio_num, double id, const char *label)¶cgio_num |
IN: Database identifier. |
id |
IN: Node identifier. |
label |
IN: Node label (max length 32). |
ier - Error status
- w m
Sets the label of the node identied by id in the database given by cgio_num to label.
The function return 0 on success, else an error code.
cgio_get_data_type(int cgio_num, double id, char *data_type)¶cgio_num |
IN: Database identifier. |
id |
IN: Node identifier. |
data_type |
OUT: Type of data contained in the node. One of “MT”, “I4”, “I8”, “U4”, “U8”, “R4”, “R8, “C1”, or “B1”. |
ier - Error status
r w m
Gets the data type of the data associated with the node identified by id in the database given by cgio_num.
The data type is returned in data_type, and has a maximum length of CGIO_MAX_DATATYPE_LENGTH (2).
In C, data_type should be dimensioned at least 3 to allow for the terminating '0'.
The function returns 0 for success, else an error code.
cgio_get_dimensions(int cgio_num, double id, int *ndims, cgsize_t *dims)¶cgio_num |
IN: Database identifier. |
id |
IN: Node identifier. |
ndims |
OUT: Number of dimensions for the data (max 12). |
dims |
OUT: Data dimension values (ndims values). |
ier - Error status
r w m
Gets the dimensions of the data associated with the node identified by id in the database given by cgio_num.
The number of dimensions is returned in ndims and the dimension values in dims.
Since the maximum number of dimensions is CGIO_MAX_DIMENSIONS (12), dims should be dimensioned 12, unless the actual number of dimensions is already known.
The function returns 0 for success, else an error code.
cgio_set_dimensions(int cgio_num, double id, const char *data_type, int ndims, const cgsize_t *dims)¶cgio_num |
IN: Database identifier. |
id |
IN: Node identifier. |
data_type |
IN: Type of data contained in the node. One of “MT”, “I4”, “I8”, “U4”, “U8”, “R4”, “R8, “C1”, or “B1”. |
ndims |
IN: Number of dimensions for the data (max 12). |
dims |
IN: Data dimension values (ndims values). |
ier - Error status
- w m
Sets the data type and dimensions for data associated with the node identified by id in the database given by cgio_num.
The data type (data_type) as one of:
| “MT” | An empty node containing no data |
| “I4” | 32-bit integer (int or integer*4) |
| “I8” | 64-bit integer (cglong_t or integer*8) |
| “U4” | 32-bit unsigned integer (unsigned int or integer*4) |
| “U8” | 64-bit unsigned integer (cgulong_t or integer*8) |
| “R4” | 32-bit real (float or real*4) |
| “R8” | 64-bit real (double or real*8) |
| “X4” | 64-bit complex (complex or complex*8) |
| “X8” | 128-bit complex (complex double or complex*16) |
| “C1” | character (char or character) |
| “B1” | unsigned bytes (unsigned char or character*1) |
The number of dimensions is given by ndims (maximum is 12), and the dimension values by dims. Note that any existing data for the node will be destroyed. To add the data to the node, use one of the data writing routines.
The function returns 0 for success, else an error code.