control to be directly passed in.
* LDAP Server Side Sort
* in sortctrl.c
*/
-#define LDAP_API_FEATURE_SERVER_SIDE_SORT 1000
+#define LDAP_API_FEATURE_SERVER_SIDE_SORT 2000
/* structure for a sort-key */
typedef struct ldapsortkey {
ldap_create_sort_control LDAP_P((
LDAP *ld,
LDAPSortKey **keyList,
- int ctl_iscritical,
+ int iscritical,
LDAPControl **ctrlp ));
LDAP_F( int )
-ldap_parse_sort_control LDAP_P((
+ldap_parse_sortresult_control LDAP_P((
LDAP *ld,
LDAPControl **ctrlp,
unsigned long *result,
* LDAP Virtual List View
* in vlvctrl.c
*/
-#define LDAP_API_FEATURE_VIRTUAL_LIST_VIEW 1000
+#define LDAP_API_FEATURE_VIRTUAL_LIST_VIEW 2000
/* structure for virtual list */
typedef struct ldapvlvinfo {
LDAPControl **ctrlp ));
LDAP_F( int )
-ldap_parse_vlv_control LDAP_P((
+ldap_parse_vlvresponse_control LDAP_P((
LDAP *ld,
- LDAPControl **ctrls,
+ LDAPControl *ctrls,
unsigned long *target_posp,
unsigned long *list_countp,
struct berval **contextp,
/* ---------------------------------------------------------------------------
- ldap_parse_sort_control
+ ldap_parse_sortedresult_control
Decode the server-side sort control return information.
ld (IN) An LDAP session handle, as obtained from a call to
ldap_init().
- ctrls (IN) The address of a NULL-terminated array of LDAPControl
- structures, typically obtained by a call to
- ldap_parse_result().
+ ctrl (IN) The address of the LDAP Control Structure.
returnCode (OUT) This result parameter is filled in with the sort control
result code. This parameter MUST not be NULL.
---------------------------------------------------------------------------*/
int
-ldap_parse_sort_control(
+ldap_parse_sortedresult_control(
LDAP *ld,
- LDAPControl **ctrls,
+ LDAPControl *ctrl,
unsigned long *returnCode,
char **attribute )
{
return(ld->ld_errno);
}
- if (ctrls == NULL) {
- ld->ld_errno = LDAP_CONTROL_NOT_FOUND;
+ if (ctrl == NULL) {
+ ld->ld_errno = LDAP_PARAM_ERROR;
return(ld->ld_errno);
}
*attribute = NULL;
}
- /* Search the list of control responses for a sort control. */
- for (i=0; ctrls[i]; i++) {
- pControl = ctrls[i];
- if (!strcmp(LDAP_CONTROL_SORTRESPONSE, pControl->ldctl_oid))
- goto foundSortControl;
+ if ( strcmp(LDAP_CONTROL_SORTRESPONSE, ctrl->ldctl_oid) != 0 ) {
+ /* Not sort result control */
+ ld->ld_errno = LDAP_CONTROL_NOT_FOUND;
+ return(ld->ld_errno);
}
- /* No sort control was found. */
- ld->ld_errno = LDAP_CONTROL_NOT_FOUND;
- return(ld->ld_errno);
-
-foundSortControl:
/* Create a BerElement from the berval returned in the control. */
- ber = ber_init(&pControl->ldctl_value);
+ ber = ber_init(&ctrl->ldctl_value);
if (ber == NULL) {
ld->ld_errno = LDAP_NO_MEMORY;
/*---
- ldap_parse_vlv_control
+ ldap_parse_vlvresponse_control
Decode the Virtual List View control return information.
ld (IN) An LDAP session handle.
- ctrls (IN) The address of a NULL-terminated array of
- LDAPControl structures, typically obtained
- by a call to ldap_parse_result().
+ ctrl (IN) The address of the LDAPControl structure.
target_posp (OUT) This result parameter is filled in with the list
index of the target entry. If this parameter is
---*/
int
-ldap_parse_vlv_control(
+ldap_parse_vlvresponse_control(
LDAP *ld,
- LDAPControl **ctrls,
+ LDAPControl *ctrl,
unsigned long *target_posp,
unsigned long *list_countp,
struct berval **contextp,
*contextp = NULL; /* Make sure we return a NULL if error occurs. */
}
- if (ctrls == NULL) {
- ld->ld_errno = LDAP_CONTROL_NOT_FOUND;
+ if (ctrl == NULL) {
+ ld->ld_errno = LDAP_PARAM_ERROR;
return(ld->ld_errno);
}
- /* Search the list of control responses for a VLV control. */
- for (i=0; ctrls[i]; i++) {
- pControl = ctrls[i];
- if (!strcmp(LDAP_CONTROL_VLVRESPONSE, pControl->ldctl_oid))
- goto foundVLVControl;
+ if (strcmp(LDAP_CONTROL_VLVRESPONSE, ctrl->ldctl_oid) != 0) {
+ /* Not VLV Response control */
+ ld->ld_errno = LDAP_CONTROL_NOT_FOUND;
+ return(ld->ld_errno);
}
- /* No sort control was found. */
- ld->ld_errno = LDAP_CONTROL_NOT_FOUND;
- return(ld->ld_errno);
-
-foundVLVControl:
/* Create a BerElement from the berval returned in the control. */
- ber = ber_init(&pControl->ldctl_value);
+ ber = ber_init(&ctrl->ldctl_value);
if (ber == NULL) {
ld->ld_errno = LDAP_NO_MEMORY;