cvs: php4 /ext/odbc php_odbc.c
| From: | Frank M. Kromann | Date: | Thu, 28 Sep 2000 16:42:04 +0000 |
| Subject: | cvs: php4 /ext/odbc php_odbc.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1862@lists.php.net to get a copy of this message | ||
fmk Thu Sep 28 09:42:04 2000 EDT
Modified files:
/php4/ext/odbc php_odbc.c
Log:
Having odbc_tables() and odbc_columns() match the documentation with parameters optionel from the
right
Index: php4/ext/odbc/php_odbc.c
diff -u php4/ext/odbc/php_odbc.c:1.59 php4/ext/odbc/php_odbc.c:1.60
--- php4/ext/odbc/php_odbc.c:1.59 Thu Jul 6 01:38:12 2000
+++ php4/ext/odbc/php_odbc.c Thu Sep 28 09:42:04 2000
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_odbc.c,v 1.59 2000/07/06 08:38:12 ssb Exp $ */
+/* $Id: php_odbc.c,v 1.60 2000/09/28 16:42:04 fmk Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -2438,25 +2438,23 @@
int argc;
argc = ZEND_NUM_ARGS();
- if (argc == 1) {
- if (zend_get_parameters_ex(1, &pv_conn) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- } else if (argc == 5) {
- if (zend_get_parameters_ex(5, &pv_conn, &pv_cat, &pv_schema, &pv_table,
&pv_type) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- convert_to_string_ex(pv_cat);
- cat = (*pv_cat)->value.str.val;
- convert_to_string_ex(pv_schema);
- schema = (*pv_schema)->value.str.val;
- convert_to_string_ex(pv_table);
- table = (*pv_table)->value.str.val;
- convert_to_string_ex(pv_type);
- type = (*pv_type)->value.str.val;
- } else {
+ if (argc < 1 || argc > 5 || zend_get_parameters_ex(argc, &pv_conn, &pv_cat,
&pv_schema, &pv_table, &pv_type) == FAILURE) {
WRONG_PARAM_COUNT;
}
+ switch (argc) {
+ case 5:
+ convert_to_string_ex(pv_type);
+ type = (*pv_type)->value.str.val;
+ case 4:
+ convert_to_string_ex(pv_table);
+ table = (*pv_table)->value.str.val;
+ case 3:
+ convert_to_string_ex(pv_schema);
+ schema = (*pv_schema)->value.str.val;
+ case 2:
+ convert_to_string_ex(pv_cat);
+ cat = (*pv_cat)->value.str.val;
+ }
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn,
le_pconn);
@@ -2520,24 +2518,22 @@
int argc;
argc = ZEND_NUM_ARGS();
- if (argc == 1) {
- if (zend_get_parameters_ex(1, &pv_conn) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- } else if (argc == 5) {
- if (zend_get_parameters_ex(5, &pv_conn, &pv_cat, &pv_schema, &pv_table,
&pv_column) == FAILURE) {
+ if (argc < 1 || argc > 5 || zend_get_parameters_ex(argc, &pv_conn, &pv_cat,
&pv_schema, &pv_table, &pv_column) == FAILURE) {
WRONG_PARAM_COUNT;
- }
- convert_to_string_ex(pv_cat);
- cat = (*pv_cat)->value.str.val;
- convert_to_string_ex(pv_schema);
- schema = (*pv_schema)->value.str.val;
- convert_to_string_ex(pv_table);
- table = (*pv_table)->value.str.val;
- convert_to_string_ex(pv_column);
- column = (*pv_column)->value.str.val;
- } else {
- WRONG_PARAM_COUNT;
+ }
+ switch (argc) {
+ case 5:
+ convert_to_string_ex(pv_column);
+ column = (*pv_column)->value.str.val;
+ case 4:
+ convert_to_string_ex(pv_table);
+ table = (*pv_table)->value.str.val;
+ case 3:
+ convert_to_string_ex(pv_schema);
+ schema = (*pv_schema)->value.str.val;
+ case 2:
+ convert_to_string_ex(pv_cat);
+ cat = (*pv_cat)->value.str.val;
}
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn,
le_pconn);