int kdms_define_quasi_attribute(
char *association,
char *attribute,
kaddr client_data,
kfunc_int *get,
kfunc_int *set,
kfunc_int *match,
kfunc_int *copy,
kfunc_int *query,
kfunc_int *print)
The get handler declaration is of the form :
int get_handler( kobject object, ktoken association, ktoken attribute, kaddr client_data, kva_list *list)
The object is passed from the calling get function. The association is the tokenized representation of the segment argument from the get function. The attribute is the tokenized representation of the attribute name. The client_data is the client_data from this definition. The variable argument list is an already opened varargs list which contains the pointers with which to return the attribute data. The variable arguments can be pulled off with the kva_arg() function. The list will be closed after this handler returns. The return value of this handler will also be propogated up to be the return value of the calling get function.
The set handler declaration is of the form :
int set_handler( kobject object, ktoken association, ktoken attribute, kaddr client_data, kva_list *list)
The object is passed from the calling set function. The association is the tokenized representation of the segment argument from the set function. The attribute is the tokenized representation of the attribute name. The client_data is the client_data from this definition. The variable argument list is an already opened varargs list which contains the data with which to set the attribute data. The variable arguments can be pulled off with the kva_arg() function. The list will be closed after this handler returns. The return value of this handler will also be propogated up to be the return value of the calling set function.
The match handler declaration is of the form :
int match_handler( kobject object1, kobject object2, ktoken association, ktoken attribute, kaddr client_data1, kaddr client_data2)
The object1 and object2 arguments are passed from the calling match function. The association is the tokenized representation of the segment argument from the match function. The attribute is the tokenized representation of the attribute name. The client_data1 and client_data2 arguments are from from this definition. The return value of this handler will also be propogated up to be the return value of the calling match function.
The copy handler declaration is of the form :
int copy_handler( kobject object1, kobject object2, ktoken association, ktoken attribute, kaddr client_data1, kaddr client_data2)
The object1 and object2 arguments are passed from the calling copy function. The association is the tokenized representation of the segment argument from the copy function. The attribute is the tokenized representation of the attribute name. The client_data1 and client_data2 arguments are from from this definition. The return value of this handler will also be propogated up to be the return value of the calling copy function.
The query handler declaration is of the form :
int query_handler( kobject object, ktoken association, ktoken attribute, kaddr client_data, int *num_args, int *arg_size, int *data_type, int *permanent)
The object is passed in from the calling query function. The association is the tokenized representation of the segment argument from the query function. The attribute is the tokenized representation of the attribute name. The client_data argument is from from this definition. The num_args argument can be used to return the expected number of arguments for this attribute. The arg_size argument can be used to return the expected argument size for this attribute. The data_type argument can be used to return the expected data type for this attribute. The permanent argument can be used to indicate if this attribute is stored or not. Note that it is up to the programmer to ensure that the values which the handler returns for any of those arguments matches what is going to be processed in the get and set handlers. The return value of this handler will be propogated up to be the return value of the calling query function. In general, a value of TRUE is interpreted to mean that the attribute 'exists'.
The print handler declaration is of the form :
int print_handler( kobject object, ktoken association, ktoken attribute, kaddr client_data, kfile *outfile)
The object is passed in from the calling print function. The association is the tokenized representation of the segment argument from the print function. The attribute is the tokenized representation of the attribute name. The client_data argument is from from this definition. The outfile argument is the (hopefully) open khoros transort which this handler can use to print the attribute to. The return value of this handler will be propogated up to be the return value of the calling print function.
none
This quasi-attribute definition will be used to determine what action should be taken on a get, set, match, copy or print attribute call. On any kdms attribute call for this attribute, the relevant action handler provided in this definition will be called or invoked.
This attribute definition is distinguished by the attribute name provided here. The name must be a string, unique for the given association.
In each attribute call, a segment argument will be provided to give scope to the attribute. The association given in this definition is used to determine the allowable scope of the attribute. Attributes can be either scoped to the main object (object-level) or scoped to any of the object's data segments (segment-level).
The provided association is simply a string. A NULL association indicates that the attribute can only be invoked when NULL is passed in as the segment argument. An association of KDMS_ALL_SEGMENTS indicates that the attribute can be invoked at the segment level for any segment name except for NULL. If a specific segment name, such as "value" is given for the association, then the attribute can only invoked when "value" is provided as the segment name.
This quasi-attribute can be undefined with the kdms_undefine_attribute call.
none
none
$DATASERV/objects/library/kdataman/src/attributes.c