cur->open = 1;
cur->name = estrdup(name_str);
cur->decl = decl;
+ cur->flags = flags;
return_value->type = IS_OBJECT;
return_value->value.obj = php_pqcur_create_object_ex(php_pqcur_class_entry, cur, NULL TSRMLS_CC);
php_pq_object_to_zval(obj->intern->conn, &return_value TSRMLS_CC);
}
+static void php_pqcur_object_read_flags(zval *object, void *o, zval *return_value TSRMLS_DC)
+{
+ php_pqcur_object_t *obj = o;
+
+ RETVAL_LONG(obj->intern->flags);
+}
+
char *php_pqcur_declare_str(const char *name_str, size_t name_len, unsigned flags, const char *query_str, size_t query_len)
{
size_t decl_len = name_len + query_len + sizeof("DECLARE BINARY INSENSITIVE NO SCROLL CURSOR WITH HOLD FOR ");
cur->open = 1;
cur->name = estrdup(name_str);
cur->decl = decl;
+ cur->flags = flags;
obj->intern = cur;
}
}
ph.read = php_pqcur_object_read_connection;
zend_hash_add(&php_pqcur_object_prophandlers, "connection", sizeof("connection"), (void *) &ph, sizeof(ph), NULL);
+ zend_declare_property_null(php_pqcur_class_entry, ZEND_STRL("flags"), ZEND_ACC_PUBLIC TSRMLS_CC);
+ ph.read = php_pqcur_object_read_flags;
+ zend_hash_add(&php_pqcur_object_prophandlers, "flags", sizeof("flags"), (void *) &ph, sizeof(ph), NULL);
+
return SUCCESS;
}