CVS update: php3/functions

From: Date: Fri, 12 Feb 1999 15:48:44 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-4069@lists.php.net to get a copy of this message
Date: Friday February 12, 1999 @ 10:48 Author: thies Update of /repository/php3/functions In directory asf:/u/temp/cvs-serv16802/functions Modified Files: oci8.c Log Message: support for BFLIES (external files that can be read thru OCI8) Index: php3/functions/oci8.c diff -c php3/functions/oci8.c:1.42 php3/functions/oci8.c:1.43 *** php3/functions/oci8.c:1.42 Fri Feb 12 09:12:08 1999 --- php3/functions/oci8.c Fri Feb 12 10:48:43 1999 *************** *** 32,38 **** +----------------------------------------------------------------------+ */ ! /* $Id: oci8.c,v 1.42 1999/02/12 14:12:08 thies Exp $ */ #include "php.h" #include "internal_functions.h" --- 32,38 ---- +----------------------------------------------------------------------+ */ ! /* $Id: oci8.c,v 1.43 1999/02/12 15:48:43 thies Exp $ */ #include "php.h" #include "internal_functions.h" *************** *** 58,63 **** --- 58,65 ---- * - support LONG > 64K * - binding of arrays * - Truncate input values to the bind size???? + * - Character sets for NCLOBS + * - piecewise operation for longs, lobs etc */ /* {{{ thread safety stuff */ *************** *** 281,293 **** } /* thies@digicol.de 990203 i do not think that we will need all of them - just in here for completeness for now! */ - REGISTER_LONG_CONSTANT("OCI_DEFAULT",OCI_DEFAULT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OCI_DESCRIBE_ONLY",OCI_DESCRIBE_ONLY, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OCI_COMMIT_ON_SUCCESS",OCI_COMMIT_ON_SUCCESS, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OCI_EXACT_FETCH",OCI_EXACT_FETCH, CONST_CS | CONST_PERSISTENT); /* for OCIBindByName */ REGISTER_LONG_CONSTANT("SQLT_CLOB",SQLT_CLOB, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SQLT_BLOB",SQLT_BLOB, CONST_CS | CONST_PERSISTENT); --- 283,296 ---- } /* thies@digicol.de 990203 i do not think that we will need all of them - just in here for completeness for now! */ REGISTER_LONG_CONSTANT("OCI_DEFAULT",OCI_DEFAULT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OCI_DESCRIBE_ONLY",OCI_DESCRIBE_ONLY, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OCI_COMMIT_ON_SUCCESS",OCI_COMMIT_ON_SUCCESS, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OCI_EXACT_FETCH",OCI_EXACT_FETCH, CONST_CS | CONST_PERSISTENT); /* for OCIBindByName */ + REGISTER_LONG_CONSTANT("SQLT_BFILEE",SQLT_BFILEE, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SQLT_CFILEE",SQLT_CFILEE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SQLT_CLOB",SQLT_CLOB, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SQLT_BLOB",SQLT_BLOB, CONST_CS | CONST_PERSISTENT); *************** *** 297,302 **** --- 300,309 ---- REGISTER_LONG_CONSTANT("OCI_BOTH",OCI_BOTH, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OCI_RETURN_NULLS",OCI_RETURN_NULLS, CONST_CS | CONST_PERSISTENT); + /* for OCINewDescriptor */ + REGISTER_LONG_CONSTANT("OCI_DTYPE_FILE",OCI_DTYPE_FILE, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("OCI_DTYPE_LOB",OCI_DTYPE_LOB, CONST_CS | CONST_PERSISTENT); + return SUCCESS; } *************** *** 1292,1298 **** (dvoid *)0, (OCICallbackLobWrite) 0, (ub2) 0, ! (ub1) SQLCS_IMPLICIT); oci8_debug("OCISaveLob: size=%d",loblen); --- 1299,1305 ---- (dvoid *)0, (OCICallbackLobWrite) 0, (ub2) 0, ! (ub1) SQLCS_IMPLICIT ); oci8_debug("OCISaveLob: size=%d",loblen); *************** *** 1364,1369 **** --- 1371,1388 ---- RETURN_FALSE; } + if (descr->type == OCI_DTYPE_FILE) { + ociresult = OCILobFileOpen(connection->pServiceContext, + connection->pError, + mylob, + OCI_FILE_READONLY); + if (ociresult) { + oci8_error(connection->pError, "OCILobRead: OCILobFileOpen", ociresult); + efree(buffer); + RETURN_FALSE; + } + } + ociresult = OCILobRead(connection->pServiceContext, connection->pError, mylob, *************** *** 1376,1381 **** --- 1395,1411 ---- (ub2) 0, /* The character set ID of the buffer data. */ (ub1) SQLCS_IMPLICIT); /* The character set form of the buffer data. */ + if (descr->type == OCI_DTYPE_FILE) { + ociresult = OCILobFileClose(connection->pServiceContext, + connection->pError, + mylob); + if (ociresult) { + oci8_error(connection->pError, "OCILobRead: OCILobFileClose", ociresult); + efree(buffer); + RETURN_FALSE; + } + } + if (ociresult) { oci8_error(connection->pError, "OCILobRead", ociresult); efree(buffer); *************** *** 1394,1415 **** /* }}} */ /* {{{ proto string OCINewDescriptor(int connection [,int type ]) ! initialize a new empty descriptor (currently only LOB is supported). */ void php3_oci8_newdescriptor(INTERNAL_FUNCTION_PARAMETERS) { ! pval *conn; sword ociresult; oci8_connection *connection; oci8_descriptor descr; int mylob; OCI8_TLS_VARS; ! if (getParameters(ht, 1, &conn) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long(conn); connection = oci8_get_conn(conn->value.lval, "OCINewDescriptor", list, plist); --- 1424,1450 ---- /* }}} */ /* {{{ proto string OCINewDescriptor(int connection [,int type ]) ! initialize a new empty descriptor LOB/FILE (LOB is default) */ void php3_oci8_newdescriptor(INTERNAL_FUNCTION_PARAMETERS) { ! pval *conn, *type; sword ociresult; oci8_connection *connection; oci8_descriptor descr; int mylob; OCI8_TLS_VARS; + + descr.type = OCI_DTYPE_LOB; ! if (getParameters(ht, 2, &conn, &type) == SUCCESS) { ! descr.type = type->value.lval; ! } else if (getParameters(ht, 1, &conn) == FAILURE) { WRONG_PARAM_COUNT; } + convert_to_long(conn); connection = oci8_get_conn(conn->value.lval, "OCINewDescriptor", list, plist); *************** *** 1417,1423 **** RETURN_FALSE; } - descr.type = OCI_DTYPE_LOB; ociresult = OCIDescriptorAlloc(connection->pEnv,(dvoid*)&(descr.lob), descr.type, (size_t) 0, (dvoid **) 0); if (ociresult) { --- 1452,1457 ---- -- 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

« previous php.dev (#4069) next »