本文整理汇总了C++中RETURN_MM函数的典型用法代码示例。如果您正苦于以下问题:C++ RETURN_MM函数的具体用法?C++ RETURN_MM怎么用?C++ RETURN_MM使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RETURN_MM函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
/**
* Returns a cached content
*
* @param string keyName
* @param long lifetime
* @return mixed
*/
PHP_METHOD(Phalcon_Cache_Backend_Memory, get) {
int ZEPHIR_LAST_CALL_STATUS;
zval *keyName, *lifetime = NULL, *lastKey = NULL, *cachedContent, *_0;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 1, &keyName, &lifetime);
if (!lifetime) {
lifetime = ZEPHIR_GLOBAL(global_null);
}
if (Z_TYPE_P(keyName) == IS_NULL) {
ZEPHIR_OBS_VAR(lastKey);
zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC);
} else {
_0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC);
ZEPHIR_INIT_NVAR(lastKey);
ZEPHIR_CONCAT_VV(lastKey, _0, keyName);
zephir_update_property_this(this_ptr, SL("_lastKey"), lastKey TSRMLS_CC);
}
ZEPHIR_OBS_VAR(cachedContent);
_0 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC);
if (!(zephir_array_isset_fetch(&cachedContent, _0, lastKey, 0 TSRMLS_CC))) {
RETURN_MM_NULL();
}
if (Z_TYPE_P(cachedContent) == IS_NULL) {
RETURN_MM_NULL();
}
_0 = zephir_fetch_nproperty_this(this_ptr, SL("_frontend"), PH_NOISY_CC);
ZEPHIR_RETURN_CALL_METHOD(_0, "afterretrieve", NULL, cachedContent);
zephir_check_call_status();
RETURN_MM();
}
示例2: PHP_METHOD
/**
* Generates SQL to query indexes detail on a table
*/
PHP_METHOD(Phalcon_Db_Dialect_Sqlite, describeIndex) {
zval *index_param = NULL;
zval *index = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &index_param);
if (unlikely(Z_TYPE_P(index_param) != IS_STRING && Z_TYPE_P(index_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'index' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(index_param) == IS_STRING)) {
zephir_get_strval(index, index_param);
} else {
ZEPHIR_INIT_VAR(index);
ZVAL_EMPTY_STRING(index);
}
ZEPHIR_CONCAT_SVS(return_value, "PRAGMA index_info('", index, "')");
RETURN_MM();
}
示例3: PHP_METHOD
/**
* Unserializes a value from a serialized string.
*
* @param string serializedData
*
* @return mixed
*/
PHP_METHOD(Xpl_Serializer_Json, unserialize) {
zval *serializedData_param = NULL;
zval *serializedData = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &serializedData_param);
if (unlikely(Z_TYPE_P(serializedData_param) != IS_STRING && Z_TYPE_P(serializedData_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'serializedData' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(serializedData_param) == IS_STRING)) {
zephir_get_strval(serializedData, serializedData_param);
} else {
ZEPHIR_INIT_VAR(serializedData);
ZVAL_EMPTY_STRING(serializedData);
}
zephir_json_decode(return_value, &(return_value), serializedData, 0 TSRMLS_CC);
RETURN_MM();
}
示例4: PHP_METHOD
/**
* Adds a number to a string or increment that number if it already is defined
*
*<code>
* echo Phalcon\Text::increment("a"); // "a_1"
* echo Phalcon\Text::increment("a_1"); // "a_2"
*</code>
*
* @param string $str
* @param string $separator
* @return string
*/
PHP_METHOD(Phalcon_Text, increment){
zval *str, *separator = NULL, *parts, *number = NULL, *first_part;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 1, &str, &separator);
if (!separator) {
PHALCON_INIT_VAR(separator);
} else {
PHALCON_SEPARATE_PARAM(separator);
}
if (Z_TYPE_P(separator) == IS_NULL) {
PHALCON_INIT_NVAR(separator);
ZVAL_STRING(separator, "_", 1);
}
PHALCON_INIT_VAR(parts);
phalcon_fast_explode(parts, separator, str);
if (phalcon_array_isset_long(parts, 1)) {
PHALCON_OBS_VAR(number);
phalcon_array_fetch_long(&number, parts, 1, PH_NOISY);
SEPARATE_ZVAL(&number);
phalcon_increment(number);
} else {
number = PHALCON_GLOBAL(z_one);
}
PHALCON_OBS_VAR(first_part);
phalcon_array_fetch_long(&first_part, parts, 0, PH_NOISY);
PHALCON_CONCAT_VVV(return_value, first_part, separator, number);
RETURN_MM();
}
示例5: PHP_METHOD
PHP_METHOD(Test_Strings, uncamelize) {
zval *str_param = NULL, *delimiter = NULL, delimiter_sub, __$null;
zval str;
zval *this_ptr = getThis();
ZVAL_UNDEF(&str);
ZVAL_UNDEF(&delimiter_sub);
ZVAL_NULL(&__$null);
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 1, &str_param, &delimiter);
zephir_get_strval(&str, str_param);
if (!delimiter) {
delimiter = &delimiter_sub;
delimiter = &__$null;
}
zephir_uncamelize(return_value, &str, delimiter );
RETURN_MM();
}
示例6: PHP_METHOD
/**
* Filters the content using JSMIN
*/
PHP_METHOD(Phalcon_Assets_Filters_Jsmin, filter) {
zval *content_param = NULL;
zval *content = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &content_param);
if (unlikely(Z_TYPE_P(content_param) != IS_STRING && Z_TYPE_P(content_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'content' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(content_param) == IS_STRING)) {
zephir_get_strval(content, content_param);
} else {
ZEPHIR_INIT_VAR(content);
ZVAL_EMPTY_STRING(content);
}
phalcon_jsmin(return_value, content TSRMLS_CC);
RETURN_MM();
}
示例7: PHP_METHOD
/**
* Returns an HTML string of information about a single variable.
*
* <code>
* echo (new \Phalcon\Debug\Dump())->variable($foo, "foo");
* </code>
*/
PHP_METHOD(Phalcon_Debug_Dump, variable) {
zval *_0;
int ZEPHIR_LAST_CALL_STATUS;
zval *name = NULL;
zval *variable, *name_param = NULL, *_1 = NULL, *_2, _3;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 1, &variable, &name_param);
if (!name_param) {
ZEPHIR_INIT_VAR(name);
ZVAL_EMPTY_STRING(name);
} else {
zephir_get_strval(name, name_param);
}
ZEPHIR_INIT_VAR(_0);
zephir_create_array(_0, 2, 0 TSRMLS_CC);
ZEPHIR_INIT_VAR(_2);
ZVAL_STRING(_2, "pre", ZEPHIR_TEMP_PARAM_COPY);
ZEPHIR_CALL_METHOD(&_1, this_ptr, "getstyle", NULL, 0, _2);
zephir_check_temp_parameter(_2);
zephir_check_call_status();
zephir_array_update_string(&_0, SL(":style"), &_1, PH_COPY | PH_SEPARATE);
ZEPHIR_CALL_METHOD(&_1, this_ptr, "output", NULL, 0, variable, name);
zephir_check_call_status();
zephir_array_update_string(&_0, SL(":output"), &_1, PH_COPY | PH_SEPARATE);
ZEPHIR_SINIT_VAR(_3);
ZVAL_STRING(&_3, "<pre style=':style'>:output</pre>", 0);
ZEPHIR_RETURN_CALL_FUNCTION("strtr", NULL, 26, &_3, _0);
zephir_check_call_status();
RETURN_MM();
}
示例8: PHP_METHOD
/**
* Adds a route to the router that only match if the HTTP method is PUT
*/
PHP_METHOD(Phalcon_Mvc_Router, addPut) {
int ZEPHIR_LAST_CALL_STATUS;
zval *pattern_param = NULL, *paths = NULL, *position = NULL, *_0;
zval *pattern = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 2, &pattern_param, &paths, &position);
if (unlikely(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(pattern_param) == IS_STRING)) {
zephir_get_strval(pattern, pattern_param);
} else {
ZEPHIR_INIT_VAR(pattern);
ZVAL_EMPTY_STRING(pattern);
}
if (!paths) {
paths = ZEPHIR_GLOBAL(global_null);
}
if (!position) {
ZEPHIR_INIT_VAR(position);
ZVAL_LONG(position, 1);
}
ZEPHIR_INIT_VAR(_0);
ZVAL_STRING(_0, "PUT", ZEPHIR_TEMP_PARAM_COPY);
ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, pattern, paths, _0, position);
zephir_check_temp_parameter(_0);
zephir_check_call_status();
RETURN_MM();
}
示例9: PHP_METHOD
/**
* Generates SQL to create a view
*
* @param string viewName
* @param array definition
* @param string schemaName
* @return string
*/
PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createView) {
zval *viewName, *definition, *schemaName, *viewSql, *view = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 3, 0, &viewName, &definition, &schemaName);
ZEPHIR_OBS_VAR(viewSql);
if (!(zephir_array_isset_string_fetch(&viewSql, definition, SS("sql"), 0 TSRMLS_CC))) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The index 'sql' is required in the definition array", "phalcon/db/dialect/postgresql.zep", 315);
return;
}
if (zephir_is_true(schemaName)) {
ZEPHIR_INIT_VAR(view);
ZEPHIR_CONCAT_VSV(view, viewName, ".", schemaName);
} else {
ZEPHIR_CPY_WRT(view, viewName);
}
ZEPHIR_CONCAT_SVSV(return_value, "CREATE VIEW ", view, " AS ", viewSql);
RETURN_MM();
}
示例10: PHP_METHOD
PHP_METHOD(Cake_Core_Configure, read) {
int ZEPHIR_LAST_CALL_STATUS;
zephir_fcall_cache_entry *_1 = NULL;
zval *_var = NULL, *_0;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 0, 1, &_var);
if (!_var) {
_var = ZEPHIR_GLOBAL(global_null);
}
if (Z_TYPE_P(_var) == IS_NULL) {
_0 = zephir_fetch_static_property_ce(cake_core_configure_ce, SL("_values") TSRMLS_CC);
RETURN_CTOR(_0);
}
_0 = zephir_fetch_static_property_ce(cake_core_configure_ce, SL("_values") TSRMLS_CC);
ZEPHIR_RETURN_CALL_CE_STATIC(cake_utility_hash_ce, "get", &_1, 5, _0, _var);
zephir_check_call_status();
RETURN_MM();
}
示例11: PHP_METHOD
/**
* Get last row in the resultset
*/
PHP_METHOD(Phalcon_Mvc_Model_Resultset, getLast) {
zephir_nts_static zephir_fcall_cache_entry *_1 = NULL, *_3 = NULL, *_5 = NULL;
int ZEPHIR_LAST_CALL_STATUS;
zval *_0 = NULL, _2, *_4 = NULL;
ZEPHIR_MM_GROW();
ZEPHIR_CALL_METHOD(&_0, this_ptr, "count", &_1);
zephir_check_call_status();
ZEPHIR_SINIT_VAR(_2);
ZVAL_LONG(&_2, (zephir_get_numberval(_0) - 1));
ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", &_3, &_2);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(&_4, this_ptr, "valid", NULL);
zephir_check_call_status();
if (!ZEPHIR_IS_FALSE_IDENTICAL(_4)) {
ZEPHIR_RETURN_CALL_METHOD(this_ptr, "current", &_5);
zephir_check_call_status();
RETURN_MM();
}
RETURN_MM_BOOL(0);
}
示例12: PHP_METHOD
/**
*
* @param string $session_id optional, session id
*
* @return boolean
*/
PHP_METHOD(Phalcon_Session_Adapter_Memcache, destroy){
zval *sid = NULL;
zval *memcache;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 0, 1, &sid);
if (!sid) {
PHALCON_INIT_VAR(sid);
PHALCON_CALL_SELF(&sid, "getid");
}
memcache = phalcon_fetch_nproperty_this(this_ptr, SL("_memcache"), PH_NOISY TSRMLS_CC);
if (Z_TYPE_P(memcache) == IS_OBJECT) {
PHALCON_RETURN_CALL_METHOD(memcache, "delete", sid);
RETURN_MM();
} else {
RETURN_MM_FALSE;
}
}
示例13: PHP_METHOD
/**
* Generates a URL for a static resource
*
*<code>
* // Generate a URL for a static resource
* echo $url->getStatic("img/logo.png");
*
* // Generate a URL for a static predefined route
* echo $url->getStatic(
* [
* "for" => "logo-cdn",
* ]
* );
*</code>
*/
PHP_METHOD(Phalcon_Mvc_Url, getStatic) {
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *uri = NULL, *_0 = NULL, *_1, *_2;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 0, 1, &uri);
if (!uri) {
uri = ZEPHIR_GLOBAL(global_null);
}
ZEPHIR_CALL_METHOD(&_0, this_ptr, "getstaticbaseuri", NULL, 0);
zephir_check_call_status();
ZEPHIR_INIT_VAR(_1);
ZVAL_NULL(_1);
ZEPHIR_INIT_VAR(_2);
ZVAL_NULL(_2);
ZEPHIR_RETURN_CALL_METHOD(this_ptr, "get", NULL, 0, uri, _1, _2, _0);
zephir_check_call_status();
RETURN_MM();
}
示例14: PHP_METHOD
PHP_METHOD(PocketMine_Math_Vector2, round) {
int ZEPHIR_LAST_CALL_STATUS;
zephir_nts_static zephir_fcall_cache_entry *_2 = NULL;
zval *_0, *_1 = NULL, *_3, *_4 = NULL, *_5, *_6;
ZEPHIR_MM_GROW();
object_init_ex(return_value, pocketmine_math_vector2_ce);
_0 = zephir_fetch_nproperty_this(this_ptr, SL("x"), PH_NOISY_CC);
ZEPHIR_CALL_FUNCTION(&_1, "round", &_2, _0);
zephir_check_call_status();
_3 = zephir_fetch_nproperty_this(this_ptr, SL("y"), PH_NOISY_CC);
ZEPHIR_CALL_FUNCTION(&_4, "round", &_2, _3);
zephir_check_call_status();
ZEPHIR_INIT_VAR(_5);
ZVAL_LONG(_5, zephir_get_intval(_1));
ZEPHIR_INIT_VAR(_6);
ZVAL_LONG(_6, zephir_get_intval(_4));
ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, _5, _6);
zephir_check_call_status();
RETURN_MM();
}
示例15: PHP_METHOD
/**
* Reads column-map information for certain model using a MODEL_* constant
*
*<code>
* print_r($metaData->readColumnMapIndex(new Robots(), MetaData::MODELS_REVERSE_COLUMN_MAP));
*</code>
*
* @param Phalcon\Mvc\ModelInterface $model
* @param int $index
*/
PHP_METHOD(Phalcon_Mvc_Model_MetaData, readColumnMapIndex){
zval **model, **index, *key_name, *column_map = NULL, *null_value;
zval *column_map_model, *attributes;
phalcon_fetch_params_ex(2, 0, &model, &index);
PHALCON_VERIFY_CLASS_EX(*model, phalcon_mvc_modelinterface_ce, phalcon_mvc_model_exception_ce, 0);
PHALCON_ENSURE_IS_LONG(index);
PHALCON_MM_GROW();
if (!PHALCON_GLOBAL(orm).column_renaming) {
RETURN_MM();
}
PHALCON_INIT_VAR(key_name);
phalcon_get_class(key_name, *model, 1 TSRMLS_CC);
PHALCON_OBS_VAR(column_map);
phalcon_read_property_this(&column_map, this_ptr, SL("_columnMap"), PH_NOISY TSRMLS_CC);
if (!phalcon_array_isset(column_map, key_name)) {
null_value = PHALCON_GLOBAL(z_null);
PHALCON_CALL_METHOD(NULL, this_ptr, "_initialize", *model, null_value, null_value, null_value);
PHALCON_OBS_NVAR(column_map);
phalcon_read_property_this(&column_map, this_ptr, SL("_columnMap"), PH_NOISY TSRMLS_CC);
}
PHALCON_OBS_VAR(column_map_model);
phalcon_array_fetch(&column_map_model, column_map, key_name, PH_NOISY);
PHALCON_OBS_VAR(attributes);
phalcon_array_fetch(&attributes, column_map_model, *index, PH_NOISY);
RETURN_CTOR(attributes);
}