当前位置: 首页>>代码示例>>C++>>正文


C++ zephir_fast_count_int函数代码示例

本文整理汇总了C++中zephir_fast_count_int函数的典型用法代码示例。如果您正苦于以下问题:C++ zephir_fast_count_int函数的具体用法?C++ zephir_fast_count_int怎么用?C++ zephir_fast_count_int使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了zephir_fast_count_int函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PHP_METHOD

PHP_METHOD(Test_Vars, testCountOptimizerVarDumpAndExport) {

	zval *testVar, testVar_sub, _0, _1;
		zval this_zv;
	zval *this_ptr = getThis();
	if (EXPECTED(this_ptr)) {
		ZVAL_OBJ(&this_zv, Z_OBJ_P(this_ptr));
		this_ptr = &this_zv;
	} else this_ptr = NULL;
	
	ZVAL_UNDEF(&testVar_sub);
	ZVAL_UNDEF(&_0);
	ZVAL_UNDEF(&_1);

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &testVar);



	ZEPHIR_INIT_VAR(&_0);
	ZEPHIR_INIT_NVAR(&_0);
	ZVAL_LONG(&_0, zephir_fast_count_int(testVar TSRMLS_CC));
	zephir_var_dump(&_0 TSRMLS_CC);
	ZEPHIR_INIT_VAR(&_1);
	ZEPHIR_INIT_NVAR(&_1);
	ZVAL_LONG(&_1, zephir_fast_count_int(testVar TSRMLS_CC));
	zephir_var_export(&_1 TSRMLS_CC);
	ZEPHIR_MM_RESTORE();

}
开发者ID:Mrhjx2,项目名称:zephir,代码行数:30,代码来源:vars.zep.c

示例2: PHP_METHOD

/**
 * Phalcon\Mvc\Model\ValidationFailed constructor
 *
 * @param Model model
 * @param Message[] validationMessages
 */
PHP_METHOD(Phalcon_Mvc_Model_ValidationFailed, __construct) {

	int ZEPHIR_LAST_CALL_STATUS;
	zval *validationMessages = NULL;
	zval *model, *validationMessages_param = NULL, *messageStr = NULL, *message = NULL;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 2, 0, &model, &validationMessages_param);

	validationMessages = validationMessages_param;


	if (zephir_fast_count_int(validationMessages TSRMLS_CC) > 0) {
		ZEPHIR_OBS_VAR(message);
		zephir_array_fetch_long(&message, validationMessages, 0, PH_NOISY, "phalcon/mvc/model/validationfailed.zep", 51 TSRMLS_CC);
		ZEPHIR_CALL_METHOD(&messageStr, message, "getmessage", NULL, 0);
		zephir_check_call_status();
	} else {
		ZEPHIR_INIT_NVAR(messageStr);
		ZVAL_STRING(messageStr, "Validation failed", 1);
	}
	zephir_update_property_this(this_ptr, SL("_model"), model TSRMLS_CC);
	zephir_update_property_this(this_ptr, SL("_messages"), validationMessages TSRMLS_CC);
	ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_validationfailed_ce, this_ptr, "__construct", NULL, 0, messageStr);
	zephir_check_call_status();
	ZEPHIR_MM_RESTORE();

}
开发者ID:8V017UW2RQ70,项目名称:cphalcon,代码行数:34,代码来源:validationfailed.zep.c

示例3: PHP_METHOD

/**
 * Fetch a YAML payload from the Beanstalkd server
 */
PHP_METHOD(Phalcon_Queue_Beanstalk, readYaml) {

	zval *response = NULL, *status = NULL, *numberOfBytes = NULL, *data = NULL;
	int ZEPHIR_LAST_CALL_STATUS;

	ZEPHIR_MM_GROW();

	ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 382);
	zephir_check_call_status();
	ZEPHIR_OBS_VAR(status);
	zephir_array_fetch_long(&status, response, 0, PH_NOISY, "phalcon/queue/beanstalk.zep", 329 TSRMLS_CC);
	if (zephir_fast_count_int(response TSRMLS_CC) > 1) {
		ZEPHIR_OBS_VAR(numberOfBytes);
		zephir_array_fetch_long(&numberOfBytes, response, 1, PH_NOISY, "phalcon/queue/beanstalk.zep", 332 TSRMLS_CC);
		ZEPHIR_CALL_METHOD(&response, this_ptr, "read", NULL, 0);
		zephir_check_call_status();
		ZEPHIR_CALL_FUNCTION(&data, "yaml_parse", NULL, 385, response);
		zephir_check_call_status();
	} else {
		ZEPHIR_INIT_NVAR(numberOfBytes);
		ZVAL_LONG(numberOfBytes, 0);
		ZEPHIR_INIT_NVAR(data);
		array_init(data);
	}
	zephir_create_array(return_value, 3, 0 TSRMLS_CC);
	zephir_array_fast_append(return_value, status);
	zephir_array_fast_append(return_value, numberOfBytes);
	zephir_array_fast_append(return_value, data);
	RETURN_MM();

}
开发者ID:8V017UW2RQ70,项目名称:cphalcon,代码行数:34,代码来源:beanstalk.zep.c

