gpdefrel, gprel, gpclonerel, gpdelrel - TDF relation functions

SYNOPSIS

#include <gp.h>

RELP gpdefrel(set, name, nvars, var)
SETP set;
char *name;
int nvars;
VARP var[];

RELP gprel(set, name)
SETP set;
char *name;

RELP gpclonerel(set, rel, name)
SETP set;
RELP rel;
char *name;

int gpdelrel(rel)
RELP rel;

DESCRIPTION

The functions described here manipulate TDF relations.

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

nvars must be greater than 0. var[] is an array of variables for the new relation.

gprel returns the pointer to a relation with a given name in a given dataset.

gpclonerel defines a new relation similar to the existing relation rel in the dataset indicated by set. The new relation will have the same attributes and named variables as rel. The variables of the new relation must already be defined in set. If a non-NULL name is passed, it will be used as the name of the new relation.

gpdelrel deletes a relation from the dataset to which is belongs.

RETURN VALUES

gpdefrel, gprel, and gpclonerel all return relation pointers if successful. Otherwise they call *gperr() with the appropriate error code and return NULL.

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

ERRORS

Insufficient memory to define new relation.

Invalid (non-positive) number of relation variables.

Attempt to relate variables in different datasets.

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

Dataset does not have relation with given name.

Invalid set pointer passed by application.

Invalid relation pointer passed by application.

FILES

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

SEE ALSO

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

NOTES

None.


Last Update: $Date: 2001/12/14 21:22:24 $