代码拉取完成,页面将自动刷新
同步操作将从 koogua/php-zephir-parser 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/* zephir_parser.c
*
* This file is part of the Zephir Parser.
*
* (c) Zephir Team <team@zephir-lang.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <php.h>
#include <php_ini.h>
#include <ext/standard/info.h>
#include "zephir_parser.h"
extern void *xx_parse_program(zval *return_value, char *program, size_t program_length, char *file_path, zval *error_msg);
/* {{{ proto array zephir_parse_file(string content, string filepath)
Parses a file and returning an intermediate array representation */
static PHP_FUNCTION(zephir_parse_file)
{
size_t filepath_len = 0;
size_t content_len = 0;
char *content = NULL;
char *filepath = NULL;
zval error_msg;
zval ret;
zval *e = &error_msg;
zval *r = &ret;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &content, &content_len, &filepath, &filepath_len) == FAILURE) {
RETURN_FALSE;
}
ZVAL_NULL(e);
ZVAL_NULL(r);
xx_parse_program(r, content, content_len, filepath, e);
if (Z_TYPE_P(e) == IS_ARRAY) {
zval_ptr_dtor(&ret);
RETURN_ZVAL(e, 0, 0);
}
assert(Z_TYPE_P(r) == IS_ARRAY);
zval_ptr_dtor(&error_msg);
RETURN_ZVAL(r, 1, 1);
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(zephir_parser)
{
return SUCCESS;
}
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(zephir_parser)
{
return SUCCESS;
}
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(zephir_parser)
{
php_info_print_box_start(0);
php_printf("%s", PHP_ZEPHIR_PARSER_DESCRIPTION);
php_info_print_box_end();
php_info_print_table_start();
php_info_print_table_header(2, PHP_ZEPHIR_PARSER_NAME, "enabled");
php_info_print_table_row(2, "Author", PHP_ZEPHIR_PARSER_AUTHOR);
php_info_print_table_row(2, "Version", PHP_ZEPHIR_PARSER_VERSION);
php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__);
php_info_print_table_end();
}
/* }}} */
/* {{{ zephir_parser_functions[]
*
* Every user visible function must have an entry in zephir_parser_functions[].
*/
static const zend_function_entry zephir_parser_functions[] = {
PHP_FE(zephir_parse_file, NULL)
PHP_FE_END
};
/* }}} */
/* {{{ zephir_parser_module_entry
*/
zend_module_entry zephir_parser_module_entry = {
STANDARD_MODULE_HEADER,
PHP_ZEPHIR_PARSER_NAME,
zephir_parser_functions,
PHP_MINIT(zephir_parser),
PHP_MSHUTDOWN(zephir_parser),
NULL,
NULL,
PHP_MINFO(zephir_parser),
PHP_ZEPHIR_PARSER_VERSION,
STANDARD_MODULE_PROPERTIES
};
/* }}} */
/* implement standard "stub" routine to introduce ourselves to Zend */
#ifdef COMPILE_DL_ZEPHIR_PARSER
# ifdef ZTS
ZEND_TSRMLS_CACHE_DEFINE()
# endif
ZEND_GET_MODULE(zephir_parser)
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。