summaryrefslogtreecommitdiff
path: root/ext/pdo_odbc
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-08-25 19:24:55 +0200
committerAnatol Belski <ab@php.net>2014-08-25 19:24:55 +0200
commitc3e3c98ec666812daaaca896cf5ef758a8a6df14 (patch)
treed82a76de5c8d117d1cf2dcca19bb30a283621870 /ext/pdo_odbc
parent0cf2dbdf58645b52cb6582b1b2571c5cd9e9e6b3 (diff)
downloadphp-git-c3e3c98ec666812daaaca896cf5ef758a8a6df14.tar.gz
master renames phase 1
Diffstat (limited to 'ext/pdo_odbc')
-rw-r--r--ext/pdo_odbc/odbc_driver.c14
-rw-r--r--ext/pdo_odbc/odbc_stmt.c44
-rw-r--r--ext/pdo_odbc/pdo_odbc.c10
-rw-r--r--ext/pdo_odbc/php_pdo_odbc_int.h4
4 files changed, 36 insertions, 36 deletions
diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c
index 3a7bf0a37b..e99463de58 100644
--- a/ext/pdo_odbc/odbc_driver.c
+++ b/ext/pdo_odbc/odbc_driver.c
@@ -48,7 +48,7 @@ static int pdo_odbc_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *inf
einfo->what, einfo->last_error,
einfo->file, einfo->line);
- add_next_index_int(info, einfo->last_error);
+ add_next_index_long(info, einfo->last_error);
add_next_index_str(info, message);
add_next_index_string(info, einfo->last_state);
@@ -142,7 +142,7 @@ static int odbc_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
return 0;
}
-static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, php_int_t sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
{
RETCODE rc;
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
@@ -181,7 +181,7 @@ static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, php_int_t sql_l
return 0;
}
- cursor_type = pdo_attr_ival(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY TSRMLS_CC);
+ cursor_type = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY TSRMLS_CC);
if (cursor_type != PDO_CURSOR_FWDONLY) {
rc = SQLSetStmtAttr(S->stmt, SQL_ATTR_CURSOR_SCROLLABLE, (void*)SQL_SCROLLABLE, 0);
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
@@ -220,7 +220,7 @@ static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, php_int_t sql_l
return 1;
}
-static php_int_t odbc_handle_doer(pdo_dbh_t *dbh, const char *sql, php_int_t sql_len TSRMLS_DC)
+static zend_long odbc_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len TSRMLS_DC)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
RETCODE rc;
@@ -336,7 +336,7 @@ static int odbc_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
return 1;
}
-static int odbc_handle_set_attr(pdo_dbh_t *dbh, php_int_t attr, zval *val TSRMLS_DC)
+static int odbc_handle_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
switch (attr) {
@@ -351,7 +351,7 @@ static int odbc_handle_set_attr(pdo_dbh_t *dbh, php_int_t attr, zval *val TSRMLS
}
}
-static int odbc_handle_get_attr(pdo_dbh_t *dbh, php_int_t attr, zval *val TSRMLS_DC)
+static int odbc_handle_get_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
switch (attr) {
@@ -431,7 +431,7 @@ static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_D
}
/* set up the cursor library, if needed, or if configured explicitly */
- cursor_lib = pdo_attr_ival(driver_options, PDO_ODBC_ATTR_USE_CURSOR_LIBRARY, SQL_CUR_USE_IF_NEEDED TSRMLS_CC);
+ cursor_lib = pdo_attr_lval(driver_options, PDO_ODBC_ATTR_USE_CURSOR_LIBRARY, SQL_CUR_USE_IF_NEEDED TSRMLS_CC);
rc = SQLSetConnectAttr(H->dbc, SQL_ODBC_CURSORS, (void*)cursor_lib, SQL_IS_INTEGER);
if (rc != SQL_SUCCESS && cursor_lib != SQL_CUR_USE_IF_NEEDED) {
pdo_odbc_drv_error("SQLSetConnectAttr SQL_ODBC_CURSORS");
diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c
index 7e2b958a53..274ce9b0d6 100644
--- a/ext/pdo_odbc/odbc_stmt.c
+++ b/ext/pdo_odbc/odbc_stmt.c
@@ -58,7 +58,7 @@ static int pdo_odbc_sqltype_is_unicode(pdo_odbc_stmt *S, SWORD sqltype)
}
static int pdo_odbc_utf82ucs2(pdo_stmt_t *stmt, int is_unicode, const char *buf,
- php_uint_t buflen, php_uint_t *outlen)
+ zend_ulong buflen, zend_ulong *outlen)
{
#ifdef PHP_WIN32
if (is_unicode && buflen) {
@@ -93,7 +93,7 @@ static int pdo_odbc_utf82ucs2(pdo_stmt_t *stmt, int is_unicode, const char *buf,
}
static int pdo_odbc_ucs22utf8(pdo_stmt_t *stmt, int is_unicode, const char *buf,
- php_uint_t buflen, php_uint_t *outlen)
+ zend_ulong buflen, zend_ulong *outlen)
{
#ifdef PHP_WIN32
if (is_unicode && buflen) {
@@ -190,16 +190,16 @@ static int odbc_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
}
if (Z_TYPE_P(parameter) != IS_RESOURCE) {
/* they passed in a string */
- php_uint_t ulen;
+ zend_ulong ulen;
convert_to_string(parameter);
switch (pdo_odbc_utf82ucs2(stmt, P->is_unicode,
Z_STRVAL_P(parameter),
- Z_STRSIZE_P(parameter),
+ Z_STRLEN_P(parameter),
&ulen)) {
case PDO_ODBC_CONV_NOT_REQUIRED:
SQLPutData(S->stmt, Z_STRVAL_P(parameter),
- Z_STRSIZE_P(parameter));
+ Z_STRLEN_P(parameter));
break;
case PDO_ODBC_CONV_OK:
SQLPutData(S->stmt, S->convbuf, ulen);
@@ -447,10 +447,10 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p
} else {
convert_to_string(parameter);
if (P->outbuf) {
- P->len = Z_STRSIZE_P(parameter);
+ P->len = Z_STRLEN_P(parameter);
memcpy(P->outbuf, Z_STRVAL_P(parameter), P->len);
} else {
- P->len = SQL_LEN_DATA_AT_EXEC(Z_STRSIZE_P(parameter));
+ P->len = SQL_LEN_DATA_AT_EXEC(Z_STRLEN_P(parameter));
}
}
} else if (Z_TYPE_P(parameter) == IS_NULL || PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_NULL) {
@@ -458,14 +458,14 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p
} else {
convert_to_string(parameter);
if (P->outbuf) {
- php_uint_t ulen;
+ zend_ulong ulen;
switch (pdo_odbc_utf82ucs2(stmt, P->is_unicode,
Z_STRVAL_P(parameter),
- Z_STRSIZE_P(parameter),
+ Z_STRLEN_P(parameter),
&ulen)) {
case PDO_ODBC_CONV_FAIL:
case PDO_ODBC_CONV_NOT_REQUIRED:
- P->len = Z_STRSIZE_P(parameter);
+ P->len = Z_STRLEN_P(parameter);
memcpy(P->outbuf, Z_STRVAL_P(parameter), P->len);
break;
case PDO_ODBC_CONV_OK:
@@ -474,7 +474,7 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p
break;
}
} else {
- P->len = SQL_LEN_DATA_AT_EXEC(Z_STRSIZE_P(parameter));
+ P->len = SQL_LEN_DATA_AT_EXEC(Z_STRLEN_P(parameter));
}
}
return 1;
@@ -483,9 +483,9 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p
P = param->driver_data;
if (P->outbuf) {
- php_uint_t ulen;
+ zend_ulong ulen;
char *srcbuf;
- php_uint_t srclen = 0;
+ zend_ulong srclen = 0;
if (Z_ISREF(param->parameter)) {
parameter = Z_REFVAL(param->parameter);
@@ -512,9 +512,9 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p
break;
}
- ZVAL_NEW_STR(parameter, STR_ALLOC(srclen, 0));
+ ZVAL_NEW_STR(parameter, zend_string_alloc(srclen, 0));
memcpy(Z_STRVAL_P(parameter), srcbuf, srclen);
- Z_STRVAL_P(parameter)[Z_STRSIZE_P(parameter)] = '\0';
+ Z_STRVAL_P(parameter)[Z_STRLEN_P(parameter)] = '\0';
}
}
return 1;
@@ -524,7 +524,7 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p
}
static int odbc_stmt_fetch(pdo_stmt_t *stmt,
- enum pdo_fetch_orientation ori, php_int_t offset TSRMLS_DC)
+ enum pdo_fetch_orientation ori, zend_long offset TSRMLS_DC)
{
RETCODE rc;
SQLSMALLINT odbcori;
@@ -628,15 +628,15 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
return 1;
}
-static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, php_uint_t *len, int *caller_frees TSRMLS_DC)
+static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees TSRMLS_DC)
{
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
pdo_odbc_column *C = &S->cols[colno];
- php_uint_t ulen;
+ zend_ulong ulen;
/* if it is a column containing "long" data, perform late binding now */
if (C->is_long) {
- php_uint_t used = 0;
+ zend_ulong used = 0;
char *buf;
RETCODE rc;
@@ -755,7 +755,7 @@ in_data:
return 1;
}
-static int odbc_stmt_set_param(pdo_stmt_t *stmt, php_int_t attr, zval *val TSRMLS_DC)
+static int odbc_stmt_set_param(pdo_stmt_t *stmt, zend_long attr, zval *val TSRMLS_DC)
{
SQLRETURN rc;
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
@@ -763,7 +763,7 @@ static int odbc_stmt_set_param(pdo_stmt_t *stmt, php_int_t attr, zval *val TSRML
switch (attr) {
case PDO_ATTR_CURSOR_NAME:
convert_to_string(val);
- rc = SQLSetCursorName(S->stmt, Z_STRVAL_P(val), Z_STRSIZE_P(val));
+ rc = SQLSetCursorName(S->stmt, Z_STRVAL_P(val), Z_STRLEN_P(val));
if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) {
return 1;
@@ -782,7 +782,7 @@ static int odbc_stmt_set_param(pdo_stmt_t *stmt, php_int_t attr, zval *val TSRML
}
}
-static int odbc_stmt_get_attr(pdo_stmt_t *stmt, php_int_t attr, zval *val TSRMLS_DC)
+static int odbc_stmt_get_attr(pdo_stmt_t *stmt, zend_long attr, zval *val TSRMLS_DC)
{
SQLRETURN rc;
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
diff --git a/ext/pdo_odbc/pdo_odbc.c b/ext/pdo_odbc/pdo_odbc.c
index f78b1af8ec..1fe17c1c30 100644
--- a/ext/pdo_odbc/pdo_odbc.c
+++ b/ext/pdo_odbc/pdo_odbc.c
@@ -136,11 +136,11 @@ PHP_MINIT_FUNCTION(pdo_odbc)
}
#endif
- REGISTER_PDO_CLASS_CONST_INT("ODBC_ATTR_USE_CURSOR_LIBRARY", PDO_ODBC_ATTR_USE_CURSOR_LIBRARY);
- REGISTER_PDO_CLASS_CONST_INT("ODBC_ATTR_ASSUME_UTF8", PDO_ODBC_ATTR_ASSUME_UTF8);
- REGISTER_PDO_CLASS_CONST_INT("ODBC_SQL_USE_IF_NEEDED", SQL_CUR_USE_IF_NEEDED);
- REGISTER_PDO_CLASS_CONST_INT("ODBC_SQL_USE_DRIVER", SQL_CUR_USE_DRIVER);
- REGISTER_PDO_CLASS_CONST_INT("ODBC_SQL_USE_ODBC", SQL_CUR_USE_ODBC);
+ REGISTER_PDO_CLASS_CONST_LONG("ODBC_ATTR_USE_CURSOR_LIBRARY", PDO_ODBC_ATTR_USE_CURSOR_LIBRARY);
+ REGISTER_PDO_CLASS_CONST_LONG("ODBC_ATTR_ASSUME_UTF8", PDO_ODBC_ATTR_ASSUME_UTF8);
+ REGISTER_PDO_CLASS_CONST_LONG("ODBC_SQL_USE_IF_NEEDED", SQL_CUR_USE_IF_NEEDED);
+ REGISTER_PDO_CLASS_CONST_LONG("ODBC_SQL_USE_DRIVER", SQL_CUR_USE_DRIVER);
+ REGISTER_PDO_CLASS_CONST_LONG("ODBC_SQL_USE_ODBC", SQL_CUR_USE_ODBC);
return SUCCESS;
}
diff --git a/ext/pdo_odbc/php_pdo_odbc_int.h b/ext/pdo_odbc/php_pdo_odbc_int.h
index c467ecf83a..90d9d5d505 100644
--- a/ext/pdo_odbc/php_pdo_odbc_int.h
+++ b/ext/pdo_odbc/php_pdo_odbc_int.h
@@ -135,7 +135,7 @@ typedef struct {
typedef struct {
char *data;
- php_uint_t datalen;
+ zend_ulong datalen;
SQLLEN fetched_len;
SWORD coltype;
char colname[128];
@@ -150,7 +150,7 @@ typedef struct {
pdo_odbc_db_handle *H;
pdo_odbc_errinfo einfo;
char *convbuf;
- php_uint_t convbufsize;
+ zend_ulong convbufsize;
unsigned going_long:1;
unsigned assume_utf8:1;
unsigned _spare:30;