CVS update: php3/functions
| From: | jah | Date: | Sun, 20 Sep 1998 01:20:26 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-1296@lists.php.net to get a copy of this message | ||
Date: Saturday September 19, 1998 @ 21:20
Author: jah
Update of /repository/php3/functions
In directory asf:/u2/tmp/cvs-serv22721/functions
Modified Files:
ifx.ec
Log Message:
(Would make same sense to commit the changes to the code which made me
change the docs...)
2 cursor_type parameters for ifx_query() and ifx_prepare changed
to 1 (bitmask). Added a few constants for future use in Informix module.
Some (small) cleanups on the way.
Index: php3/functions/ifx.ec
diff -c php3/functions/ifx.ec:1.24 php3/functions/ifx.ec:1.25
*** php3/functions/ifx.ec:1.24 Sat Sep 19 15:11:57 1998
--- php3/functions/ifx.ec Sat Sep 19 21:20:25 1998
***************
*** 124,129 ****
--- 124,131 ----
#define BL_TEXT 1
#define BL_INMEM 0
#define BL_INFILE 1
+ #define IFX_SCROLL 1
+ #define IFX_HOLD 2
EXEC SQL include locator;
EXEC SQL include sqltypes;
***************
*** 435,440 ****
--- 437,453 ----
#endif
ifx_module_entry.type = type;
+ REGISTER_LONG_CONSTANT("IFX_SCROLL", IFX_SCROLL, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IFX_HOLD", IFX_HOLD, CONST_CS | CONST_PERSISTENT);
+ $ifdef HAVE_IFX_IUS;
+ REGISTER_LONG_CONSTANT("IFX_LO_RDONLY", LO_RDONLY, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IFX_LO_WRONLY", LO_WRONLY, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IFX_LO_APPEND", LO_APPEND, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IFX_LO_RDWR", LO_RDWR, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IFX_LO_BUFFER", LO_BUFFER, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IFX_LO_NOBUFFER", LO_NOBUFFER, CONST_CS | CONST_PERSISTENT);
+ $endif;
+
return SUCCESS;
}
***************
*** 855,867 ****
/* ----------------------------------------------------------------------
** int ifx_query(string $query, int $connid,
! ** string $hold, string $scroll, $blobidarray)
! ** $hold, $croll, and $blobidarray are optional
**
** executes query $query on connection $connid
** for select queries a cursor is declared and opened
** non-select queries are "execute immediate"
! ** select queries accept 2 optional params : "SCROLL" and/or "HOLD"
** non-select queries accept an optional "blobarryid" parameter
** blobsupport: mark the blob-column(s) with ? in the insert/update query
** and add a blob-id-array-functionparameter
--- 868,880 ----
/* ----------------------------------------------------------------------
** int ifx_query(string $query, int $connid,
! ** int $cursortype, $blobidarray)
! ** $cursortype and $blobidarray are optional
**
** executes query $query on connection $connid
** for select queries a cursor is declared and opened
** non-select queries are "execute immediate"
! ** select queries accept an optional cursortype param: IFX_SCROLL, IFX_HOLD (or'ed mask)
** non-select queries accept an optional "blobarryid" parameter
** blobsupport: mark the blob-column(s) with ? in the insert/update query
** and add a blob-id-array-functionparameter
***************
*** 877,883 ****
void php3_ifx_query(INTERNAL_FUNCTION_PARAMETERS)
{
! pval *query,*ifx_link, *cursortype1, *cursortype2, *dummy;
int id,type;
IFX_RES *Ifx_Result;
--- 890,896 ----
void php3_ifx_query(INTERNAL_FUNCTION_PARAMETERS)
{
! pval *query,*ifx_link, *cursortype, *dummy;
int id,type;
IFX_RES *Ifx_Result;
***************
*** 897,904 ****
char *blobfilename;
int locind;
! char *ctype1, *ctype2;
! int affected_rows;
Informix_TLS_VARS;
--- 910,917 ----
char *blobfilename;
int locind;
! int ctype;
! int affected_rows;
Informix_TLS_VARS;
***************
*** 1065,1071 ****
**
*/
! ctype1 = ctype2 = NULL; /* preset */
switch(ARG_COUNT(ht)) {
case 2:
--- 1078,1084 ----
**
*/
! ctype = 0; /* preset */
switch(ARG_COUNT(ht)) {
case 2:
***************
*** 1074,1102 ****
if (getParameters(ht, 3,
&dummy,
&dummy,
! &cursortype1)==FAILURE) {
RETURN_FALSE;
}
! convert_to_long(ifx_link);
! id = ifx_link->value.lval;
! convert_to_string(cursortype1);
! ctype1 = cursortype1->value.str.val;
break;
- case 4:
- if (getParameters(ht, 4,
- &dummy,
- &dummy,
- &cursortype1,
- &cursortype2)==FAILURE) {
- RETURN_FALSE;
- }
- convert_to_long(ifx_link);
- id = ifx_link->value.lval;
- convert_to_string(cursortype1);
- ctype1 = cursortype1->value.str.val;
- convert_to_string(cursortype2);
- ctype2 = cursortype2->value.str.val;
- break;
default:
WRONG_PARAM_COUNT;
break;
--- 1087,1098 ----
if (getParameters(ht, 3,
&dummy,
&dummy,
! &cursortype)==FAILURE) {
RETURN_FALSE;
}
! convert_to_long(cursortype);
! ctype = cursortype->value.lval;
break;
default:
WRONG_PARAM_COUNT;
break;
***************
*** 1119,1139 ****
Ifx_Result->numcols = fieldcount;
Ifx_Result->isscroll = Ifx_Result->ishold = 0;
! if (ctype1 != NULL) {
! if (strcasecmp(ctype1,"SCROLL") == 0)
! Ifx_Result->isscroll = 1;
! else
! if (strcasecmp(ctype1,"HOLD") == 0)
! Ifx_Result->ishold = 1;
! }
! if (ctype2 != NULL) {
! if (strcasecmp(ctype2,"SCROLL") == 0)
! Ifx_Result->isscroll = 1;
! else
! if (strcasecmp(ctype2,"HOLD") == 0)
! Ifx_Result->ishold = 1;
! }
!
if (Ifx_Result->isscroll)
if (Ifx_Result->ishold)
--- 1115,1124 ----
Ifx_Result->numcols = fieldcount;
Ifx_Result->isscroll = Ifx_Result->ishold = 0;
! if (ctype & IFX_SCROLL)
! Ifx_Result->isscroll = 1;
! if (ctype & IFX_HOLD)
! Ifx_Result->ishold = 1;
if (Ifx_Result->isscroll)
if (Ifx_Result->ishold)
***************
*** 1209,1221 ****
/* ----------------------------------------------------------------------
** int ifx_prepare(string $query, int $connid,
! ** string $hold, string $scroll, array $blobidarry)
**
** $hold, $scroll are optional and valid only for select queries
** $blobidarray is optional, an array of blob id's
**
** prepares query $query on connection $connid
! ** select queries accept 2 optional params : "SCROLL" and/or "HOLD"
** blobsupport: mark the blob-column with ? and add a blob-id-functionparameter
** example: ifx_query("insert into catalog (stock_num, manu_code ,cat_descr,
** cat_picture) values(1,'HRO',?,?)",$cid,$bid1,$bid2);
--- 1194,1206 ----
/* ----------------------------------------------------------------------
** int ifx_prepare(string $query, int $connid,
! ** int $cursortype, array $blobidarry)
**
** $hold, $scroll are optional and valid only for select queries
** $blobidarray is optional, an array of blob id's
**
** prepares query $query on connection $connid
! ** select queries accept an optional cursortype param: IFX_SCROLL, IFX_HOLD (or'ed mask)
** blobsupport: mark the blob-column with ? and add a blob-id-functionparameter
** example: ifx_query("insert into catalog (stock_num, manu_code ,cat_descr,
** cat_picture) values(1,'HRO',?,?)",$cid,$bid1,$bid2);
***************
*** 1228,1234 ****
void php3_ifx_prepare(INTERNAL_FUNCTION_PARAMETERS)
{
! pval *query,*ifx_link, *cursortype1, *cursortype2, *dummy;
int id,type;
IFX_RES *Ifx_Result;
--- 1213,1219 ----
void php3_ifx_prepare(INTERNAL_FUNCTION_PARAMETERS)
{
! pval *query,*ifx_link, *cursortype, *dummy;
int id,type;
IFX_RES *Ifx_Result;
***************
*** 1248,1254 ****
char *blobfilename;
int locind;
! char *ctype1, *ctype2;
int affected_rows;
Informix_TLS_VARS;
--- 1233,1239 ----
char *blobfilename;
int locind;
! int ctype;
int affected_rows;
Informix_TLS_VARS;
***************
*** 1405,1411 ****
**
*/
! ctype1 = ctype2 = NULL; /* preset */
switch(ARG_COUNT(ht)) {
case 2:
--- 1390,1396 ----
**
*/
! ctype = 0;; /* preset */
switch(ARG_COUNT(ht)) {
case 2:
***************
*** 1413,1441 ****
case 3:
if (getParameters(ht, 3,
&dummy,
- &dummy,
- &cursortype1)==FAILURE) {
- RETURN_FALSE;
- }
- convert_to_long(ifx_link);
- id = ifx_link->value.lval;
- convert_to_string(cursortype1);
- ctype1 = cursortype1->value.str.val;
- break;
- case 4:
- if (getParameters(ht, 4,
- &dummy,
&dummy,
! &cursortype1,
! &cursortype2)==FAILURE) {
RETURN_FALSE;
}
! convert_to_long(ifx_link);
! id = ifx_link->value.lval;
! convert_to_string(cursortype1);
! ctype1 = cursortype1->value.str.val;
! convert_to_string(cursortype2);
! ctype2 = cursortype2->value.str.val;
break;
default:
WRONG_PARAM_COUNT;
--- 1398,1409 ----
case 3:
if (getParameters(ht, 3,
&dummy,
&dummy,
! &cursortype)==FAILURE) {
RETURN_FALSE;
}
! convert_to_long(cursortype);
! ctype = cursortype->value.lval;
break;
default:
WRONG_PARAM_COUNT;
***************
*** 1459,1478 ****
Ifx_Result->numcols = fieldcount;
Ifx_Result->isscroll = Ifx_Result->ishold = 0;
! if (ctype1 != NULL) {
! if (strcasecmp(ctype1,"SCROLL") == 0)
! Ifx_Result->isscroll = 1;
! else
! if (strcasecmp(ctype1,"HOLD") == 0)
! Ifx_Result->ishold = 1;
! }
! if (ctype2 != NULL) {
! if (strcasecmp(ctype2,"SCROLL") == 0)
! Ifx_Result->isscroll = 1;
! else
! if (strcasecmp(ctype2,"HOLD") == 0)
! Ifx_Result->ishold = 1;
! }
} /* if select */
--- 1427,1436 ----
Ifx_Result->numcols = fieldcount;
Ifx_Result->isscroll = Ifx_Result->ishold = 0;
! if (ctype & IFX_SCROLL)
! Ifx_Result->isscroll = 1;
! if (ctype & IFX_HOLD)
! Ifx_Result->ishold = 1;
} /* if select */
--
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