summaryrefslogtreecommitdiff
path: root/ext/pdo/php_pdo_driver.h
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2005-10-27 19:39:38 +0000
committerAntony Dovgal <tony2001@php.net>2005-10-27 19:39:38 +0000
commita9cac89541297bd15af2ce6b0ae9e92b37e3e49b (patch)
tree184191fe6d3dfb78b3d0c1a2966188609e8925d1 /ext/pdo/php_pdo_driver.h
parent82120342542d05c1034e9961274738e214e13541 (diff)
downloadphp-git-a9cac89541297bd15af2ce6b0ae9e92b37e3e49b.tar.gz
MFH: commit forgotten part
Diffstat (limited to 'ext/pdo/php_pdo_driver.h')
-rwxr-xr-xext/pdo/php_pdo_driver.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h
index 8b6b7ac9a7..146d4c297c 100755
--- a/ext/pdo/php_pdo_driver.h
+++ b/ext/pdo/php_pdo_driver.h
@@ -193,6 +193,16 @@ static inline long pdo_attr_lval(zval *options, enum pdo_attribute_type option_n
}
return defval;
}
+static inline char *pdo_attr_strval(zval *options, enum pdo_attribute_type option_name, char *defval TSRMLS_DC)
+{
+ zval **v;
+
+ if (options && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(options), option_name, (void**)&v)) {
+ convert_to_string_ex(v);
+ return estrndup(Z_STRVAL_PP(v), Z_STRLEN_PP(v));
+ }
+ return defval ? estrdup(defval) : NULL;
+}
/* }}} */
/* This structure is registered with PDO when a PDO driver extension is