示例4: PHP_METHOD

/**
 * Mounts a group of routes in the router
 *
 * @param Test\Router\Group route
 * @return Test\Router
 */
PHP_METHOD(Test_Router, mount) {

	HashTable *_1, *_4;
	HashPosition _0, _3;
	int ZEPHIR_LAST_CALL_STATUS;
	zval *group, *groupRoutes = NULL, *beforeMatch = NULL, *hostname = NULL, *routes, *route = NULL, **_2, **_5, *_6;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &group);



	if (Z_TYPE_P(group) != IS_OBJECT) {
		ZEPHIR_THROW_EXCEPTION_STR(test_router_exception_ce, "The group of routes is not valid");
		return;
	}
	ZEPHIR_CALL_METHOD(&groupRoutes, group, "getroutes",  NULL);
	zephir_check_call_status();
	if (!(zephir_fast_count_int(groupRoutes TSRMLS_CC))) {
		ZEPHIR_THROW_EXCEPTION_STR(test_router_exception_ce, "The group of routes does not contain any routes");
		return;
	}
	ZEPHIR_CALL_METHOD(&beforeMatch, group, "getbeforematch",  NULL);
	zephir_check_call_status();
	if (Z_TYPE_P(beforeMatch) != IS_NULL) {
		zephir_is_iterable(groupRoutes, &_1, &_0, 0, 0);
		for (
		  ; zephir_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS
		  ; zephir_hash_move_forward_ex(_1, &_0)
		) {
			ZEPHIR_GET_HVALUE(route, _2);
			ZEPHIR_CALL_METHOD(NULL, route, "beforematch", NULL, beforeMatch);
			zephir_check_call_status();
		}
	}
	ZEPHIR_CALL_METHOD(&hostname, group, "gethostname",  NULL);
	zephir_check_call_status();
	if (Z_TYPE_P(hostname) != IS_NULL) {
		zephir_is_iterable(groupRoutes, &_4, &_3, 0, 0);
		for (
		  ; zephir_hash_get_current_data_ex(_4, (void**) &_5, &_3) == SUCCESS
		  ; zephir_hash_move_forward_ex(_4, &_3)
		) {
			ZEPHIR_GET_HVALUE(route, _5);
			ZEPHIR_CALL_METHOD(NULL, route, "sethostname", NULL, hostname);
			zephir_check_call_status();
		}
	}
	ZEPHIR_OBS_VAR(routes);
	zephir_read_property_this(&routes, this_ptr, SL("_routes"), PH_NOISY_CC);
	if (Z_TYPE_P(routes) == IS_ARRAY) {
		ZEPHIR_INIT_VAR(_6);
		zephir_fast_array_merge(_6, &(routes), &(groupRoutes) TSRMLS_CC);
		zephir_update_property_this(this_ptr, SL("_routes"), _6 TSRMLS_CC);
	} else {
		zephir_update_property_this(this_ptr, SL("_routes"), groupRoutes TSRMLS_CC);
	}
	RETURN_THIS();

}
开发者ID:RandomStuffs22,项目名称:zephir,代码行数:66,代码来源:router.c

示例5: PHP_METHOD

/**
 * Length filter. If an array/object is passed a count is performed otherwise a strlen/mb_strlen
 */
PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, length) {

	zend_bool _0;
	int ZEPHIR_LAST_CALL_STATUS;
	zval *item;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &item);



	_0 = Z_TYPE_P(item) == IS_OBJECT;
	if (!(_0)) {
		_0 = Z_TYPE_P(item) == IS_ARRAY;
	}
	if (_0) {
		RETURN_MM_LONG(zephir_fast_count_int(item TSRMLS_CC));
	}
	if ((zephir_function_exists_ex(SS("mb_strlen") TSRMLS_CC) == SUCCESS)) {
		ZEPHIR_RETURN_CALL_FUNCTION("mb_strlen", NULL, 380, item);
		zephir_check_call_status();
		RETURN_MM();
	}
	RETURN_MM_LONG(zephir_fast_strlen_ev(item));

}
开发者ID:ntesic,项目名称:cphalcon,代码行数:29,代码来源:volt.zep.c

示例6: PHP_METHOD

/**
 * Sets the path for a domain
 *
 * @return string
 */
