gpdefdim, gpdim, gpclonedim, gpdeldim - TDF dimension functions

SYNOPSIS

#include <gp.h>

DIMP gpdefdim(set, name, len)
SETP set;
char *name;
int len;

DIMP gpdim(set, name)
SETP set;
char *name;

DIMP gpclonedim(set, dim, name)
SETP set;
DIMP dim;
char *name;

int gpdeldim(dim)
DIMP dim;

DESCRIPTION

gpdefdim defines a dimension in the dataset indicated by set. name must have length no greater than GP_MAX_NAME. If set already has a dimension with the same name, an error occurs.

len must be greater than 0, or equal to GP_UNLIMITED. Note that a dataset can have no more than one unlimited dimension. If a second unlimited dimension is defined, the size of the former unlimited dimension becomes fixed.

gpdim returns the pointer to a dimension with a given name in a given dataset.

gpclonedim defines a new dimension similar to existing dimension dim in the dataset indicated by set. The new dimension will have the same size as dim. If a non-NULL name is passed, it is used as the name of the new dimension.

gpdeldim deletes a dimension from the dataset to which it belongs. A dimension cannot be deleted if it is the dimension of existing variables.

RETURN VALUES

gpdefdim, gpdim, and gpclonedim all return dimension pointers if successful. Otherwise they call *gperr() with the appropriate error code and return NULL.

gpdeldim returns 0 if successful. Otherwise it calls *gperr() with the appropriate error code and returns -1.

ERRORS

Insufficient memory to define new dimension.

Length is less than 1 and not equal to GP_UNLIMITED.

Dimension with the same name already exists in the output dataset.

Dataset does not have dimension with given name.

Invalid set pointer passed by application.

Invalid dimension pointer passed by application.

FILES

include/gp.h, /usr/include/errno.h, lib/libcdf.a

SEE ALSO

gpatt, gperr, gpio, gplink, gpname, gprel, gpset, gptype, gpvar, datasets

NOTES

None.


Last Update: $Date: 2001/12/14 21:21:52 $