ldap_parse_sort_control()--Retrieve Values in a Sorted Results Control
Syntax
#include <ldap.h> int ldap_parse_sort_control( LDAP *ld, LDAPControl **serverControls, unsigned long *sortRC, char **attribute)
Library Name/Service Program: QSYS/QGLDCLNT
Default Public Authority: *USE
Threadsafe: Yes
The ldap_parse_sort_control() function is used to retrieve the values in a sorted results control used when sorting search results.
See Sorted LDAP Search Results for usage information about the functions used to perform sorting of entries returned from the server following an LDAP search operation.
Authorities and Locks
No IBM® i authority is required. All authority checking is done by the LDAP server.
Parameters
- ld
- (Input) Specifies the LDAP pointer returned by previous call to ldap_init(), ldap_ssl_init() or ldap_open(). Must not be NULL.
- serverControls
- (Input) Specifies a list of LDAP server controls. See Controls for LDAP APIs for more information about server controls. These controls are returned to the client when calling the ldap_parse_result() function on the set of results returned by the server.
- sortRC
- (Output) Specifies the LDAP return code retrieved from the sort results control returned by the server.
- attribute
- (Output) Specifies the name of the attributed in error returned by the server.
Return Value
- LDAP_SUCCESS
- if the request was successful.
- another LDAP error code
- if the control could not be parsed.
Example
See the example that uses ldap_create_sort_keylist(), ldap_create_sort_control(), ldap_free_sort_keylist(), and ldap_parse_sort_control() to perform an LDAP sorted search in ldap_create_sort_keylist() --Create a Structure with Sort Key Values used when Sorting Search Results.
Related Information
- ldap_create_sort_keylist() -- Create a structure with sort key values.
- ldap_free_sort_keylist() -- Free all memory used by the sort key list.
- ldap_create_sort_control() -- Create a sorted results control.
- ldap_create_page_control() -- Create a paged results control.
- ldap_parse_page_control() -- Retrieve values in a paged results control.
- ldap_search() -- Asynchronously search the directory.
- ldap_parse_result() -- Extract information from results.
API introduced: V5R3
[ Back to top | LDAP APIs | APIs by category ]