Creates an a array of pointers to LDAPSortKey structures.
#include <ldap.h>
int ldap_create_sort_keylist (
LDAPSortKey ***sortKeyList,
char *keyString);
(OUT) Points to a NULL-terminated array of pointers to LDAPSortKey structures which contain the attributes to sort on and the rules to use for ordering.
(IN) Points to a string representation of one or more sort keys, separated by spaces.
|
0x00 |
LDAP_SUCCESS |
|
Non-zero |
Failure. See |
A key string uses the following format:
[-]attribute[:ordering rule]
The optional - indicates reverse sort order.
The attribute specifies an attribute in the LDAP server's schema.
The optional ordering rule is an OID (dotted string format) specifying the matching rule to use for sorting.
IMPORTANT:eDirectory currently supports only a single sort key, no ordering rules, and only forward sorting.
If the attribute corresponds to an existing index on the eDirectory server, performance is extremely good even with very large result sets. NDS 8 and NDS eDirectory have indexes for the following attributes:
If you create a sort key for an attribute that does not have a defined index, one of the following happens:
If the control is specified as critical, the function returns “No such attribute”.
If the control is not marked critical, the control is ignored and the results are returned unsorted.
The ldap_create_sort_keylist function allocates memory for the sortKeyList array and this memory should be freed by calling the ldap_free_sort_keylist function.
For example code, see sortcntl.c.