DATASERV (kdataman) functions


LIBRARY ROUTINE

kdms_define_quasi_attribute - define a quasi attribute

LIBRARY CALL

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)

INPUT

OUTPUT

none

RETURN VALUE

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

DESCRIPTION

This routine will define a data services quasi-attribute for a session. A quasi-attribute is one which does not technically have any data associated with it, but one for which a given action will be invoked. From the higher level programmer's point of view, a quasi-attribute will behave identically to a generic attribute. The higher-level function calls will be identical. That is, the same get, set, match, query, and print attribute functions will work on both quasi-attributes and generic attributes. Quasi-attributes are provided simply to allow an application service programmer the ability to provide their own custom functionality for an attribute.

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.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

$DATASERV/objects/library/kdataman/src/attributes.c

SEE ALSO

kdataman(3)

COPYRIGHT

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