]> granicus.if.org Git - php/commitdiff
forgot to commit new pdo_attr_ function
authorAntony Dovgal <tony2001@php.net>
Thu, 27 Oct 2005 19:38:36 +0000 (19:38 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 27 Oct 2005 19:38:36 +0000 (19:38 +0000)
ext/pdo/php_pdo_driver.h

index c9244a82b4b6fd94da31aa489230dea354c4f136..d0543cb2c1f09231c399c222235a3e87802a51cd 100755 (executable)
@@ -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