FLDget_cell_set

Synopsis

get one element of the cell_set array within a Cell_Data

int FLDget_cell_set (
OMobj_id field,
int i,
OMobj_id *cell_set);

Description

FLDget_cell_set discovers the OMobj_id of one element of the cell_set array within a Cell_Data. The OMobj_id so returned will be the first argument in any subsequent call, such as FLDget_ncells, FLDget_cell_data_ncomp, etc., that manipulates the Cell_Data Data_Array.

Note: There is no corresponding "set" call. Instead, use FLDget_cell_set to establish the pointer to the array, then fill in.

Note: The FLDset_cell_set routine has a different, unrelated purpose. It deals with Cell_Set groups (descriptions of the different types of cells), not these cell_set groups within Cell_Data groups, that hold cell data.

Parameters

OMobj_id field

The OMobj_id of a field that contains Cell_Data.

int i

An integer that specifies which cell_set [0-n]'s OMobj_id to return in the cell_set[ncell_sets] array.

OMobj_id *cell_set

A pointer to an OMobj_id in which the object id of the i'th cell_set array will be returned.

Examples

This example, some fragments from modules/labels.c, shows labels retrieving the labels from each cell_set.

int cell_data_labels(obj_id)
OMobj_id obj_id;
{
OMobj_id in, out, cell_set;
int stat, nsets, cs, comp, ncomp, i, found, count;
char label[MAX_LABEL_SIZE], *data_labels[256];

in = OMfind_subobj(obj_id, OMstr_to_name("in"), OM_OBJ_RD);
out = OMfind_subobj(obj_id, OMstr_to_name("labels"), OM_OBJ_RW);

if (FLDget_ncell_sets(in, &nsets)!= 1) {
return(0);
}
count = 0;
for (cs=0; cs<nsets; cs++) {
if (FLDget_cell_set(in, cs, &cell_set)!= 1) {
ERR_RETURN("cannot get cell set");
}
if (FLDget_cell_data_ncomp(cell_set, &ncomp)!= 1) {
ERR_RETURN("cannot get cell ncomp");
}
for (comp=0; comp<ncomp; comp++) {
stat = FLDget_cell_data_label(cell_set, comp, label,
MAX_LABEL_SIZE);
if (stat < 0)
return(stat);
else if (stat == 0)
strcpy(label, "");
...

Files

v/fld.v.

See Also

FLDget_ncell_sets
FLDget_ncells
FLDget_cell_data_ncomp