* attrsonly 1 => attributes only 0 => attributes and values
* res will contain the result of the search
* cancelproc routine that returns non-zero if operation should be
- * cancelled. This can be NULL. If it is non-NULL, the
- * routine will be called periodically.
+ * cancelled. This can be a null function pointer. If
+ * it is not 0, the routine will be called periodically.
* cancelparm void * that is passed to cancelproc
* tag[123] the ldapfilter.conf tag that will be used in phases
* 1, 2, and 3 of the search, respectively
* 2 )) == NULL ) {
return( ld->ld_errno = LDAP_NO_MEMORY );
}
- dns[0] = ldap_strdup( prefix );
+ dns[0] = strdup( prefix );
dns[1] = NULL;
} else {
dns = NULL;
}
int
-ldap_ufn_search_ct( LDAP *ld, char *ufn, char **attrs, int attrsonly,
+ldap_ufn_search_ct(
+ LDAP *ld, LDAP_CONST char *ufn, char **attrs, int attrsonly,
LDAPMessage **res, cancelptype cancelproc, void *cancelparm,
char *tag1, char *tag2, char *tag3 )
{
* ldapfilter.conf tags.
*/
int
-ldap_ufn_search_c( LDAP *ld, char *ufn, char **attrs, int attrsonly,
+ldap_ufn_search_c(
+ LDAP *ld, LDAP_CONST char *ufn, char **attrs, int attrsonly,
LDAPMessage **res, cancelptype cancelproc, void *cancelparm )
{
return( ldap_ufn_search_ct( ld, ufn, attrs, attrsonly, res, cancelproc,
* same as ldap_ufn_search_c without the cancel function
*/
int
-ldap_ufn_search_s( LDAP *ld, char *ufn, char **attrs, int attrsonly,
+ldap_ufn_search_s(
+ LDAP *ld, LDAP_CONST char *ufn, char **attrs, int attrsonly,
LDAPMessage **res )
{
struct timeval tv;
do {
*err = ldap_result( ld, msgid, 1, &tv, &tmpres );
- if ( *err == 0 && cancelproc != NULL &&
+ if ( *err == 0 && cancelproc != 0 &&
(*cancelproc)( cancelparm ) != 0 ) {
ldap_abandon( ld, msgid );
*err = LDAP_USER_CANCELLED;
*/
LDAPFiltDesc *
-ldap_ufn_setfilter( LDAP *ld, char *fname )
+ldap_ufn_setfilter( LDAP *ld, LDAP_CONST char *fname )
{
if ( ld->ld_filtd != NULL )
ldap_getfilter_free( ld->ld_filtd );
}
void
-ldap_ufn_setprefix( LDAP *ld, char *prefix )
+ldap_ufn_setprefix( LDAP *ld, LDAP_CONST char *prefix )
{
if ( ld->ld_ufnprefix != NULL )
free( ld->ld_ufnprefix );
- ld->ld_ufnprefix = ldap_strdup( prefix );
+ ld->ld_ufnprefix = strdup( prefix );
}
int