PHP_METHOD(Phalcon_Translate_Adapter_Gettext, setDirectory) {

	int ZEPHIR_LAST_CALL_STATUS;
	HashTable *_1;
	HashPosition _0;
	zval *directory, *key = NULL, *value = NULL, **_2, *_3 = NULL;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &directory);



	zephir_update_property_this(this_ptr, SL("_directory"), directory TSRMLS_CC);
	if (Z_TYPE_P(directory) == IS_ARRAY) {
		if (zephir_fast_count_int(directory TSRMLS_CC)) {
			zephir_is_iterable(directory, &_1, &_0, 0, 0, "phalcon/translate/adapter/gettext.zep", 188);
			for (
			  ; zephir_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS
			  ; zephir_hash_move_forward_ex(_1, &_0)
			) {
				ZEPHIR_GET_HMKEY(key, _1, _0);
				ZEPHIR_GET_HVALUE(value, _2);
				ZEPHIR_CALL_FUNCTION(NULL, "bindtextdomain", NULL, key, value);
				zephir_check_call_status();
			}
		}
	} else {
		ZEPHIR_CALL_METHOD(&_3, this_ptr, "getdefaultdomain", NULL);
		zephir_check_call_status();
		ZEPHIR_CALL_FUNCTION(NULL, "bindtextdomain", NULL, _3, directory);
		zephir_check_call_status();
	}
	ZEPHIR_MM_RESTORE();

}
开发者ID:3axap4eHko,项目名称:cphalcon,代码行数:40,代码来源:gettext.zep.c

示例7: PHP_METHOD

/**
 * Length filter. If an array/object is passed a count is performed otherwise a strlen/mb_strlen
 */
PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, length) {

	int ZEPHIR_LAST_CALL_STATUS;
	zend_bool _0;
	zval *item, *length = NULL;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &item);



	ZEPHIR_INIT_VAR(length);
	ZVAL_LONG(length, 0);
	_0 = Z_TYPE_P(item) == IS_OBJECT;
	if (!(_0)) {
		_0 = Z_TYPE_P(item) == IS_ARRAY;
	}
	if (_0) {
		ZEPHIR_INIT_NVAR(length);
		ZVAL_LONG(length, zephir_fast_count_int(item TSRMLS_CC));
	} else {
		if ((zephir_function_exists_ex(SS("mb_strlen") TSRMLS_CC) == SUCCESS)) {
			ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 366, item);
			zephir_check_call_status();
		} else {
			ZEPHIR_INIT_NVAR(length);
			ZVAL_LONG(length, zephir_fast_strlen_ev(item));
		}
	}
	RETURN_CCTOR(length);

}
开发者ID:raphaelfruneaux,项目名称:cphalcon,代码行数:35,代码来源:volt.zep.c

示例8: PHP_METHOD

/**
 * 检查数组是否包含 Associative 键?
 *
 * @param array arr
 * @param bool  reusingKeys
 * @return bool
 */
PHP_METHOD(DotPHP_Utils_ArrayUtil, isAssoc) {

	int ZEPHIR_LAST_CALL_STATUS;
	zend_bool reusingKeys;
	zval *arr_param = NULL, *reusingKeys_param = NULL, *r = NULL, _0, _1, *_2, *_3;
	zval *arr = NULL;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 1, &arr_param, &reusingKeys_param);

	zephir_get_arrval(arr, arr_param);
	if (!reusingKeys_param) {
		reusingKeys = 0;
	} else {
		reusingKeys = zephir_get_boolval(reusingKeys_param);
	}


	ZEPHIR_SINIT_VAR(_0);
	ZVAL_LONG(&_0, 0);
	ZEPHIR_SINIT_VAR(_1);
	ZVAL_LONG(&_1, (zephir_fast_count_int(arr TSRMLS_CC) - 1));
	ZEPHIR_CALL_FUNCTION(&r, "range", NULL, 24, &_0, &_1);
	zephir_check_call_status();
	ZEPHIR_INIT_VAR(_2);
	if (reusingKeys) {
		ZVAL_BOOL(_2, !ZEPHIR_IS_IDENTICAL(arr, r));
	} else {
		ZEPHIR_INIT_VAR(_3);
		zephir_array_keys(_3, arr TSRMLS_CC);
		ZVAL_BOOL(_2, !ZEPHIR_IS_IDENTICAL(_3, r));
	}
	RETURN_CCTOR(_2);

}
开发者ID:designinlife,项目名称:dotphp,代码行数:42,代码来源:arrayutil.zep.c

示例9: PHP_METHOD

/**
 * Removes transactions from the TransactionManager
 */
PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, _collectTransaction) {

	HashTable *_1$$3;
	HashPosition _0$$3;
	zval *transaction, *transactions = NULL, *newTransactions = NULL, *managedTransaction = NULL, **_2$$3;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &transaction);



	ZEPHIR_OBS_VAR(transactions);
	zephir_read_property_this(&transactions, this_ptr, SL("_transactions"), PH_NOISY_CC);
	if (zephir_fast_count_int(transactions TSRMLS_CC)) {
		ZEPHIR_INIT_VAR(newTransactions);
		array_init(newTransactions);
		zephir_is_iterable(transactions, &_1$$3, &_0$$3, 0, 0, "phalcon/mvc/model/transaction/manager.zep", 295);
		for (
		  ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS
		  ; zend_hash_move_forward_ex(_1$$3, &_0$$3)
		) {
			ZEPHIR_GET_HVALUE(managedTransaction, _2$$3);
			if (!ZEPHIR_IS_EQUAL(managedTransaction, transaction)) {
				zephir_array_append(&newTransactions, transaction, PH_SEPARATE, "phalcon/mvc/model/transaction/manager.zep", 289);
			} else {
				RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("_number") TSRMLS_CC));
			}
		}
		zephir_update_property_this(getThis(), SL("_transactions"), newTransactions TSRMLS_CC);
	}
	ZEPHIR_MM_RESTORE();

}
开发者ID:zamronypj,项目名称:cphalcon,代码行数:36,代码来源:manager.zep.c

示例10: PHP_METHOD

/**
 * @inheritdoc
 */
PHP_METHOD(Owl_Log_AbstractWriter, commit) {

	int ZEPHIR_LAST_CALL_STATUS;
	zval *records_param = NULL, *_0, *_1, *_2 = NULL, *_3, *_4;
	zval *records = NULL;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &records_param);

	zephir_get_arrval(records, records_param);


	ZEPHIR_INIT_VAR(_0);
	_1 = zephir_fetch_nproperty_this(this_ptr, SL("records"), PH_NOISY_CC);
	ZEPHIR_CALL_METHOD(&_2, this_ptr, "filterrecords", NULL, 0, records);
	zephir_check_call_status();
	zephir_fast_array_merge(_0, &(_1), &(_2) TSRMLS_CC);
	zephir_update_property_this(this_ptr, SL("records"), _0 TSRMLS_CC);
	_3 = zephir_fetch_nproperty_this(this_ptr, SL("records"), PH_NOISY_CC);
	_4 = zephir_fetch_nproperty_this(this_ptr, SL("recordsInterval"), PH_NOISY_CC);
	if (ZEPHIR_LE_LONG(_4, zephir_fast_count_int(_3 TSRMLS_CC))) {
		ZEPHIR_CALL_METHOD(NULL, this_ptr, "push", NULL, 0);
		zephir_check_call_status();
	}
	ZEPHIR_MM_RESTORE();

}
开发者ID:noikiy,项目名称:owl,代码行数:30,代码来源:abstractwriter.zep.c

示例11: PHP_METHOD

/**
 * {@inheritDoc}
 */
PHP_METHOD(Owl_Std_Collection_ArrayCollection, count) {

	zval *_0;


	_0 = zephir_fetch_nproperty_this(this_ptr, SL("elements"), PH_NOISY_CC);
	RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC));

}
开发者ID:ansborisov,项目名称:owl,代码行数:12,代码来源:arraycollection.zep.c

示例12: PHP_METHOD

/**
 * Checks whether there are messages attached to the element
 */
PHP_METHOD(Phalcon_Forms_Element, hasMessages) {

	zval *_0;


	_0 = zephir_fetch_nproperty_this(this_ptr, SL("_messages"), PH_NOISY_CC);
	RETURN_BOOL(zephir_fast_count_int(_0 TSRMLS_CC) > 0);

}
开发者ID:8V017UW2RQ70,项目名称:cphalcon,代码行数:12,代码来源:element.zep.c

示例13: PHP_METHOD

/**
 * Defined by Countable interface
 *
 * @return int
 */
PHP_METHOD(Yaf_Session, count) {

    zval *_0;


    _0 = zephir_fetch_nproperty_this(this_ptr, SL("session"), PH_NOISY_CC);
    RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC));

}
开发者ID:swordkee,项目名称:yaftoz,代码行数:14,代码来源:session.zep.c

示例14: PHP_METHOD

/**
 * Returns the number of annotations in the collection
 */
PHP_METHOD(Phalcon_Annotations_Collection, count) {

	zval *_0;


	_0 = zephir_fetch_nproperty_this(this_ptr, SL("_annotations"), PH_NOISY_CC);
	RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC));

}
开发者ID:Studentsov,项目名称:cphalcon,代码行数:12,代码来源:collection.zep.c

示例15: PHP_METHOD

/**
 * Checks how many elements are in the register
 */
PHP_METHOD(Phalcon_Registry, count) {

	zval *_0;


	_0 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC);
	RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC));

}
开发者ID:AmazingDreams,项目名称:cphalcon,代码行数:12,代码来源:registry.zep.c


注:本文中的zephir_fast_count_int函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。