An attribute’s metadata is represented by a CS_ATTRIBUTE structure:
typedef struct _cs_attribute
{
CS_OID attr_type;
CS_INT attr_syntax;
CS_INT attr_numvals;
} CS_ATTRIBUTE;
where:
attr_type is a CS_OID structure that uniquely describes the type of the attribute. This field tells the application which of an object’s attributes it has received.
attr_syntax is a syntax specifier that tells how the attribute value is expressed. Attribute values are passed within a CS_ATTRVALUE union, and the syntax specifier tells which member of the union to use.
attr_numvals tells how many values the attribute contains. This information can be used to size an array of CS_ATTRVALUE unions to hold the attribute values.
An attribute’s value(s) are represented by a CS_ATTRVALUE union:
typedef struct _cs_ds_lookup_info
{
CS_OID *objclass;
CS_CHAR *path;
CS_INT pathlen;
CS_DS_OBJECT *attrfilter;
CS_DS_OBJECT *attrselect;
} CS_DS_LOOKUP_INFO;
Applications check the syntax field of the CS_ATTRIBUTE structure to determine which member of a CS_ATTRVALUE union contains the actual value. The following table shows the correspondence:
CS_ATTRIBUTE syntax specifier |
CS_ATTRVALUE union member |
---|---|
CS_ATTR_SYNTAX_STRING |
value_string |
CS_ATTR_SYNTAX_BOOLEAN |
value_boolean |
CS_ATTR_SYNTAX_INTEGER |
value_integer |
CS_ATTR_SYNTAX_TRANADDR |
value_tranaddr |
CS_ATTR_SYNTAX_OID |
value_oid |
Figure 9-1 shows an exploded view of the CS_ATTRVALUE union and its member structures: