]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/references.c
Add OpenLDAP RCSid to *.[ch] in clients, libraries, and servers.
[openldap] / libraries / libldap / references.c
index 08e96b05b67e9a26fe708e906a35c668de84ec80..371919db10de2318b04555649645fc194570e6fe 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
 
 #include "ldap-int.h"
 
-/* ARGSUSED */
 LDAPMessage *
 ldap_first_reference( LDAP *ld, LDAPMessage *chain )
 {
        assert( ld != NULL );
+       assert( LDAP_VALID( ld ) );
        assert( chain !=  NULL );
 
-       if ( ld == NULL || chain == NULLMSG ) {
-               return NULLMSG;
+       if ( ld == NULL || chain == NULL ) {
+               return NULL;
        }
 
        return chain->lm_msgtype == LDAP_RES_SEARCH_REFERENCE
@@ -39,15 +40,16 @@ LDAPMessage *
 ldap_next_reference( LDAP *ld, LDAPMessage *ref )
 {
        assert( ld != NULL );
+       assert( LDAP_VALID( ld ) );
        assert( ref !=  NULL );
 
-       if ( ld == NULL || ref == NULLMSG ) {
-               return NULLMSG;
+       if ( ld == NULL || ref == NULL ) {
+               return NULL;
        }
 
        for (
                ref = ref->lm_chain;
-               ref != NULLMSG;
+               ref != NULL;
                ref = ref->lm_chain )
        {
                if( ref->lm_msgtype == LDAP_RES_SEARCH_REFERENCE ) {
@@ -55,7 +57,7 @@ ldap_next_reference( LDAP *ld, LDAPMessage *ref )
                }
        }
 
-       return( NULLMSG );
+       return( NULL );
 }
 
 int
@@ -64,12 +66,14 @@ ldap_count_references( LDAP *ld, LDAPMessage *chain )
        int     i;
 
        assert( ld != NULL );
+       assert( LDAP_VALID( ld ) );
        assert( chain !=  NULL );
 
        if ( ld == NULL ) {
                return -1;
        }
 
+       
        for ( i = 0; chain != NULL; chain = chain->lm_chain ) {
                if( chain->lm_msgtype == LDAP_RES_SEARCH_REFERENCE ) {
                        i++;
@@ -92,6 +96,7 @@ ldap_parse_reference(
        int rc;
 
        assert( ld != NULL );
+       assert( LDAP_VALID( ld ) );
        assert( ref !=  NULL );
 
        if( ld == NULL || ref == NULL ||