openldap/libraries/libldap/messages.c

62 lines
938 B
C
Raw Normal View History

/* $OpenLDAP$ */
1998-12-29 04:53:15 +08:00
/*
2003-01-04 04:20:47 +08:00
* Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
1998-12-29 04:53:15 +08:00
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
/*
* messages.c
*/
#include "portable.h"
#include <stdio.h>
1999-06-03 08:37:44 +08:00
#include <ac/stdlib.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 ) );
assert( chain != NULL );
return chain;
}
LDAPMessage *
ldap_next_message( LDAP *ld, LDAPMessage *msg )
{
assert( ld != NULL );
assert( LDAP_VALID( ld ) );
assert( msg != NULL );
return msg->lm_chain;
}
int
ldap_count_messages( LDAP *ld, LDAPMessage *chain )
{
int i;
assert( ld != NULL );
assert( LDAP_VALID( ld ) );
for ( i = 0; chain != NULL; chain = chain->lm_chain ) {
i++;
}
return( i );
}
2003-04-23 05:38:59 +08:00
BerElement*
ldap_get_message_ber( LDAPMessage *ld )
2003-04-23 05:38:59 +08:00
{
return ld->lm_ber;
}