.SM ldap_msgfree(3)
free results allocated by ldap_result(3)
.TP
+.SM ldap_msgtype(3)
+return the message type of a message from ldap_result(3)
+.TP
+.SM ldap_msgid(3)
+return the message id of a message from ldap_result(3)
+.TP
.SM ldap_search(3)
asynchronously search the directory
.TP
int ldap_msgfree(msg)
.ft
LDAPMessage *msg;
+.LP
+.ft B
+int ldap_msgtype(msg)
+.ft
+LDAPMessage *msg;
+.LP
+.ft B
+int ldap_msgid(msg)
+.ft
+LDAPMessage *msg;
.SH DESCRIPTION
The
.B ldap_result()
and friends. It takes
a pointer to the result to be freed and returns the type of the
message it freed.
+.LP
+The
+.B ldap_msgtype()
+routine returns the type of a message.
+.LP
+The
+.B ldap_msgid()
+routine returns the message id of a message.
.SH ERRORS
.B ldap_result()
returns -1 if something bad happens, and zero if the
timeout specified was exceeded.
+.B ldap_msgtype()
+and
+.B ldap_msgid()
+return -1 on error.
.SH NOTES
This routine mallocs memory for results that it receives. The memory
can be freed by calling
ldap_msgfree.3
+ldap_msgtype.3
+ldap_msgid.3
*/
LDAP_F int ldap_result LDAP_P(( LDAP *ld, int msgid, int all,
struct timeval *timeout, LDAPMessage **result ));
+LDAP_F int ldap_msgtype LDAP_P(( LDAPMessage *lm ));
+LDAP_F int ldap_msgid LDAP_P(( LDAPMessage *lm ));
LDAP_F int ldap_msgfree LDAP_P(( LDAPMessage *lm ));
LDAP_F int ldap_msgdelete LDAP_P(( LDAP *ld, int msgid ));
#endif /* !LDAP_REFERRALS */
+int
+ldap_msgtype( LDAPMessage *lm )
+{
+ return( lm ? lm->lm_msgtype : -1 );
+}
+
+int
+ldap_msgid( LDAPMessage *lm )
+{
+ return( lm ? lm->lm_msgid : -1 );
+}
+
+
int
ldap_msgfree( LDAPMessage *lm )
{