X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fmessages.c;h=3875d2ccd616175bc15f581582f9c73537cc32c0;hb=75227eef9ea1ac309c4095b9433283dabda92f6c;hp=57cd4dbd43a411d8598d611c19426ccd465e3240;hpb=29d9fa20a2823c827f098d78f1ea8539d86bf4cf;p=openldap diff --git a/libraries/libldap/messages.c b/libraries/libldap/messages.c index 57cd4dbd43..3875d2ccd6 100644 --- a/libraries/libldap/messages.c +++ b/libraries/libldap/messages.c @@ -1,10 +1,17 @@ +/* messages.c */ /* $OpenLDAP$ */ -/* - * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. - * COPYING RESTRICTIONS APPLY, see COPYRIGHT file - */ -/* - * messages.c +/* This work is part of OpenLDAP Software . + * + * Copyright 1998-2005 The OpenLDAP Foundation. + * 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 + * . */ #include "portable.h" @@ -13,7 +20,6 @@ #include -#include #include #include #include @@ -25,11 +31,8 @@ ldap_first_message( LDAP *ld, LDAPMessage *chain ) { assert( ld != NULL ); assert( LDAP_VALID( ld ) ); + assert( chain != NULL ); - if ( ld == NULL || chain == NULL ) { - return NULL; - } - return chain; } @@ -38,12 +41,9 @@ ldap_next_message( LDAP *ld, LDAPMessage *msg ) { assert( ld != NULL ); assert( LDAP_VALID( ld ) ); + assert( msg != NULL ); - if ( ld == NULL || msg == NULL || msg->lm_chain == NULL ) { - return NULL; - } - - return( msg->lm_chain ); + return msg->lm_chain; } int @@ -54,13 +54,15 @@ ldap_count_messages( LDAP *ld, LDAPMessage *chain ) assert( ld != NULL ); assert( LDAP_VALID( ld ) ); - if ( ld == NULL ) { - return -1; - } - for ( i = 0; chain != NULL; chain = chain->lm_chain ) { i++; } return( i ); } + +BerElement* +ldap_get_message_ber( LDAPMessage *ld ) +{ + return ld->lm_ber; +}