#### Descriptor Lists

A public object is represented by a sequence of OM_descriptor data structures that is built by the application program. A descriptor contains the type, syntax, and value for an OM attribute in a public object.

The data structure OM_descriptor is defined in the xom.h header file as follows:

typedef struct OM_descriptor_struct {

OM_type type;

OM_syntax syntax;

union OM_value_union value;

}OM_descriptor;

The following figure shows the representation of a public object in a descriptor list. The first descriptor in the list indicates the object's OM class; the last descriptor is a NULL descriptor that signals the end of the list of OM attributes. In between the first and the last descriptor are the descriptors for the OM attributes of the object.

For example, the following represents the public object country in example.c:

static OM_descriptor country[] = {

OM_OID_DESC(OM_CLASS, DS_C_AVA),

OM_OID_DESC(DS_ATTRIBUTE_TYPE, DS_A_COUNTRY_NAME),

{ DS_ATTRIBUTE_VALUES,OM_S_PRINTABLE_STRING,OM_STRING("US") },

OM_NULL_DESCRIPTOR

};

A Representation of a Public Object By Using a Descriptor List

The descriptor list is an array of data type OM_descriptor that defines the OM class, OM attribute types, syntax, and values that make up a public object.

The first descriptor gives the OM class of the object. The OM class of the object is defined by the OM attribute type, OM_CLASS. The OM_OID_DESC macro initializes the syntax and value of an object identifier, in this case to OM class DS_C_AVA, with the syntax of OM_S_OBJECT_IDENTIFIER_STRING. OM_S_OBJECT_IDENTIFIER_STRING is an OM syntax type that is assigned by definition in the macro to any OM attribute type and value parameters input to it.

The second descriptor defines the first OM attribute type, DS_ATTRIBUTE_TYPE, which has as its value DS_A_COUNTRY_NAME and syntax OM_S_OBJECT_IDENTIFIER_STRING.

The third descriptor specifies the AVA of an object entry in the directory. The OM_OID_DESC macro is not used here because OM_OID_DESC is only used to initialize values having OM_S_OBJECT_IDENTIFIER_STRING syntax. The OM attribute type is DS_ATTRIBUTE_VALUES, the syntax is OM_S_PRINTABLE_STRING, and the value is US. The OM_STRING macro creates a data value for a string data type (data type OM_string), in this case OM_S_PRINTABLE_STRING. A string is specified in terms of its length or whether or not it terminates with a NULL. (The OM_STRING macro is described in The OM_STRING Macro.)

The last descriptor is a NULL descriptor that marks the end of the public object definition. It is defined in the xom.h header file as follows:

#define OM_NULL_DESCRIPTOR

{ OM_NO_MORE_TYPES, OM_S_NO_MORE_SYNTAXES,

{ { 0, OM_ELEMENTS_UNSPECIFIED } } }

OM_NULL_DESCRIPTOR is OM attribute type OM_NO_MORE_TYPES, syntax OM_S_NO_MORE_SYNTAXES, and value OM_ELEMENTS_UNSPECIFIED.

The following figure shows the composition of a descriptor list representing a public object.

A Descriptor List for the Public Object: country

####