2003-11-26 02:16:36 -05:00
|
|
|
/* messages.c */
|
1999-09-08 15:06:24 -04:00
|
|
|
/* $OpenLDAP$ */
|
2003-11-26 02:16:36 -05:00
|
|
|
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
|
|
|
|
|
*
|
2024-03-26 15:45:07 -04:00
|
|
|
* Copyright 1998-2024 The OpenLDAP Foundation.
|
2003-11-26 02:16:36 -05:00
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
|
* modification, are permitted only as authorized by the OpenLDAP
|
|
|
|
|
* Public License.
|
|
|
|
|
*
|
|
|
|
|
* A copy of this license is available in the file LICENSE in the
|
|
|
|
|
* top-level directory of the distribution or, alternatively, at
|
|
|
|
|
* <http://www.OpenLDAP.org/license.html>.
|
1998-12-23 23:45:54 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "portable.h"
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
1999-06-02 20:37:44 -04:00
|
|
|
|
|
|
|
|
#include <ac/stdlib.h>
|
1998-12-23 23:45:54 -05:00
|
|
|
|
|
|
|
|
#include <ac/socket.h>
|
|
|
|
|
#include <ac/string.h>
|
|
|
|
|
#include <ac/time.h>
|
|
|
|
|
|
|
|
|
|
#include "ldap-int.h"
|
|
|
|
|
|
|
|
|
|
LDAPMessage *
|
|
|
|
|
ldap_first_message( LDAP *ld, LDAPMessage *chain )
|
|
|
|
|
{
|
1999-06-05 16:18:32 -04:00
|
|
|
assert( ld != NULL );
|
|
|
|
|
assert( LDAP_VALID( ld ) );
|
2002-06-05 20:26:50 -04:00
|
|
|
assert( chain != NULL );
|
1999-06-05 16:18:32 -04:00
|
|
|
|
|
|
|
|
return chain;
|
1998-12-23 23:45:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LDAPMessage *
|
|
|
|
|
ldap_next_message( LDAP *ld, LDAPMessage *msg )
|
|
|
|
|
{
|
1999-06-05 16:18:32 -04:00
|
|
|
assert( ld != NULL );
|
|
|
|
|
assert( LDAP_VALID( ld ) );
|
2002-06-05 20:26:50 -04:00
|
|
|
assert( msg != NULL );
|
1999-06-05 16:18:32 -04:00
|
|
|
|
2002-06-05 20:26:50 -04:00
|
|
|
return msg->lm_chain;
|
1998-12-23 23:45:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
ldap_count_messages( LDAP *ld, LDAPMessage *chain )
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
1999-06-05 16:18:32 -04:00
|
|
|
assert( ld != NULL );
|
|
|
|
|
assert( LDAP_VALID( ld ) );
|
|
|
|
|
|
1998-12-23 23:45:54 -05:00
|
|
|
for ( i = 0; chain != NULL; chain = chain->lm_chain ) {
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return( i );
|
|
|
|
|
}
|
2003-04-22 17:38:59 -04:00
|
|
|
|
|
|
|
|
BerElement*
|
2003-04-22 18:09:25 -04:00
|
|
|
ldap_get_message_ber( LDAPMessage *ld )
|
2003-04-22 17:38:59 -04:00
|
|
|
{
|
|
|
|
|
return ld->lm_ber;
|
|
|
|
|
}
|