Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / bsd / openldap / dist / libraries / libldap / messages.c
blob305c8f02c9a63472bdc8c3045615f334c610eaf9
1 /* messages.c */
2 /* $OpenLDAP: pkg/ldap/libraries/libldap/messages.c,v 1.17.2.3 2008/02/11 23:26:41 kurt Exp $ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1998-2008 The OpenLDAP Foundation.
6 * All rights reserved.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
10 * Public License.
12 * A copy of this license is available in the file LICENSE in the
13 * top-level directory of the distribution or, alternatively, at
14 * <http://www.OpenLDAP.org/license.html>.
17 #include "portable.h"
19 #include <stdio.h>
21 #include <ac/stdlib.h>
23 #include <ac/socket.h>
24 #include <ac/string.h>
25 #include <ac/time.h>
27 #include "ldap-int.h"
29 LDAPMessage *
30 ldap_first_message( LDAP *ld, LDAPMessage *chain )
32 assert( ld != NULL );
33 assert( LDAP_VALID( ld ) );
34 assert( chain != NULL );
36 return chain;
39 LDAPMessage *
40 ldap_next_message( LDAP *ld, LDAPMessage *msg )
42 assert( ld != NULL );
43 assert( LDAP_VALID( ld ) );
44 assert( msg != NULL );
46 return msg->lm_chain;
49 int
50 ldap_count_messages( LDAP *ld, LDAPMessage *chain )
52 int i;
54 assert( ld != NULL );
55 assert( LDAP_VALID( ld ) );
57 for ( i = 0; chain != NULL; chain = chain->lm_chain ) {
58 i++;
61 return( i );
64 BerElement*
65 ldap_get_message_ber( LDAPMessage *ld )
67 return ld->lm_ber;