abies Wed Aug 20 12:13:51 2003 EDT
Modified files:
/php-src/ext/interbase php_interbase.h interbase.c
Log:
Moved transaction defaults to header file
Index: php-src/ext/interbase/php_interbase.h
diff -u php-src/ext/interbase/php_interbase.h:1.54
php-src/ext/interbase/php_interbase.h:1.55
--- php-src/ext/interbase/php_interbase.h:1.54 Wed Aug 20 08:22:58 2003
+++ php-src/ext/interbase/php_interbase.h Wed Aug 20 12:13:51 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_interbase.h,v 1.54 2003/08/20 12:22:58 abies Exp $ */
+/* $Id: php_interbase.h,v 1.55 2003/08/20 16:13:51 abies Exp $ */
#ifndef PHP_INTERBASE_H
#define PHP_INTERBASE_H
@@ -180,23 +180,26 @@
enum php_interbase_option {
PHP_IBASE_DEFAULT = 0,
- PHP_IBASE_UNIXTIME = 2,
- PHP_IBASE_TIMESTAMP = 4,
- PHP_IBASE_DATE = 8,
- PHP_IBASE_TIME = 16,
- /* fetch args */
+ /* fetch flags */
PHP_IBASE_FETCH_BLOBS = 1,
PHP_IBASE_FETCH_ARRAYS = 2,
- /* transactions */
- PHP_IBASE_WRITE = 2,
- PHP_IBASE_READ = 4,
- PHP_IBASE_COMMITTED = 8,
- PHP_IBASE_CONSISTENCY = 16,
- PHP_IBASE_CONCURRENCY = 32,
- PHP_IBASE_REC_VERSION = 64,
- PHP_IBASE_REC_NO_VERSION = 128,
- PHP_IBASE_NOWAIT = 256,
- PHP_IBASE_WAIT = 512
+ PHP_IBASE_UNIXTIME = 4,
+ /* timefmt flags */
+ PHP_IBASE_TIMESTAMP = 1,
+ PHP_IBASE_DATE = 2,
+ PHP_IBASE_TIME = 4,
+ /* transaction access mode */
+ PHP_IBASE_WRITE = 0, /* default */
+ PHP_IBASE_READ = 1,
+ /* transaction isolation level */
+ PHP_IBASE_CONCURRENCY = 0, /* default */
+ PHP_IBASE_COMMITTED = 2,
+ PHP_IBASE_REC_NO_VERSION = 0, /* default */
+ PHP_IBASE_REC_VERSION = 4,
+ PHP_IBASE_CONSISTENCY = 8,
+ /* transaction lock resolution */
+ PHP_IBASE_WAIT = 0, /* default */
+ PHP_IBASE_NOWAIT = 16
};
#ifdef ZTS
Index: php-src/ext/interbase/interbase.c
diff -u php-src/ext/interbase/interbase.c:1.157 php-src/ext/interbase/interbase.c:1.158
--- php-src/ext/interbase/interbase.c:1.157 Wed Aug 20 09:02:26 2003
+++ php-src/ext/interbase/interbase.c Wed Aug 20 12:13:51 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: interbase.c,v 1.157 2003/08/20 13:02:26 abies Exp $ */
+/* $Id: interbase.c,v 1.158 2003/08/20 16:13:51 abies Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -276,7 +276,6 @@
short sqlind;
} BIND_BUF;
-
static inline int _php_ibase_string_to_quad(char const *id, ISC_QUAD *qd)
{
/* shortcut for most common case */
@@ -284,10 +283,12 @@
return sscanf(id, BLOB_ID_MASK, (ISC_UINT64 *) qd);
} else {
ISC_UINT64 res;
- int n = sscanf(id, BLOB_ID_MASK, &res);
- qd->gds_quad_high = (long) (res >> 0x20);
- qd->gds_quad_low = (unsigned long) (res & 0xFFFFFFFF);
- return n;
+ if (sscanf(id, BLOB_ID_MASK, &res)) {
+ qd->gds_quad_high = (ISC_LONG) (res >> 0x20);
+ qd->gds_quad_low = (ISC_ULONG) (res & 0xFFFFFFFF);
+ return 1;
+ }
+ return 0;
}
}
@@ -684,7 +685,7 @@
php_info_print_table_start();
php_info_print_table_row(2, "Interbase Support", "enabled");
- php_info_print_table_row(2, "Revision", "$Revision: 1.157 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.158 $");
#ifdef COMPILE_DL_INTERBASE
php_info_print_table_row(2, "Dynamic Module", "Yes");
#endif
@@ -1785,31 +1786,31 @@
last_tpb[tpb_len++] = isc_tpb_version3;
/* access mode */
- if (trans_argl & PHP_IBASE_READ) { /* READ
ONLY TRANSACTION */
+ if (PHP_IBASE_READ == (trans_argl &
PHP_IBASE_READ)) {
last_tpb[tpb_len++] = isc_tpb_read;
- } else {
- last_tpb[tpb_len++] = isc_tpb_write;
/* default access mode */
+ } else if (PHP_IBASE_WRITE == (trans_argl &
PHP_IBASE_WRITE)) {
+ last_tpb[tpb_len++] = isc_tpb_write;
}
/* isolation level */
- if (trans_argl & PHP_IBASE_COMMITTED) {
+ if (PHP_IBASE_COMMITTED == (trans_argl &
PHP_IBASE_COMMITTED)) {
last_tpb[tpb_len++] =
isc_tpb_read_committed;
- if (trans_argl &
PHP_IBASE_REC_VERSION) {
+ if (PHP_IBASE_REC_VERSION ==
(trans_argl & PHP_IBASE_REC_VERSION)) {
last_tpb[tpb_len++] =
isc_tpb_rec_version;
- } else {
- last_tpb[tpb_len++] =
isc_tpb_no_rec_version; /* default in read_committed */
+ } else if (PHP_IBASE_REC_NO_VERSION ==
(trans_argl & PHP_IBASE_REC_NO_VERSION)) {
+ last_tpb[tpb_len++] =
isc_tpb_no_rec_version;
}
- } else if (trans_argl & PHP_IBASE_CONSISTENCY)
{
+ } else if (PHP_IBASE_CONSISTENCY ==
(trans_argl & PHP_IBASE_CONSISTENCY)) {
last_tpb[tpb_len++] =
isc_tpb_consistency;
- } else {
- last_tpb[tpb_len++] =
isc_tpb_concurrency; /* default isolation level */
+ } else if (PHP_IBASE_CONCURRENCY ==
(trans_argl & PHP_IBASE_CONCURRENCY)) {
+ last_tpb[tpb_len++] =
isc_tpb_concurrency;
}
/* lock resolution */
- if (trans_argl & PHP_IBASE_NOWAIT) {
+ if (PHP_IBASE_NOWAIT == (trans_argl &
PHP_IBASE_NOWAIT)) {
last_tpb[tpb_len++] = isc_tpb_nowait;
- } else {
- last_tpb[tpb_len++] = isc_tpb_wait;
/* default lock resolution */
+ } else if (PHP_IBASE_WAIT == (trans_argl &
PHP_IBASE_WAIT)) {
+ last_tpb[tpb_len++] = isc_tpb_wait;
}
}
}
@@ -3550,7 +3551,7 @@
zval **blob_arg, **link_arg;
ibase_db_link *link;
ibase_trans *trans = NULL;
- ibase_blob ib_blob_id = { NULL, { 0, 0 }, 0 };
+ ibase_blob ib_blob_id = { NULL, { 0, 0 }, BLOB_OUTPUT };
char bl_data[IBASE_BLOB_SEG];
unsigned short seg_len;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php