DATASERV (kdataman) functions


LIBRARY ROUTINE

kdms_match_attribute - returns TRUE if the same segment attribute in two abstract data objects match.

LIBRARY CALL

int
kdms_match_attribute(
   kobject object1,
   kobject object2,
   char   *segment,
   char   *attribute)

INPUT

OUTPUT

none

RETURN VALUE

There are three ways for this routine to return a FALSE: (1) if the attribute in the two objects does not match; (2) if either object does not contain the specified attribute; (3) an error condition resulting from an invalid object or segment. If none of these three conditions exist, then this function will return TRUE.

DESCRIPTION

The purpose of this routine is to allow the programmer to compare a single attribute between two data objects.

Data services manages two sets of attributes with each object. Internally, they are referred to as the physical attributes and the presentation attributes. The presentation version of an attribute is the value that is desired by the programmer. The corresponding physical attribute is what is physically stored on the file or transport associated with the object. If the two versions of an attribute result in different presentations of data, then data services automatically translates the data from the physical interpretation to the presentation interpretation, or visa-versa, as appropriate. For example, if the data type attribute (KDMS_DATA_TYPE) is physically unsigned int (KULONG), but the presentation value of that attribute is float (KFLOAT), then data services will retrieve the data from the object and and cast it to float before returning it to the user. Similar behavior will occur for attributes such as index order (KDMS_INDEX_ORDER) and size (KDMS_SIZE).

The presentation attributes are settable at any time throughout a object's lifetime. The physical attributes, however, at some point are locked and thereafter cannot change. An object that was opened as an input object (via kdms_input or kdms_open) has its physical attributes locked immediately.

This routine will return TRUE if the specified attribute has the same value in both of the abstract data objects. This routine will return FALSE if the attribute does not have the same value in both of of the objects kdms_match_attribute will also return FALSE if the attribute does not exist in either or both of the objects.

If the segment argument is NULL, then that implies that the attribute is a a global attribute in each of the abstract data objects.

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.