int kpds_create_object_attr(
kobject object,
char *attribute,
int num_args,
int arg_size,
int data_type,
int permanent,
int shared)
numargs - number of arguments in the attribute; must be > 0;
argsize - number of units of the data type for each attribute argument must be > 0;
datatype - data type of the attribute can be KBIT, KUBYTE, KBYTE, KUSHORT, KSHORT, KUINT, KINT, KULONG, KLONG, KFLOAT KDOUBLE, KCOMPLEX, KDCOMPLEX, or KSTRING
none
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);
none
none
$DATASERV/include/kappserv/kpolymorphic.h