Back to index

openldap  2.4.31
messages.c
Go to the documentation of this file.
00001 /* messages.c */
00002 /* $OpenLDAP$ */
00003 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
00004  *
00005  * Copyright 1998-2012 The OpenLDAP Foundation.
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted only as authorized by the OpenLDAP
00010  * Public License.
00011  *
00012  * A copy of this license is available in the file LICENSE in the
00013  * top-level directory of the distribution or, alternatively, at
00014  * <http://www.OpenLDAP.org/license.html>.
00015  */
00016 
00017 #include "portable.h"
00018 
00019 #include <stdio.h>
00020 
00021 #include <ac/stdlib.h>
00022 
00023 #include <ac/socket.h>
00024 #include <ac/string.h>
00025 #include <ac/time.h>
00026 
00027 #include "ldap-int.h"
00028 
00029 LDAPMessage *
00030 ldap_first_message( LDAP *ld, LDAPMessage *chain )
00031 {
00032        assert( ld != NULL );
00033        assert( LDAP_VALID( ld ) );
00034        assert( chain != NULL );
00035 
00036        return chain;
00037 }
00038 
00039 LDAPMessage *
00040 ldap_next_message( LDAP *ld, LDAPMessage *msg )
00041 {
00042        assert( ld != NULL );
00043        assert( LDAP_VALID( ld ) );
00044        assert( msg != NULL );
00045 
00046        return msg->lm_chain;
00047 }
00048 
00049 int
00050 ldap_count_messages( LDAP *ld, LDAPMessage *chain )
00051 {
00052        int    i;
00053 
00054        assert( ld != NULL );
00055        assert( LDAP_VALID( ld ) );
00056 
00057        for ( i = 0; chain != NULL; chain = chain->lm_chain ) {
00058               i++;
00059        }
00060 
00061        return( i );
00062 }
00063 
00064 BerElement*
00065 ldap_get_message_ber( LDAPMessage *ld )
00066 {
00067        return ld->lm_ber;
00068 }