Directory callbacks are used with ct_ds_lookup. See the ct_ds_lookup reference page for an example directory callback.