gpdefatt, gpatt, gpgetatt, gpcopyatt, gpdelatt - TDF attribute functions

SYNOPSIS

#include <gp.h>

ATTP gpdefatt(ptr, name, type, len, value)
char *ptr;
char *name;
int type;
int len;
char *value;

ATTP gpatt(ptr, name)
char *ptr;
char *name;

int gpgetatt(ptr, name, value)
char *ptr;
char *name;
char *value;

ATTP gpcopyatt(to, att)
char *to;
ATTP att;

int gpdelatt(att)
ATTP att;

DESCRIPTION

The functions described here manipulate TDF attributes. Sets, variables, and relations all can have attributes.

gpdefatt defines a named attribute for the object represented by ptr, either a set, variable, or relation. name must have length no greater than GP_MAX_NAME. If the object already has an attribute with the same name, it is replaced.

type must be any of the valid types defined in include/gp.h. However, by far the most common attribute types are GP_LONG, GP_DOUBLE, and GP_STRING().

len is greater than one if the attribute is array-valued. Note that len = 1 is adequate for most string valued attributes, because string length is already implied in the GP_STRING() type.

An attribute value can optionally be supplied by passing a non-NULL pointer to the value.

gpatt returns the pointer to a named attribute of the object represented by ptr.

gpgetatt returns the value of a named attribute of the object represented by ptr.

gpcopyatt reads the definition and value of an attribute given by att, and creates a like attribute for the object represented by to. If the to object already has an attribute with the same name, it is replaced.

gpdelatt deletes an attribute specified by att from its owner.

RETURN VALUES

gpdefatt, gpatt, and gpcopyatt all return attribute pointers if successful. Otherwise they call *gperr with the appropriate error code and return NULL.

gpgetatt and gpdelatt return 0 if successful. Otherwise they call *gperr with the appropriate error code and return -1.

ERRORS

Insufficient memory to define new attribute.

Invalid attribute datatype.

Invalid attribute length.

Object does not have attribute with given name.

Invalid set pointer passed by application.

Invalid relation pointer passed by application.

Invalid variable pointer passed by application.

FILES

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

SEE ALSO

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

NOTES

None.


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