The example code in this chapter collects directory objects in a data structure called SERVER_INFO_LIST, which can be implemented as an array or list of CS_DS_OBJECT pointers.
The code calls the following example routines to collect directory object structures:
sil_init_list – allocate and initialize an empty SERVER_INFO_LIST.
sil_add_object – add a directory object to the end of a SERVER_INFO_LIST.
sil_extract_object – given a 1-based index number, retrieve a directory object from the SERVER_INFO_LIST.
sil_list_len – get the number of objects stored in a SERVER_INFO_LIST.
sil_drop_list – deallocate a SERVER_INFO_LIST and all its constituents. Calls ct_ds_dropobj to deallocate each directory object in the list.
These routines simply manage a list of CS_DS_OBJECT pointers. Their implementation is not shown here, but complete code can be found in the usedir.c sample file in the Client-Library sample programs.