]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/messages.c
Add #include <openssl/safestack.h> to fix ITS#1412
[openldap] / libraries / libldap / messages.c
index 87aebdca9d721d376490edf064f4a9f83fd3d4e2..f829ca7e14016c32736ceb207aef2ae4d7172bf3 100644 (file)
@@ -1,3 +1,8 @@
+/* $OpenLDAP$ */
+/*
+ * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
 /*
  *  messages.c
  */
 #include "portable.h"
 
 #include <stdio.h>
-#include <stdlib.h>
 
-#include <ac/ctype.h>
+#include <ac/stdlib.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 ) );
+
+       if ( ld == NULL || chain == NULL ) {
+               return 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 ) );
+
+       if ( ld == NULL || msg == NULL || msg->lm_chain == NULL ) {
+               return NULL;
        }
 
        return( msg->lm_chain );
 }
 
-/* ARGSUSED */
 int
 ldap_count_messages( LDAP *ld, LDAPMessage *chain )
 {
        int     i;
 
+       assert( ld != NULL );
+       assert( LDAP_VALID( ld ) );
+
        if ( ld == NULL ) {
                return -1;
        }