CVS update: php3/functions
| From: | rasmus | Date: | Sat, 07 Nov 1998 16:59:23 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-2276@lists.php.net to get a copy of this message | ||
Date: Saturday November 7, 1998 @ 11:59
Author: rasmus
Update of /repository/php3/functions
In directory asf:/u2/tmp/cvs-serv16692/functions
Modified Files:
ldap.c
Log Message:
More prototype comments and some doc fixes
Index: php3/functions/ldap.c
diff -c php3/functions/ldap.c:1.59 php3/functions/ldap.c:1.60
*** php3/functions/ldap.c:1.59 Wed Nov 4 12:20:12 1998
--- php3/functions/ldap.c Sat Nov 7 11:59:21 1998
***************
*** 30,36 ****
*/
! /* $Id: ldap.c,v 1.59 1998/11/04 17:20:12 rasmus Exp $ */
#define IS_EXT_MODULE
#if !PHP_31 && defined(THREAD_SAFE)
#undef THREAD_SAFE
--- 30,36 ----
*/
! /* $Id: ldap.c,v 1.60 1998/11/07 16:59:21 rasmus Exp $ */
#define IS_EXT_MODULE
#if !PHP_31 && defined(THREAD_SAFE)
#undef THREAD_SAFE
***************
*** 305,311 ****
php3_printf("<table>"
"<tr><td>Total links:</td><td>%d/%s</td></tr>\n"
! "<tr><td>RCS Version:</td><td>$Id: ldap.c,v 1.59 1998/11/04
17:20:12 rasmus Exp $</td></tr>\n"
#if HAVE_NSLDAP
"<tr><td>SDK Version:</td><td>%f</td></tr>"
"<tr><td>Highest LDAP Protocol
Supported:</td><td>%f</td></tr>"
--- 305,311 ----
php3_printf("<table>"
"<tr><td>Total links:</td><td>%d/%s</td></tr>\n"
! "<tr><td>RCS Version:</td><td>$Id: ldap.c,v 1.60 1998/11/07
16:59:21 rasmus Exp $</td></tr>\n"
#if HAVE_NSLDAP
"<tr><td>SDK Version:</td><td>%f</td></tr>"
"<tr><td>Highest LDAP Protocol
Supported:</td><td>%f</td></tr>"
***************
*** 327,333 ****
}
!
void php3_ldap_connect(INTERNAL_FUNCTION_PARAMETERS)
{
char *host;
--- 327,334 ----
}
! /* {{{ proto int ldap_connect([string host [, int port]])
! Connect to an LDAP server */
void php3_ldap_connect(INTERNAL_FUNCTION_PARAMETERS)
{
char *host;
***************
*** 398,404 ****
RETURN_LONG(php3_list_insert((void*)ldap,LDAP_GLOBAL(le_link)));
}
! }
static LDAP * _get_ldap_link(pval *link, HashTable *list)
--- 399,405 ----
RETURN_LONG(php3_list_insert((void*)ldap,LDAP_GLOBAL(le_link)));
}
! } /* }}} */
static LDAP * _get_ldap_link(pval *link, HashTable *list)
***************
*** 470,477 ****
return ber;
}
-
void php3_ber_free(INTERNAL_FUNCTION_PARAMETERS)
{
pval *berp;
--- 471,478 ----
return ber;
}
+ #if 0
void php3_ber_free(INTERNAL_FUNCTION_PARAMETERS)
{
pval *berp;
***************
*** 482,489 ****
php3_list_delete(berp->value.lval);
RETURN_TRUE;
}
!
void php3_ldap_bind(INTERNAL_FUNCTION_PARAMETERS)
{
pval *link, *bind_rdn, *bind_pw;
--- 483,492 ----
php3_list_delete(berp->value.lval);
RETURN_TRUE;
}
! #endif
+ /* {{{ proto int ldap_bind(int link [, string dn, string password])
+ Bind to LDAP directory */
void php3_ldap_bind(INTERNAL_FUNCTION_PARAMETERS)
{
pval *link, *bind_rdn, *bind_pw;
***************
*** 535,543 ****
} else {
RETURN_TRUE;
}
! }
!
void php3_ldap_unbind(INTERNAL_FUNCTION_PARAMETERS)
{
pval *link;
--- 538,547 ----
} else {
RETURN_TRUE;
}
! } /* }}} */
! /* {{{ proto int ldap_unbind(int link)
! Unbind from LDAP directory */
void php3_ldap_unbind(INTERNAL_FUNCTION_PARAMETERS)
{
pval *link;
***************
*** 555,561 ****
/* dont do _close_ldap_link(ldap);*/
php3_list_delete(link->value.lval);
RETURN_TRUE;
! }
static void php3_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
--- 559,565 ----
/* dont do _close_ldap_link(ldap);*/
php3_list_delete(link->value.lval);
RETURN_TRUE;
! } /* }}} */
static void php3_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
***************
*** 656,681 ****
}
return;
}
-
void php3_ldap_read(INTERNAL_FUNCTION_PARAMETERS)
{
php3_ldap_do_search(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_SCOPE_BASE);
! }
!
void php3_ldap_list(INTERNAL_FUNCTION_PARAMETERS)
{
php3_ldap_do_search(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_SCOPE_ONELEVEL);
! }
void php3_ldap_search(INTERNAL_FUNCTION_PARAMETERS)
{
php3_ldap_do_search(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_SCOPE_SUBTREE);
! }
!
void php3_ldap_free_result(INTERNAL_FUNCTION_PARAMETERS)
{
pval *result;
--- 660,690 ----
}
return;
}
+ /* {{{ proto int ldap_read(int link, string base_dn, string filter [, string attributes])
+ Read an entry */
void php3_ldap_read(INTERNAL_FUNCTION_PARAMETERS)
{
php3_ldap_do_search(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_SCOPE_BASE);
! } /* }}} */
+ /* {{{ proto int ldap_list(int link, string base_dn, string filter [, string attributes])
+ Single-level search */
void php3_ldap_list(INTERNAL_FUNCTION_PARAMETERS)
{
php3_ldap_do_search(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_SCOPE_ONELEVEL);
! } /* }}} */
+ /* {{{ proto int ldap_search(int link, string base_dn, string filter [, string attributes])
+ Search LDAP tree under base_dn */
void php3_ldap_search(INTERNAL_FUNCTION_PARAMETERS)
{
php3_ldap_do_search(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_SCOPE_SUBTREE);
! } /* }}} */
+ /* {{{ proto int ldap_free_result(int result)
+ Free result memory */
void php3_ldap_free_result(INTERNAL_FUNCTION_PARAMETERS)
{
pval *result;
***************
*** 694,702 ****
RETVAL_TRUE;
}
return;
! }
!
void php3_ldap_count_entries(INTERNAL_FUNCTION_PARAMETERS)
{
pval *result, *link;
--- 703,712 ----
RETVAL_TRUE;
}
return;
! } /* }}} */
+ /* {{{ proto int ldap_count_entries(int link, int result)
+ Count the number of entries in a search result */
void php3_ldap_count_entries(INTERNAL_FUNCTION_PARAMETERS)
{
pval *result, *link;
***************
*** 714,722 ****
if (ldap_result == NULL) RETURN_FALSE;
RETURN_LONG(ldap_count_entries(ldap, ldap_result));
! }
!
void php3_ldap_first_entry(INTERNAL_FUNCTION_PARAMETERS)
{
pval *result, *link;
--- 724,733 ----
if (ldap_result == NULL) RETURN_FALSE;
RETURN_LONG(ldap_count_entries(ldap, ldap_result));
! } /* }}} */
+ /* {{{ proto int ldap_first_entry(int link, int result)
+ Return first result id */
void php3_ldap_first_entry(INTERNAL_FUNCTION_PARAMETERS)
{
pval *result, *link;
***************
*** 740,748 ****
} else {
RETURN_LONG(php3_list_insert(ldap_result_entry, LDAP_GLOBAL(le_result_entry)));
}
! }
!
void php3_ldap_next_entry(INTERNAL_FUNCTION_PARAMETERS)
{
pval *result_entry, *link;
--- 751,760 ----
} else {
RETURN_LONG(php3_list_insert(ldap_result_entry, LDAP_GLOBAL(le_result_entry)));
}
! } /* }}} */
! /* {{{ proto int ldap_next_entry(int link, int result)
! Get next result entry */
void php3_ldap_next_entry(INTERNAL_FUNCTION_PARAMETERS)
{
pval *result_entry, *link;
***************
*** 766,774 ****
/* php3_list_delete(result->value.lval); */
RETURN_LONG(php3_list_insert(ldap_result_entry_next, LDAP_GLOBAL(le_result_entry)));
}
! }
!
void php3_ldap_get_entries(INTERNAL_FUNCTION_PARAMETERS)
{
pval *link, *result;
--- 778,787 ----
/* php3_list_delete(result->value.lval); */
RETURN_LONG(php3_list_insert(ldap_result_entry_next, LDAP_GLOBAL(le_result_entry)));
}
! } /* }}} */
! /* {{{ proto array ldap_get_entries(int link, int result)
! Get all result entries */
void php3_ldap_get_entries(INTERNAL_FUNCTION_PARAMETERS)
{
pval *link, *result;
***************
*** 847,855 ****
}
add_assoc_long(return_value, "count", num_entries);
! }
!
void php3_ldap_first_attribute(INTERNAL_FUNCTION_PARAMETERS)
{
pval *result,*link,*berp;
--- 860,869 ----
}
add_assoc_long(return_value, "count", num_entries);
! } /* }}} */
+ /* {{{ proto string ldap_first_attribute(int link, int result, int ber)
+ Return first attribute */
void php3_ldap_first_attribute(INTERNAL_FUNCTION_PARAMETERS)
{
pval *result,*link,*berp;
***************
*** 881,889 ****
ldap_memfree(attribute);
#endif
}
! }
!
void php3_ldap_next_attribute(INTERNAL_FUNCTION_PARAMETERS)
{
pval *result,*link,*berp;
--- 895,904 ----
ldap_memfree(attribute);
#endif
}
! } /* }}} */
+ /* {{{ proto string ldap_next_attribute(int link, int result, int ber)
+ Get the next attribute in result */
void php3_ldap_next_attribute(INTERNAL_FUNCTION_PARAMETERS)
{
pval *result,*link,*berp;
***************
*** 912,920 ****
ldap_memfree(attribute);
#endif
}
! }
!
void php3_ldap_get_attributes(INTERNAL_FUNCTION_PARAMETERS)
{
pval *link, *result_entry;
--- 927,936 ----
ldap_memfree(attribute);
#endif
}
! } /* }}} */
+ /* {{{ proto array ldap_get_attributes(int link, int result)
+ Get attributes from a search result entry */
void php3_ldap_get_attributes(INTERNAL_FUNCTION_PARAMETERS)
{
pval *link, *result_entry;
***************
*** 967,975 ****
}
add_assoc_long(return_value, "count", num_attrib);
! }
!
void php3_ldap_get_values(INTERNAL_FUNCTION_PARAMETERS)
{
pval *link, *result_entry, *attr;
--- 983,992 ----
}
add_assoc_long(return_value, "count", num_attrib);
! } /* }}} */
! /* {{{ proto array ldap_get_values(int link, int result, string attribute)
! Get all values from a result entry */
void php3_ldap_get_values(INTERNAL_FUNCTION_PARAMETERS)
{
pval *link, *result_entry, *attr;
***************
*** 1016,1024 ****
add_assoc_long(return_value, "count", num_values);
ldap_value_free(ldap_value);
! }
!
void php3_ldap_get_dn(INTERNAL_FUNCTION_PARAMETERS)
{
pval *link,*entryp;
--- 1033,1042 ----
add_assoc_long(return_value, "count", num_values);
ldap_value_free(ldap_value);
! } /* }}} */
! /* {{{ proto string ldap_get_dn(int link, int result)
! Get the DN of a result entry */
void php3_ldap_get_dn(INTERNAL_FUNCTION_PARAMETERS)
{
pval *link,*entryp;
***************
*** 1045,1053 ****
} else {
RETURN_FALSE;
}
! }
!
void php3_ldap_explode_dn(INTERNAL_FUNCTION_PARAMETERS)
{
pval *dn, *with_attrib;
--- 1063,1072 ----
} else {
RETURN_FALSE;
}
! } /* }}} */
+ /* {{{ proto array ldap_explode_dn(string dn, int with_attrib)
+ Splits DN into its component parts */
void php3_ldap_explode_dn(INTERNAL_FUNCTION_PARAMETERS)
{
pval *dn, *with_attrib;
***************
*** 1077,1085 ****
}
ldap_value_free(ldap_value);
! }
!
void php3_ldap_dn2ufn(INTERNAL_FUNCTION_PARAMETERS)
{
pval *dn;
--- 1096,1105 ----
}
ldap_value_free(ldap_value);
! } /* }}} */
+ /* {{{ proto string ldap_dn2ufn(string dn)
+ Convert DN to User Friendly Naming format */
void php3_ldap_dn2ufn(INTERNAL_FUNCTION_PARAMETERS)
{
pval *dn;
***************
*** 1101,1107 ****
} else {
RETURN_FALSE;
}
! }
static void php3_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
--- 1121,1127 ----
} else {
RETURN_FALSE;
}
! } /* }}} */
static void php3_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
***************
*** 1195,1213 ****
return;
}
-
void php3_ldap_add(INTERNAL_FUNCTION_PARAMETERS)
{
php3_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_ADD);
! }
void php3_ldap_modify(INTERNAL_FUNCTION_PARAMETERS)
{
! php3_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_REPLACE);
! }
void php3_ldap_delete(INTERNAL_FUNCTION_PARAMETERS)
{
pval *link, *dn;
--- 1215,1238 ----
return;
}
+ /* {{{ proto int ldap_add(int link, string dn, array entry)
+ Add entries to LDAP directory */
void php3_ldap_add(INTERNAL_FUNCTION_PARAMETERS)
{
php3_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_ADD);
! } /* }}} */
+ /* {{{ proto int ldap_modify(int link, string dn, array entry)
+ Modify an LDAP entry */
void php3_ldap_modify(INTERNAL_FUNCTION_PARAMETERS)
{
! php3_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_REPLACE);
! } /* }}} */
+ /* {{{ proto int ldap_delete(int link, string dn)
+ Delete an entry from a directory */
void php3_ldap_delete(INTERNAL_FUNCTION_PARAMETERS)
{
pval *link, *dn;
***************
*** 1230,1235 ****
}
RETURN_TRUE;
! }
#endif
--- 1255,1260 ----
}
RETURN_TRUE;
! } /* }}} */
#endif
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net