summaryrefslogtreecommitdiff
path: root/ext/oci8/oci8_collection.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/oci8/oci8_collection.c')
-rw-r--r--ext/oci8/oci8_collection.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c
index a1550e3400..0837761a4f 100644
--- a/ext/oci8/oci8_collection.c
+++ b/ext/oci8/oci8_collection.c
@@ -41,13 +41,13 @@
/* {{{ php_oci_collection_create()
Create and return connection handle */
php_oci_collection *php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len)
-{
+{
dvoid *dschp1 = NULL;
dvoid *parmp1;
dvoid *parmp2;
php_oci_collection *collection;
sword errstatus;
-
+
collection = emalloc(sizeof(php_oci_collection));
collection->connection = connection;
@@ -195,7 +195,7 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch
default:
php_error_docref(NULL, E_WARNING, "unknown collection type %d", collection->coll_typecode);
break;
- }
+ }
/* Create object to hold return table */
PHP_OCI_CALL_RETURN(errstatus, OCIObjectNew,
@@ -221,7 +221,7 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch
PHP_OCI_REGISTER_RESOURCE(collection, le_collection);
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
return collection;
-
+
CLEANUP:
if (dschp1) {
@@ -230,7 +230,7 @@ CLEANUP:
}
connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
- php_oci_collection_close(collection);
+ php_oci_collection_close(collection);
return NULL;
}
/* }}} */
@@ -241,7 +241,7 @@ int php_oci_collection_size(php_oci_collection *collection, sb4 *size)
{
php_oci_connection *connection = collection->connection;
sword errstatus;
-
+
PHP_OCI_CALL_RETURN(errstatus, OCICollSize, (connection->env, connection->err, collection->collection, (sb4 *)size));
if (errstatus != OCI_SUCCESS) {
@@ -259,7 +259,7 @@ int php_oci_collection_size(php_oci_collection *collection, sb4 *size)
int php_oci_collection_max(php_oci_collection *collection, zend_long *max)
{
php_oci_connection *connection = collection->connection;
-
+
PHP_OCI_CALL_RETURN(*max, OCICollMax, (connection->env, collection->collection));
/* error handling is not necessary here? */
@@ -296,7 +296,7 @@ int php_oci_collection_append_null(php_oci_collection *collection)
/* append NULL element */
PHP_OCI_CALL_RETURN(errstatus, OCICollAppend, (connection->env, connection->err, (dvoid *)0, &null_index, collection->collection));
-
+
if (errstatus != OCI_SUCCESS) {
errstatus = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
@@ -341,7 +341,7 @@ int php_oci_collection_append_date(php_oci_collection *collection, char *date, i
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
-
+
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
return 0;
}
@@ -358,7 +358,7 @@ int php_oci_collection_append_number(php_oci_collection *collection, char *numbe
sword errstatus;
element_double = zend_strtod(number, NULL);
-
+
PHP_OCI_CALL_RETURN(errstatus, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number));
if (errstatus != OCI_SUCCESS) {
@@ -396,7 +396,7 @@ int php_oci_collection_append_string(php_oci_collection *collection, char *eleme
OCIString *ocistr = (OCIString *)0;
php_oci_connection *connection = collection->connection;
sword errstatus;
-
+
PHP_OCI_CALL_RETURN(errstatus, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr));
if (errstatus != OCI_SUCCESS) {
@@ -433,12 +433,12 @@ int php_oci_collection_append(php_oci_collection *collection, char *element, int
if (element_len == 0) {
return php_oci_collection_append_null(collection);
}
-
+
switch(collection->element_typecode) {
case OCI_TYPECODE_DATE:
return php_oci_collection_append_date(collection, element, element_len);
break;
-
+
case OCI_TYPECODE_VARCHAR2 :
return php_oci_collection_append_string(collection, element, element_len);
break;
@@ -478,7 +478,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind
oratext buff[1024];
ub4 buff_len = 1024;
sword errstatus;
-
+
ZVAL_NULL(result_element);
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
@@ -500,7 +500,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
-
+
if (exists == 0) {
/* element doesn't exist */
return 1;
@@ -514,7 +514,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind
switch (collection->element_typecode) {
case OCI_TYPECODE_DATE:
PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, element, 0, 0, 0, 0, &buff_len, buff));
-
+
if (errstatus != OCI_SUCCESS) {
connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
@@ -523,7 +523,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind
ZVAL_STRINGL(result_element, (char *)buff, buff_len);
Z_STRVAL_P(result_element)[buff_len] = '\0';
-
+
return 0;
break;
@@ -531,9 +531,9 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind
{
OCIString *oci_string = *(OCIString **)element;
text *str;
-
+
PHP_OCI_CALL_RETURN(str, OCIStringPtr, (connection->env, oci_string));
-
+
if (str) {
ZVAL_STRING(result_element, (char *)str);
}
@@ -554,7 +554,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind
case OCI_TYPECODE_SMALLINT: /* SMALLINT */
{
double double_number;
-
+
PHP_OCI_CALL_RETURN(errstatus, OCINumberToReal, (connection->err, (CONST OCINumber *) element, (uword) sizeof(double), (dvoid *) &double_number));
if (errstatus != OCI_SUCCESS) {
@@ -562,7 +562,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
-
+
ZVAL_DOUBLE(result_element, double_number);
return 0;
@@ -588,7 +588,7 @@ int php_oci_collection_element_set_null(php_oci_collection *collection, zend_lon
/* set NULL element */
PHP_OCI_CALL_RETURN(errstatus, OCICollAssignElem, (connection->env, connection->err, (ub4) index, (dvoid *)"", &null_index, collection->collection));
-
+
if (errstatus != OCI_SUCCESS) {
connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
@@ -634,7 +634,7 @@ int php_oci_collection_element_set_date(php_oci_collection *collection, zend_lon
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
-
+
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
return 0;
}
@@ -651,7 +651,7 @@ int php_oci_collection_element_set_number(php_oci_collection *collection, zend_l
sword errstatus;
element_double = zend_strtod(number, NULL);
-
+
PHP_OCI_CALL_RETURN(errstatus, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number));
if (errstatus != OCI_SUCCESS) {
@@ -690,7 +690,7 @@ int php_oci_collection_element_set_string(php_oci_collection *collection, zend_l
OCIString *ocistr = (OCIString *)0;
php_oci_connection *connection = collection->connection;
sword errstatus;
-
+
PHP_OCI_CALL_RETURN(errstatus, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr));
if (errstatus != OCI_SUCCESS) {
@@ -728,12 +728,12 @@ int php_oci_collection_element_set(php_oci_collection *collection, zend_long ind
if (value_len == 0) {
return php_oci_collection_element_set_null(collection, index);
}
-
+
switch(collection->element_typecode) {
case OCI_TYPECODE_DATE:
return php_oci_collection_element_set_date(collection, index, value, value_len);
break;
-
+
case OCI_TYPECODE_VARCHAR2 :
return php_oci_collection_element_set_string(collection, index, value, value_len);
break;
@@ -768,7 +768,7 @@ int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_colle
{
php_oci_connection *connection = collection_dest->connection;
sword errstatus;
-
+
PHP_OCI_CALL_RETURN(errstatus, OCICollAssign, (connection->env, connection->err, collection_from->collection, collection_dest->collection));
if (errstatus != OCI_SUCCESS) {
@@ -798,7 +798,7 @@ void php_oci_collection_close(php_oci_collection *collection)
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
}
}
-
+
zend_list_delete(collection->connection->id);
efree(collection);
return;