mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
669b8f4047
added lber_types.h.nt, lber_types.h.in removal of NULLxxx internal macros (in favor of NULL). ch_free added to slapd,slurpd/ch_malloc.c #define free ch_free (should be removed after s/free/ch_free/g) in proto-slap.h ch_malloc and friends use ber_memalloc and friends
66 lines
995 B
C
66 lines
995 B
C
/*
|
|
* Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
|
|
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
|
*/
|
|
/*
|
|
* messages.c
|
|
*/
|
|
|
|
#include "portable.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <ac/stdlib.h>
|
|
|
|
#include <ac/ctype.h>
|
|
#include <ac/socket.h>
|
|
#include <ac/string.h>
|
|
#include <ac/time.h>
|
|
|
|
#include "ldap-int.h"
|
|
|
|
LDAPMessage *
|
|
ldap_first_message( LDAP *ld, LDAPMessage *chain )
|
|
{
|
|
assert( ld != NULL );
|
|
assert( LDAP_VALID( ld ) );
|
|
|
|
if ( ld == NULL || chain == NULL ) {
|
|
return NULL;
|
|
}
|
|
|
|
return chain;
|
|
}
|
|
|
|
LDAPMessage *
|
|
ldap_next_message( LDAP *ld, LDAPMessage *msg )
|
|
{
|
|
assert( ld != NULL );
|
|
assert( LDAP_VALID( ld ) );
|
|
|
|
if ( ld == NULL || msg == NULL || msg->lm_chain == NULL ) {
|
|
return NULL;
|
|
}
|
|
|
|
return( msg->lm_chain );
|
|
}
|
|
|
|
int
|
|
ldap_count_messages( LDAP *ld, LDAPMessage *chain )
|
|
{
|
|
int i;
|
|
|
|
assert( ld != NULL );
|
|
assert( LDAP_VALID( ld ) );
|
|
|
|
if ( ld == NULL ) {
|
|
return -1;
|
|
}
|
|
|
|
for ( i = 0; chain != NULL; chain = chain->lm_chain ) {
|
|
i++;
|
|
}
|
|
|
|
return( i );
|
|
}
|