DATASERV (kappserv) functions


LIBRARY ROUTINE

kpds_create_object_attr - create an attribute associated the data object.

LIBRARY CALL

int kpds_create_object_attr(
   kobject object,
   char   *attribute,
   int     num_args,
   int     arg_size,
   int     data_type,
   int     permanent,
   int     shared)

INPUT

OUTPUT

none

RETURN VALUE

TRUE on success, FALSE otherwise

DESCRIPTION

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, Map, Location or Time data.

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

The datatype argument indicates the data type of all the elements associated with the attribute. It take on any of the following values: 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 numargs argument indicates how many of elements of the type "datatype" will be contained in the attribute. This information is necessary so that Polymorphic Services can allocate sufficient memory to store the attribute. A negative or 0 value passed in will force this function to return FALSE.

The argsize 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 Polymorphic Services can allocate sufficient memory to store the attribute. This argument specifies the length of the array that needs to be allocated.

The last argument, permanent, 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.

For example, calling this function as follows:

kpds_create_object_attr(object, "Nose", 1, 10, KFLOAT, FALSE);

will create an attribute called "Nose" that contains 10 floats that are accessed as a single array. A call to kpds_get_attribute might look like this:

float *array; kpds_get_attribute(object, "Nose", &array);

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/kappserv/kpolymorphic.h

SEE ALSO

kappserv(3)

COPYRIGHT

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