1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  *
3*0Sstevel@tonic-gate  * Copyright %G% Sun Microsystems, Inc.
4*0Sstevel@tonic-gate  * All Rights Reserved
5*0Sstevel@tonic-gate  *
6*0Sstevel@tonic-gate  *
7*0Sstevel@tonic-gate  * Comments:
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  */
10*0Sstevel@tonic-gate 
11*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
12*0Sstevel@tonic-gate 
13*0Sstevel@tonic-gate #include <stdio.h>
14*0Sstevel@tonic-gate #include <ctype.h>
15*0Sstevel@tonic-gate #include <string.h>
16*0Sstevel@tonic-gate #include "lber.h"
17*0Sstevel@tonic-gate #include "ldap.h"
18*0Sstevel@tonic-gate #include "ldap-private.h"
19*0Sstevel@tonic-gate 
20*0Sstevel@tonic-gate LDAPMessage * ldap_first_message(LDAP *ld, LDAPMessage *res)
21*0Sstevel@tonic-gate {
22*0Sstevel@tonic-gate 	return (res == NULLMSG ? NULLMSG : res);
23*0Sstevel@tonic-gate }
24*0Sstevel@tonic-gate 
25*0Sstevel@tonic-gate LDAPMessage * ldap_next_message(LDAP *ld, LDAPMessage *msg)
26*0Sstevel@tonic-gate {
27*0Sstevel@tonic-gate 	if (msg == NULLMSG || msg->lm_chain == NULLMSG)
28*0Sstevel@tonic-gate 		return (NULLMSG);
29*0Sstevel@tonic-gate 	return (msg->lm_chain);
30*0Sstevel@tonic-gate }
31*0Sstevel@tonic-gate 
32*0Sstevel@tonic-gate int ldap_count_messages( LDAP *ld, LDAPMessage *res)
33*0Sstevel@tonic-gate {
34*0Sstevel@tonic-gate 	int i;
35*0Sstevel@tonic-gate 
36*0Sstevel@tonic-gate 	for ( i =0; res != NULL; res = res->lm_chain)
37*0Sstevel@tonic-gate 		i++;
38*0Sstevel@tonic-gate 
39*0Sstevel@tonic-gate 	return (i);
40*0Sstevel@tonic-gate }
41