本文整理汇总了C++中RETURN_ZVAL函数的典型用法代码示例。如果您正苦于以下问题:C++ RETURN_ZVAL函数的具体用法?C++ RETURN_ZVAL怎么用?C++ RETURN_ZVAL使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RETURN_ZVAL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
/**
* Return the strategy to obtain the meta-data
*
* @return Phalcon\Mvc\Model\MetaData\Strategy\Introspection
*/
PHP_METHOD(Phalcon_Mvc_Model_MetaData, getStrategy){
zval *strategy;
strategy = phalcon_fetch_nproperty_this(this_ptr, SL("_strategy"), PH_NOISY TSRMLS_CC);
if (Z_TYPE_P(strategy) == IS_NULL) {
PHALCON_ALLOC_GHOST_ZVAL(strategy);
object_init_ex(strategy, phalcon_mvc_model_metadata_strategy_introspection_ce);
phalcon_update_property_this(this_ptr, SL("_strategy"), strategy TSRMLS_CC);
}
RETURN_ZVAL(strategy, 1, 0);
}
示例2: PHP_METHOD
/**
* Magic method to retrieve a variable passed to the view
*
*<code>
* echo $this->view->products;
*</code>
*
* @param string $key
* @return mixed
*/
PHP_METHOD(Phalcon_Mvc_View_Simple, __get){
zval *key, *params, *value;
phalcon_fetch_params(0, 1, 0, &key);
params = phalcon_fetch_nproperty_this(this_ptr, SL("_viewParams"), PH_NOISY TSRMLS_CC);
if (phalcon_array_isset_fetch(&value, params, key)) {
RETURN_ZVAL(value, 1, 0);
}
RETURN_NULL();
}
示例3: PHP_METHOD
PHP_METHOD(DefaultTable, compactionStrategyOptions)
{
cassandra_table* self;
zval* value;
if (zend_parse_parameters_none() == FAILURE)
return;
self = (cassandra_table*) zend_object_store_get_object(getThis() TSRMLS_CC);
php_cassandra_get_schema_field(self->meta, "compaction_strategy_options", &value TSRMLS_CC);
RETURN_ZVAL(value, 0, 1);
}
示例4: PHP_METHOD
//call the service
PHP_METHOD(air_async_service, call) {
AIR_INIT_THIS;
zval *waiter = zend_read_property(air_async_service_ce, self, ZEND_STRL("_waiter"), 0 TSRMLS_CC);
zval *self_id = zend_read_property(air_async_service_ce, self, ZEND_STRL("_id"), 0 TSRMLS_CC);
zval *ret = NULL;
zend_call_method_with_1_params(&waiter, Z_OBJCE_P(waiter), NULL, "response", &ret, self_id);
if(ret){
RETURN_ZVAL(ret, 1, 1);
}else{
RETURN_NULL();
}
}
示例5: PHP_METHOD
/**
* Returns the internal formatter
*
* @return Phalcon\Logger\FormatterInterface
*/
PHP_METHOD(Phalcon_Logger_Adapter_Firephp, getFormatter){
zval *formatter;
formatter = phalcon_read_property(getThis(), SL("_formatter"), PH_NOISY);
if (Z_TYPE_P(formatter) != IS_OBJECT) {
object_init_ex(return_value, phalcon_logger_formatter_firephp_ce);
phalcon_update_property_this(getThis(), SL("_formatter"), return_value);
return;
}
RETURN_ZVAL(formatter, 1, 0);
}
示例6: PHP_METHOD
/* {{{ proto SimpleXMLIterator SimpleXMLIterator::getChildren()
Get child element iterator */
PHP_METHOD(ce_SimpleXMLIterator, getChildren)
{
php_sxe_object *sxe = Z_SXEOBJ_P(getThis());
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if (Z_ISUNDEF(sxe->iter.data) || sxe->iter.type == SXE_ITER_ATTRLIST) {
return; /* return NULL */
}
RETURN_ZVAL(&sxe->iter.data, 1, 0);
}
示例7: zephir_array_get_current
/**
* Gets the current element in a zval hash
*/
void zephir_array_get_current(zval *return_value, zval *array) {
zval **entry;
if (Z_TYPE_P(array) == IS_ARRAY) {
if (zend_hash_get_current_data(Z_ARRVAL_P(array), (void **) &entry) == FAILURE) {
RETURN_FALSE;
}
RETURN_ZVAL(*entry, 1, 0);
}
RETURN_FALSE;
}
示例8: PHP_METHOD
PHP_METHOD(DefaultTable, caching)
{
cassandra_table *self;
php5to7_zval value;
if (zend_parse_parameters_none() == FAILURE)
return;
self = PHP_CASSANDRA_GET_TABLE(getThis());
php_cassandra_get_table_field(self->meta, "caching", &value TSRMLS_CC);
RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_P(value), 0, 1);
}
示例9: PHP_METHOD
/* {{{ MongoDBRef::create()
*
* DB refs are of the form:
* array( '$ref' => <collection>, '$id' => <id>[, $db => <dbname>] ) */
PHP_METHOD(MongoDBRef, create)
{
char *ns, *db = NULL;
int ns_len, db_len = 0;
zval *zid, *retval;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|s", &ns, &ns_len, &zid, &db, &db_len) == FAILURE) {
return;
}
retval = php_mongo_dbref_create(zid, ns, db TSRMLS_CC);
RETURN_ZVAL(retval, 0, 1);
}
示例10: PHP_METHOD
/* {{{ proto SimpleXMLIterator SimpleXMLIterator::getChildren()
Get child element iterator */
PHP_METHOD(ce_SimpleXMLIterator, getChildren)
{
php_sxe_object *sxe = php_sxe_fetch_object(getThis() TSRMLS_CC);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if (!sxe->iter.data || sxe->iter.type == SXE_ITER_ATTRLIST) {
return; /* return NULL */
}
RETURN_ZVAL(sxe->iter.data, 1, 0);
}
示例11: ONPHP_METHOD
ONPHP_METHOD(DBField, toDialectString)
{
smart_str string = {0};
zval *table, *field, *dialect, *cast, *quoted;
ONPHP_GET_ARGS("O", &dialect, onphp_ce_Dialect);
table = ONPHP_READ_PROPERTY(getThis(), "table");
field = ONPHP_READ_PROPERTY(getThis(), "field");
cast = ONPHP_READ_PROPERTY(getThis(), "cast");
// either null or instance of DialectString
if (Z_TYPE_P(table) == IS_OBJECT) {
zval *tmp;
ONPHP_CALL_METHOD_1(table, "todialectstring", &tmp, dialect);
onphp_append_zval_to_smart_string(&string, tmp);
zval_ptr_dtor(&tmp);
smart_str_appendc(&string, '.');
}
ONPHP_CALL_METHOD_1(dialect, "quotefield", "ed, field);
onphp_append_zval_to_smart_string(&string, quoted);
zval_ptr_dtor("ed);
smart_str_0(&string);
if (Z_STRLEN_P(cast)) {
zval *tmp, *out;
ALLOC_INIT_ZVAL(tmp);
ZVAL_STRINGL(tmp, string.c, string.len, 1);
ONPHP_CALL_METHOD_2_NORET(dialect, "tocasted", &out, tmp, cast);
ZVAL_FREE(tmp);
smart_str_free(&string);
if (EG(exception)) {
return;
}
RETURN_ZVAL(out, 1, 1);
}
RETURN_STRINGL(string.c, string.len, 0);
}
示例12: PHP_METHOD
/* {{{ proto string|array Riak\MapReduce\Input\BucketInput->getValue()
Returns value to use in Mapreduce */
PHP_METHOD(Riak_MapReduce_Input_BucketInput, getValue)
{
zval* zname, *zfilters, *zresult, *zindex;
zname = zend_read_property(riak_mrinput_bucket_ce, getThis(), "name", sizeof("name")-1, 1 TSRMLS_CC);
zfilters = zend_read_property(riak_mrinput_bucket_ce, getThis(), "keyFilters", sizeof("keyFilters")-1, 1 TSRMLS_CC);
zindex = zend_read_property(riak_mrinput_bucket_ce, getThis(), "idxname", sizeof("idxname")-1, 1 TSRMLS_CC);
if (Z_TYPE_P(zfilters) == IS_ARRAY || Z_TYPE_P(zindex) == IS_STRING) {
MAKE_STD_ZVAL(zresult);
array_init(zresult);
zval_addref_p(zname);
add_assoc_zval_ex(zresult, "bucket", sizeof("bucket"), zname);
if (Z_TYPE_P(zindex) == IS_STRING) {
zval *start, *end;
start = zend_read_property(riak_mrinput_bucket_ce, getThis(), "idxstart", sizeof("idxstart")-1, 1 TSRMLS_CC);
end = zend_read_property(riak_mrinput_bucket_ce, getThis(), "idxend", sizeof("idxend")-1, 1 TSRMLS_CC);
zval_addref_p(zindex);
add_assoc_zval_ex(zresult, "index", sizeof("index"), zindex);
if (Z_TYPE_P(end) != IS_STRING) {
zval_addref_p(start);
add_assoc_zval_ex(zresult, "key", sizeof("key"), start);
} else {
zval_addref_p(start);
zval_addref_p(end);
add_assoc_zval_ex(zresult, "start", sizeof("start"), start);
add_assoc_zval_ex(zresult, "end", sizeof("end"), end);
}
}
if (Z_TYPE_P(zfilters) == IS_ARRAY) {
zval_addref_p(zfilters);
add_assoc_zval_ex(zresult, "key_filters", sizeof("key_filters"), zfilters);
}
RETURN_ZVAL(zresult, 0, 1);
} else {
RETURN_ZVAL(zname, 1, 0);
}
}
示例13: PHP_METHOD
/*{{{ public Fool_Application::run(void)
*/
PHP_METHOD(fool_application,run)
{
zval* response;
zval* dispatcher;
zval* self = getThis();
dispatcher = zend_read_property(fool_application_ce,self,ZEND_STRL(FOOL_APPLICATION_PROPERTY_NAME_DISPATCHER),1 TSRMLS_CC);
if((response = fool_dispatcher_dispatch(dispatcher TSRMLS_CC))){
RETURN_ZVAL(response,1,1);
}
RETURN_FALSE;
}
示例14: PHP_METHOD
PHP_METHOD(Rows, current)
{
zval **entry;
cassandra_rows* self = NULL;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
self = (cassandra_rows*) zend_object_store_get_object(getThis() TSRMLS_CC);
if (zend_hash_get_current_data(Z_ARRVAL_P(self->rows), (void **) &entry) == SUCCESS)
RETURN_ZVAL(*entry, 1, 0);
}
示例15: ONPHP_METHOD
ONPHP_METHOD(Ternary, spawn)
{
zval *value, *true, *false, *null, *result, *out;
ONPHP_GET_ARGS("zzz|z", &value, &true, &false, &null);
ALLOC_INIT_ZVAL(result);
ONPHP_MAKE_OBJECT(Ternary, out);
if (ZEND_NUM_ARGS() == 3) {
ALLOC_INIT_ZVAL(null);
ZVAL_NULL(null);
}
if (
is_identical_function(result, value, true TSRMLS_CC)
&& (zval_is_true(result))
) {
ONPHP_UPDATE_PROPERTY_BOOL(out, "trinity", 1);
} else if (
is_identical_function(result, value, false TSRMLS_CC)
&& (zval_is_true(result))
) {
ONPHP_UPDATE_PROPERTY_BOOL(out, "trinity", 0);
} else if (
(
is_identical_function(result, value, null TSRMLS_CC)
&& (zval_is_true(result))
) || (
Z_TYPE_P(null) == IS_NULL
)
) {
ONPHP_UPDATE_PROPERTY_NULL(out, "trinity");
} else {
ONPHP_THROW_NORET(WrongArgumentException, "failed to spawn Ternary");
}
ZVAL_FREE(result);
if (ZEND_NUM_ARGS() == 3) {
ZVAL_FREE(null);
}
if (EG(exception)) {
return;
}
RETURN_ZVAL(out, 1, 1);
}