1 /* $NetBSD: messages.c,v 1.1.1.4 2014/05/28 09:58:41 tron Exp $ */ 2 3 /* messages.c */ 4 /* $OpenLDAP$ */ 5 /* This work is part of OpenLDAP Software <http://www.openldap.org/>. 6 * 7 * Copyright 1998-2014 The OpenLDAP Foundation. 8 * All rights reserved. 9 * 10 * Redistribution and use in source and binary forms, with or without 11 * modification, are permitted only as authorized by the OpenLDAP 12 * Public License. 13 * 14 * A copy of this license is available in the file LICENSE in the 15 * top-level directory of the distribution or, alternatively, at 16 * <http://www.OpenLDAP.org/license.html>. 17 */ 18 19 #include "portable.h" 20 21 #include <stdio.h> 22 23 #include <ac/stdlib.h> 24 25 #include <ac/socket.h> 26 #include <ac/string.h> 27 #include <ac/time.h> 28 29 #include "ldap-int.h" 30 31 LDAPMessage * 32 ldap_first_message( LDAP *ld, LDAPMessage *chain ) 33 { 34 assert( ld != NULL ); 35 assert( LDAP_VALID( ld ) ); 36 assert( chain != NULL ); 37 38 return chain; 39 } 40 41 LDAPMessage * 42 ldap_next_message( LDAP *ld, LDAPMessage *msg ) 43 { 44 assert( ld != NULL ); 45 assert( LDAP_VALID( ld ) ); 46 assert( msg != NULL ); 47 48 return msg->lm_chain; 49 } 50 51 int 52 ldap_count_messages( LDAP *ld, LDAPMessage *chain ) 53 { 54 int i; 55 56 assert( ld != NULL ); 57 assert( LDAP_VALID( ld ) ); 58 59 for ( i = 0; chain != NULL; chain = chain->lm_chain ) { 60 i++; 61 } 62 63 return( i ); 64 } 65 66 BerElement* 67 ldap_get_message_ber( LDAPMessage *ld ) 68 { 69 return ld->lm_ber; 70 } 71