### Reading an Entry from the Directory

The following topics describe a typical read operation by using the ds_read( ) function call. They include a description of tasks directly related to the read operation. They do not include service-related tasks such as initializing the interface, allocating an OM workspace, and binding to the directory. These tasks are described in XDS Interface Management Functions. The following topics also do not describe the process of extracting information from the workspace by using XOM functions. Refer to XOM Programming for a description of how to use XOM functions to access the workspace.

A typical read operation involves the following steps:

1. Define the necessary object identifier constants for the OM classes and OM attributes that will define public objects for input to ds_read( ), by using the OM_EXPORT macro.

2. Declare the variables that will contain the output from the XDS functions to be used in the application.

3. Build public objects (descriptor lists) for the name parameter to ds_read( ).

4. Create a descriptor list for the selection parameter to ds_read( ) that selects the type and scope of information in your request.

5. Perform the read operation.

These steps are demonstrated in the following code fragments from example.c (refer to Sample Application Programs for a complete program listing). The program reads the telephone numbers of a given target entry.

###