#pragma ident "%Z%%M% %I% %E% SMI"
/*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/*
* Copyright (c) 1994 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
/*
* sort.c: LDAP library entry and value sort routines
*/
#include "ldap-int.h"
/* This xp_qsort fixes a memory problem (ABR) on Solaris for the client.
* Server is welcome to use it too, but I wasn't sure if it
* would be ok to use XP code here. -slamm
*
* We don't want to require use of libxp when linking with libldap, so
* I'll leave use of xp_qsort as a MOZILLA_CLIENT-only thing for now. --mcs
*/
#if defined(MOZILLA_CLIENT) && defined(SOLARIS)
#include "xp_qsort.h"
#else
#endif
typedef struct keycmp {
void *kc_arg;
} keycmp_t;
typedef struct keything {
} keything_t;
static int LDAP_C LDAP_CALLBACK
{
}
int
LDAPMessage **chain,
void *arg,
{
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )
return( LDAP_PARAM_ERROR );
}
return( -1 );
}
for ( i = 0; i < count; i++ ) {
}
NSLDAPI_FREE( (char*)kt );
return( -1 );
}
}
last = e;
for ( i = 0; i < count; i++ ) {
}
NSLDAPI_FREE( (char*)kt );
return( 0 );
}
struct entrything {
char **et_vals;
};
const void*);
int
const char **a,
const char **b
)
{
/* XXXceb
* I am not 100% sure this is the way this should be handled.
* For now we will return a 0 on invalid.
*/
return (0);
return( strcasecmp( (char *)*a, (char *)*b ) );
}
static int
const void *aa,
const void *bb
)
{
int i, rc;
return( 0 );
return( -1 );
return( 1 );
!= 0 ) {
return( rc );
}
}
return( 0 );
return( -1 );
return( 1 );
}
int
LDAPMessage **chain,
char **attr, /* NULL => sort by DN */
)
{
int i, count;
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )
return( LDAP_PARAM_ERROR );
}
sizeof(struct entrything) )) == NULL ) {
return( -1 );
}
e = *chain;
for ( i = 0; i < count; i++ ) {
char *dn;
NSLDAPI_FREE( dn );
} else {
int attrcnt;
char **vals;
!= 0 ) {
int j;
/* XXX risky: ldap_value_free( vals ); */
for ( j = 0; j <= i; j++ )
NSLDAPI_FREE( (char *) et );
NULL );
return( -1 );
}
NSLDAPI_FREE( (char *)vals );
}
}
}
e = e->lm_chain;
}
last = e;
for ( i = 0; i < count; i++ ) {
}
NSLDAPI_FREE( (char *) et );
return( 0 );
}
int
LDAPMessage **chain,
char *attr, /* NULL => sort by DN */
)
{
}
int
char **vals,
)
{
int nel;
return( LDAP_PARAM_ERROR );
}
{
return( LDAP_PARAM_ERROR );
}
; /* NULL */
return( LDAP_SUCCESS );
}