DATASERV (koldgeom) functions


LIBRARY ROUTINE

kgeom_create_attribute - create an attribute associated the data object.

LIBRARY CALL

int kgeom_create_attribute(
   kobject object,
   char *name,
   int num,
   int length,
   int type,
   int permanence,
   int shared)

INPUT

OUTPUT

none

RETURN VALUE

TRUE (1) on success, FALSE (0) otherwise

DESCRIPTION

kgeom_create_attribute is part of Geometry Data Services. The purpose of this routine is to provide the programmer with a mechanism for creating attributes that are specific to the program being written. The attribute created will be associated with the data object itself and not with the value, mask or map data.

The second argument to this function is the name of the attribute to be created. If the attribute specified already exists then this function will return FALSE.

The type argument indicates the data type of all the elements associated with the attribute. It take on any of the following values: KBIT, KUBYTE, KBYTE, KUSHORT, KSHORT, KUINT, KINT, KULONG, KLONG, KFLOAT, KDOUBLE, KCOMPLEX, or KDCOMPLEX. Any other value is considered illegal. Passing this argument with an illegal value will force this function to return FALSE.

The num argument indicates how many of elements of the type "type" will be contained in the attribute. This information is necessary so that Geometry Services can allocate sufficient memory to store the attribute. A negative or 0 value passed in will force this function to return FALSE.

The length argument indicates the size of each element, i.e. you could be passing in a pointer to an array of integers or several arrays if num greater than 1. This information is necessary so that Geometry Services can allocate sufficient memory to store the attribute. This argument specifies the length of the array that needs to be allocated. A negative or 0 value passed in will force this function to return FALSE.

The last argument, permanence indicates whether the attribute should be saved when the data object is closed and being stored in a permanent transport. It should be set to TRUE if the attribute is permanent and FALSE if the attribute is transient.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

The length variable indicates the length of all the attribute elements. If different size length are desired, different attributes must be created.

MODIFICATION

none

FILES

$DATASERV/include/koldgeom/kgeometry.h

SEE ALSO

koldgeom(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.