Added ldap_msgtype() and ldap_msgid()

This commit is contained in:
Hallvard Furuseth 1998-11-04 23:51:31 +00:00
parent 5009ee7b13
commit f81ee9b63e
5 changed files with 45 additions and 0 deletions

View File

@ -401,6 +401,12 @@ depreciated - use ldap_modrdn2_s(3)
.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

View File

@ -19,6 +19,16 @@ LDAPMessage **result;
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()
@ -92,10 +102,22 @@ or
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

View File

@ -1 +1,3 @@
ldap_msgfree.3
ldap_msgtype.3
ldap_msgid.3

View File

@ -608,6 +608,8 @@ LDAP_F void ldap_value_free_len LDAP_P(( struct berval **vals ));
*/
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 ));

View File

@ -612,6 +612,19 @@ ldap_select1( LDAP *ld, struct timeval *timeout )
#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 )
{