PreviousNext

Step 1: Export Object Identifiers

Most application programs find it convenient to export all the names they use from the same C source module. In the following acl.c fragment, the OM_EXPORT macro allocates memory for the constants that represent the object OM classes and OM attributes required for the search operation:

/* The application must export the object identifiers it */

/* requires. */

OM_EXPORT (DS_C_AVA)

OM_EXPORT (DS_C_DS_RDN)

OM_EXPORT (DS_C_DS_DN)

OM_EXPORT (DS_C_ENTRY_INFO_SELECTION)

OM_EXPORT (DS_C_ATTRIBUTE)

OM_EXPORT (DS_C_ATTRIBUTE_LIST)

OM_EXPORT (DS_C_FILTER)

OM_EXPORT (DS_C_FILTER_ITEM)

OM_EXPORT (DSX_C_GDS_SESSION)

OM_EXPORT (DSX_C_GDS_CONTEXT)

OM_EXPORT (DSX_C_GDS_ACL)

OM_EXPORT (DSX_C_GDS_ACL_ITEM)

OM_EXPORT (DS_A_COUNTRY_NAME)

OM_EXPORT (DS_A_ORG_NAME)

OM_EXPORT (DS_A_ORG_UNIT_NAME)

OM_EXPORT (DS_A_COMMON_NAME)

OM_EXPORT (DS_A_LOCALITY_NAME)

OM_EXPORT (DS_A_OBJECT_CLASS)

OM_EXPORT (DS_A_USER_PASSWORD)

OM_EXPORT (DS_A_PHONE_NBR)

OM_EXPORT (DS_A_SURNAME)

OM_EXPORT (DS_A_ACL)

OM_EXPORT (DS_TYPELESS_RDN)

OM_EXPORT (DS_O_TOP)

OM_EXPORT (DS_O_COUNTRY)

OM_EXPORT (DS_O_ORG)

OM_EXPORT (DS_O_ORG_UNIT)

OM_EXPORT (DS_O_PERSON)

OM_EXPORT (DS_O_ORG__PERSON)

The OM_EXPORT macro takes the OM class name as input and creates two new data structures: a character string and structure of type OM_string. The structure of type OM_string contains a length and a pointer that are used in Step 3 to initialize the value of the object identifier.