]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/messages.c
VLV clean
[openldap] / libraries / libldap / messages.c
index eea7bed70c660c596968e749c813f49581f3d8ca..bcb13a7f1461d4697705cdfe67387a07c183eec0 100644 (file)
@@ -1,5 +1,6 @@
+/* $OpenLDAP$ */
 /*
- * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 /*
 
 #include <ac/stdlib.h>
 
-#include <ac/ctype.h>
 #include <ac/socket.h>
 #include <ac/string.h>
 #include <ac/time.h>
 
 #include "ldap-int.h"
 
-/* ARGSUSED */
 LDAPMessage *
 ldap_first_message( LDAP *ld, LDAPMessage *chain )
 {
-       return( ld == NULL || chain == NULLMSG
-                       ? NULLMSG : chain );
+       assert( ld != NULL );
+       assert( LDAP_VALID( ld ) );
+       assert( chain != NULL );
+
+       return chain;
 }
 
-/* ARGSUSED */
 LDAPMessage *
 ldap_next_message( LDAP *ld, LDAPMessage *msg )
 {
-       if ( ld == NULL || msg == NULLMSG || msg->lm_chain == NULL ) {
-               return NULLMSG;
-       }
+       assert( ld != NULL );
+       assert( LDAP_VALID( ld ) );
+       assert( msg != NULL );
 
-       return( msg->lm_chain );
+       return msg->lm_chain;
 }
 
-/* ARGSUSED */
 int
 ldap_count_messages( LDAP *ld, LDAPMessage *chain )
 {
        int     i;
 
-       if ( ld == NULL ) {
-               return -1;
-       }
+       assert( ld != NULL );
+       assert( LDAP_VALID( ld ) );
 
        for ( i = 0; chain != NULL; chain = chain->lm_chain ) {
                i++;