这篇教程C++ zend_make_printable_zval函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中zend_make_printable_zval函数的典型用法代码示例。如果您正苦于以下问题:C++ zend_make_printable_zval函数的具体用法?C++ zend_make_printable_zval怎么用?C++ zend_make_printable_zval使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了zend_make_printable_zval函数的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: zephir_concat_svsvsvoid zephir_concat_svsvs(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, int self_var TSRMLS_DC) { zval result_copy, op2_copy, op4_copy; int use_copy = 0, use_copy2 = 0, use_copy4 = 0; uint offset = 0, length; if (Z_TYPE_P(op2) != IS_STRING) { zend_make_printable_zval(op2, &op2_copy, &use_copy2); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { zend_make_printable_zval(op4, &op4_copy, &use_copy4); if (use_copy4) { op4 = &op4_copy; } } length = op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len; if (self_var) { if (Z_TYPE_PP(result) != IS_STRING) { zend_make_printable_zval(*result, &result_copy, &use_copy); if (use_copy) { ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); } } offset = Z_STRLEN_PP(result); length += offset; Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); } else { Z_STRVAL_PP(result) = (char *) emalloc(length + 1); } memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); memcpy(Z_STRVAL_PP(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), op5, op5_len); Z_STRVAL_PP(result)[length] = 0; Z_TYPE_PP(result) = IS_STRING; Z_STRLEN_PP(result) = length; if (use_copy2) { zval_dtor(op2); } if (use_copy4) { zval_dtor(op4); } if (use_copy) { zval_dtor(&result_copy); }}
开发者ID:noikiy,项目名称:zend,代码行数:60,
示例2: string_compare_function_exZEND_API int string_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive TSRMLS_DC) /* {{{ */{ zval op1_copy, op2_copy; int use_copy1 = 0, use_copy2 = 0; if (Z_TYPE_P(op1) != IS_STRING) { zend_make_printable_zval(op1, &op1_copy, &use_copy1); } if (Z_TYPE_P(op2) != IS_STRING) { zend_make_printable_zval(op2, &op2_copy, &use_copy2); } if (use_copy1) { op1 = &op1_copy; } if (use_copy2) { op2 = &op2_copy; } if (case_insensitive) { ZVAL_LONG(result, zend_binary_zval_strcasecmp(op1, op2)); } else { ZVAL_LONG(result, zend_binary_zval_strcmp(op1, op2)); } if (use_copy1) { zval_dtor(op1); } if (use_copy2) { zval_dtor(op2); } return SUCCESS;}
开发者ID:MaimaiCoder,项目名称:hhvm,代码行数:33,
示例3: zephir_concat_vsvsvoid zephir_concat_vsvs(zval **result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, const char *op4, zend_uint op4_len, int self_var TSRMLS_DC){ zval result_copy, op1_copy, op3_copy; int use_copy = 0, use_copy1 = 0, use_copy3 = 0; uint offset = 0, length; if (Z_TYPE_P(op1) != IS_STRING) { zend_make_printable_zval(op1, &op1_copy, &use_copy1); if (use_copy1) { op1 = &op1_copy; } } if (Z_TYPE_P(op3) != IS_STRING) { zend_make_printable_zval(op3, &op3_copy, &use_copy3); if (use_copy3) { op3 = &op3_copy; } } length = Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + op4_len; if (self_var) { if (Z_TYPE_PP(result) != IS_STRING) { zend_make_printable_zval(*result, &result_copy, &use_copy); if (use_copy) { ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); } } offset = Z_STRLEN_PP(result); length += offset; Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); } else { Z_STRVAL_PP(result) = (char *) emalloc(length + 1); } memcpy(Z_STRVAL_PP(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1), op2, op2_len); memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len, Z_STRVAL_P(op3), Z_STRLEN_P(op3)); memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3), op4, op4_len); Z_STRVAL_PP(result)[length] = 0; Z_TYPE_PP(result) = IS_STRING; Z_STRLEN_PP(result) = length; if (use_copy1) { zval_dtor(op1); } if (use_copy3) { zval_dtor(op3); } if (use_copy) { zval_dtor(&result_copy); }}
开发者ID:noikiy,项目名称:php-oauth2-server,代码行数:59,
示例4: zephir_concat_vvvoid zephir_concat_vv(zval **result, zval *op1, zval *op2, int self_var TSRMLS_DC){ zval result_copy, op1_copy, op2_copy; int use_copy = 0, use_copy1 = 0, use_copy2 = 0; uint offset = 0, length; if (Z_TYPE_P(op1) != IS_STRING) { zend_make_printable_zval(op1, &op1_copy, &use_copy1); if (use_copy1) { op1 = &op1_copy; } } if (Z_TYPE_P(op2) != IS_STRING) { zend_make_printable_zval(op2, &op2_copy, &use_copy2); if (use_copy2) { op2 = &op2_copy; } } length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); if (self_var) { if (Z_TYPE_PP(result) != IS_STRING) { zend_make_printable_zval(*result, &result_copy, &use_copy); if (use_copy) { ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); } } offset = Z_STRLEN_PP(result); length += offset; Z_STRVAL_PP(result) = (char *) erealloc(Z_STRVAL_PP(result), length + 1); } else { Z_STRVAL_PP(result) = (char *) emalloc(length + 1); } memcpy(Z_STRVAL_PP(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); Z_STRVAL_PP(result)[length] = 0; Z_TYPE_PP(result) = IS_STRING; Z_STRLEN_PP(result) = length; if (use_copy1) { zval_dtor(op1); } if (use_copy2) { zval_dtor(op2); } if (use_copy) { zval_dtor(&result_copy); }}
开发者ID:duythien,项目名称:zephir-example,代码行数:57,
示例5: phalcon_make_printable_zvalvoid phalcon_make_printable_zval(zval *expr, zval *expr_copy, int *use_copy){ zend_make_printable_zval(expr, expr_copy, use_copy); if (use_copy) { Z_SET_REFCOUNT_P(expr_copy, 1); Z_UNSET_ISREF_P(expr_copy); }}
开发者ID:RSivakov,项目名称:cphalcon,代码行数:7,
示例6: zephir_concat_ssvoid zephir_concat_ss(zval **result, const char *op1, zend_uint op1_len, const char *op2, zend_uint op2_len, int self_var TSRMLS_DC){ zval result_copy; int use_copy = 0; uint offset = 0, length; length = op1_len + op2_len; if (self_var) { if (Z_TYPE_PP(result) != IS_STRING) { zend_make_printable_zval(*result, &result_copy, &use_copy); if (use_copy) { ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); } } offset = Z_STRLEN_PP(result); length += offset; Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); } else { Z_STRVAL_PP(result) = (char *) emalloc(length + 1); } memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); memcpy(Z_STRVAL_PP(result) + offset + op1_len, op2, op2_len); Z_STRVAL_PP(result)[length] = 0; Z_TYPE_PP(result) = IS_STRING; Z_STRLEN_PP(result) = length; if (use_copy) { zval_dtor(&result_copy); }}
开发者ID:noikiy,项目名称:php-oauth2-server,代码行数:35,
示例7: phalcon_raw_url_encodevoid phalcon_raw_url_encode(zval *return_value, zval *url) { zval copy; char *escaped; int use_copy = 0, length; if (Z_TYPE_P(url) == IS_STRING) { zend_make_printable_zval(url, ©, &use_copy); if (use_copy) { url = © } } escaped = php_raw_url_encode(Z_STRVAL_P(url), Z_STRLEN_P(url), &length); if (use_copy) { zval_dtor(url); } if (escaped) { RETURN_STRINGL(escaped, length, 0); } else { RETURN_NULL(); }}
开发者ID:11mariom,项目名称:cphalcon,代码行数:25,
示例8: PHP_METHOD/** * Sends the headers to the client * * @return boolean */PHP_METHOD(Phalcon_Http_Response_Headers, send){ zval *headers, *value = NULL, *header = NULL; zval *http_header = NULL; zval copy; int use_copy; HashTable *ah0; HashPosition hp0; zval **hd; sapi_header_line ctr = { NULL, 0, 0 }; PHALCON_MM_GROW(); if (!SG(headers_sent)) { PHALCON_OBS_VAR(headers); phalcon_read_property_this(&headers, this_ptr, SL("_headers"), PH_NOISY_CC); phalcon_is_iterable(headers, &ah0, &hp0, 0, 0); while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) { PHALCON_GET_HKEY(header, ah0, hp0); PHALCON_GET_HVALUE(value); if (PHALCON_IS_NOT_EMPTY(value)) { PHALCON_INIT_NVAR(http_header); PHALCON_CONCAT_VSV(http_header, header, ": ", value); ctr.line = Z_STRVAL_P(http_header); ctr.line_len = Z_STRLEN_P(http_header); sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); } else { zend_make_printable_zval(header, ©, &use_copy); if (unlikely(use_copy)) { header = © } ctr.line = Z_STRVAL_P(header); ctr.line_len = Z_STRLEN_P(header); sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); if (unlikely(use_copy)) { zval_dtor(©); } } zend_hash_move_forward_ex(ah0, &hp0); } RETURN_MM_TRUE; } RETURN_MM_FALSE;}
开发者ID:11mariom,项目名称:cphalcon,代码行数:59,
示例9: zephir_fast_strlen/** * Fast call to php strlen */void zephir_fast_strlen(zval *return_value, zval *str){ zval copy; int use_copy = 0; if (Z_TYPE_P(str) != IS_STRING) { zend_make_printable_zval(str, ©, &use_copy); if (use_copy) { str = © } } ZVAL_LONG(return_value, Z_STRLEN_P(str)); if (use_copy) { zval_dtor(str); }}
开发者ID:darkgaro,项目名称:zephir,代码行数:21,
示例10: zephir_fast_strlen_ev/** * Fast call to php strlen */int zephir_fast_strlen_ev(zval *str){ zval copy; int use_copy = 0, length; if (Z_TYPE_P(str) != IS_STRING) { zend_make_printable_zval(str, ©, &use_copy); if (use_copy) { str = © } } length = Z_STRLEN_P(str); if (use_copy) { zval_dtor(str); } return length;}
开发者ID:darkgaro,项目名称:zephir,代码行数:22,
示例11: protobuf_convert_to_stringbool protobuf_convert_to_string(zval* from) { switch (Z_TYPE_P(from)) { case IS_STRING: { return true; } case IS_BOOL: case IS_LONG: case IS_DOUBLE: { int use_copy; zval tmp; zend_make_printable_zval(from, &tmp, &use_copy); ZVAL_COPY_VALUE(from, &tmp); return true; } default: zend_error(E_USER_ERROR, "Given value cannot be converted to string."); return false; }}
开发者ID:Livefyre,项目名称:protobuf,代码行数:19,
示例12: zend_print_zval_exZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent){ zval expr_copy; int use_copy; zend_make_printable_zval(expr, &expr_copy, &use_copy); if (use_copy) { expr = &expr_copy; } if (expr->value.str.len==0) { /* optimize away empty strings */ if (use_copy) { zval_dtor(expr); } return 0; } write_func(expr->value.str.val, expr->value.str.len); if (use_copy) { zval_dtor(expr); } return expr->value.str.len;}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:21,
示例13: phalcon_filter_identifier/** * Filter identifiers string like variables or database columns/tables */void phalcon_filter_identifier(zval *return_value, zval *param){ int i; char ch; zval copy = {}; smart_str filtered_str = {0}; int use_copy = 0; if (Z_TYPE_P(param) != IS_STRING) { use_copy = zend_make_printable_zval(param, ©); if (use_copy) { param = © } } for (i = 0; i < Z_STRLEN_P(param); i++) { ch = Z_STRVAL_P(param)[i]; if (ch == '/0') { break; } if (isalnum(ch) || ch == '_') { smart_str_appendc(&filtered_str, ch); } } if (use_copy) { zval_ptr_dtor(param); } smart_str_0(&filtered_str); if (filtered_str.s) { RETURN_NEW_STR(filtered_str.s); } else { smart_str_free(&filtered_str); RETURN_EMPTY_STRING(); }}
开发者ID:dreamsxin,项目名称:cphalcon7,代码行数:42,
示例14: zephir_filter_identifier/** * Filter identifiers string like variables or database columns/tables */void zephir_filter_identifier(zval *return_value, zval *param){ unsigned int i; unsigned char ch; zval copy; smart_str filtered_str = {0}; int use_copy = 0; if (Z_TYPE_P(param) != IS_STRING) { zend_make_printable_zval(param, ©, &use_copy); if (use_copy) { param = © } } for (i = 0; i < Z_STRLEN_P(param); i++) { ch = Z_STRVAL_P(param)[i]; if (ch == '/0') { break; } if (isalnum(ch) || ch == '_') { smart_str_appendc(&filtered_str, ch); } } if (use_copy) { zval_dtor(param); } smart_str_0(&filtered_str); if (filtered_str.c) { RETURN_STRINGL(filtered_str.c, filtered_str.len, 0); } else { RETURN_EMPTY_STRING(); }}
开发者ID:andont,项目名称:zephir,代码行数:41,
示例15: zephir_fast_strtolower/** * Fast call to php strlen */void zephir_fast_strtolower(zval *return_value, zval *str){ zval copy; int use_copy = 0; char *lower_str; unsigned int length; if (Z_TYPE_P(str) != IS_STRING) { zend_make_printable_zval(str, ©, &use_copy); if (use_copy) { str = © } } length = Z_STRLEN_P(str); lower_str = estrndup(Z_STRVAL_P(str), length); php_strtolower(lower_str, length); if (use_copy) { zval_dtor(str); } ZVAL_STRINGL(return_value, lower_str, length, 0);}
开发者ID:darkgaro,项目名称:zephir,代码行数:27,
示例16: zephir_escape_multi/** * Perform escaping of non-alphanumeric characters to different formats */void zephir_escape_multi(zval *return_value, zval *param, const char *escape_char, unsigned int escape_length, char escape_extra, int use_whitelist){ unsigned int i; zval copy; smart_str escaped_str = {0}; char machine_little_endian, *hex; int big_endian_long_map[4]; int use_copy = 0, machine_endian_check = 1; int issigned = 0; long value; if (Z_TYPE_P(param) != IS_STRING) { use_copy = zend_make_printable_zval(param, ©); if (use_copy) { param = © } } if (Z_STRLEN_P(param) <= 0) { RETURN_FALSE; } /** * This is how the big_ending_long_map is calculated as in 'pack' */ machine_little_endian = ((char *) &machine_endian_check)[0]; if (machine_little_endian) { big_endian_long_map[0] = 3; big_endian_long_map[1] = 2; big_endian_long_map[2] = 1; big_endian_long_map[3] = 0; } else { int size = sizeof(Z_LVAL_P(param)); big_endian_long_map[0] = size - 4; big_endian_long_map[1] = size - 3; big_endian_long_map[2] = size - 2; big_endian_long_map[3] = size - 1; } /** * The input must be a valid UTF-32 string */ if ((Z_STRLEN_P(param) % 4) != 0) { RETURN_FALSE; } for (i = 0; i < Z_STRLEN_P(param); i += 4) { issigned = Z_STRVAL_P(param)[i] & 0x80; value = 0; if (sizeof(long) > 4 && issigned) { value = ~INT_MAX; } value |= zephir_unpack(&Z_STRVAL_P(param)[i], 4, issigned, big_endian_long_map); if (sizeof(long) > 4) { value = (unsigned int) value; } /** * CSS 2.1 section 4.1.3: "It is undefined in CSS 2.1 what happens if a * style sheet does contain a character with Unicode codepoint zero." */ if (value == '/0') { RETURN_FALSE; } /** * Alphanumeric characters are not escaped */ if (value < 256 && isalnum(value)) { smart_str_appendc(&escaped_str, (unsigned char) value); continue; } /** * Chararters in the whitelist are left as they are */ if (use_whitelist) { switch (value) { case ' ': case '/': case '*': case '+': case '-': case '/t': case '/n': case '^': case '$': case '!': case '?': case '//': case '#': case '}': case '{'://.........这里部分代码省略.........
开发者ID:8V017UW2RQ70,项目名称:zephir,代码行数:101,
示例17: php_formatted_print//.........这里部分代码省略......... PRINTF_DEBUG(("sprintf: precision=%d/n", precision)); } else { width = precision = 0; argnum = currarg++ + format_offset; } if (argnum >= argc) { efree(result); efree(args); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too few arguments"); return NULL; } if (format[inpos] == 'l') { inpos++; } PRINTF_DEBUG(("sprintf: format character='%c'/n", format[inpos])); /* now we expect to find a type specifier */ if (multiuse) { MAKE_STD_ZVAL(tmp); *tmp = **(args[argnum]); INIT_PZVAL(tmp); zval_copy_ctor(tmp); } else { SEPARATE_ZVAL(args[argnum]); tmp = *(args[argnum]); } switch (format[inpos]) { case 's': { zval *var, var_copy; int use_copy; zend_make_printable_zval(tmp, &var_copy, &use_copy); if (use_copy) { var = &var_copy; } else { var = tmp; } php_sprintf_appendstring(&result, &outpos, &size, Z_STRVAL_P(var), width, precision, padding, alignment, Z_STRLEN_P(var), 0, expprec, 0); if (use_copy) { zval_dtor(&var_copy); } break; } case 'd': convert_to_long(tmp); php_sprintf_appendint(&result, &outpos, &size, Z_LVAL_P(tmp), width, padding, alignment, always_sign); break; case 'u': convert_to_long(tmp); php_sprintf_appenduint(&result, &outpos, &size, Z_LVAL_P(tmp), width, padding, alignment); break;
开发者ID:NobleGaz,项目名称:PHP,代码行数:66,
示例18: zend_optimizer_compact_literals//.........这里部分代码省略......... if (opline->op1_type == IS_CONST) { LITERAL_INFO(opline->op1.constant, LITERAL_VALUE, 1); } if (opline->op2_type == IS_CONST) { if (Z_EXTRA(op_array->literals[opline->op2.constant]) == ZEND_EXTRA_VALUE) { LITERAL_INFO(opline->op2.constant, LITERAL_VALUE, 2); } else { LITERAL_INFO(opline->op2.constant, LITERAL_VALUE, 1); } } break; default: if (opline->op1_type == IS_CONST) { LITERAL_INFO(opline->op1.constant, LITERAL_VALUE, 1); } if (opline->op2_type == IS_CONST) { LITERAL_INFO(opline->op2.constant, LITERAL_VALUE, 1); } break; } opline++; }#if DEBUG_COMPACT_LITERALS { int i, use_copy; fprintf(stderr, "File %s func %s/n", op_array->filename->val, op_array->function_name ? op_array->function_name->val : "main"); fprintf(stderr, "Literlas table size %d/n", op_array->last_literal); for (i = 0; i < op_array->last_literal; i++) { zval zv; ZVAL_COPY_VALUE(&zv, op_array->literals + i); use_copy = zend_make_printable_zval(op_array->literals + i, &zv); fprintf(stderr, "Literal %d, val (%d):%s/n", i, Z_STRLEN(zv), Z_STRVAL(zv)); if (use_copy) { zval_ptr_dtor_nogc(&zv); } } fflush(stderr); }#endif /* Merge equal constants */ j = 0; zend_hash_init(&hash, op_array->last_literal, NULL, NULL, 0); map = (int*)zend_arena_alloc(&ctx->arena, op_array->last_literal * sizeof(int)); memset(map, 0, op_array->last_literal * sizeof(int)); for (i = 0; i < op_array->last_literal; i++) { if (!info[i].flags) { /* unset literal */ zval_ptr_dtor_nogc(&op_array->literals[i]); continue; } switch (Z_TYPE(op_array->literals[i])) { case IS_NULL: if (l_null < 0) { l_null = j; if (i != j) { op_array->literals[j] = op_array->literals[i]; info[j] = info[i]; } j++; } map[i] = l_null; break;
开发者ID:crrodriguez,项目名称:php-src,代码行数:67,
示例19: zephir_file_put_contents/** * Writes a zval to a stream */void zephir_file_put_contents(zval *return_value, zval *filename, zval *data){ php_stream *stream; int numbytes = 0, use_copy = 0; zval *zcontext = NULL; zval copy; php_stream_context *context = NULL; if (Z_TYPE_P(filename) != IS_STRING) { php_error_docref(NULL, E_WARNING, "Invalid arguments supplied for zephir_file_put_contents()"); if (return_value) { RETVAL_FALSE; } return; } context = php_stream_context_from_zval(zcontext, 0 & PHP_FILE_NO_DEFAULT_CONTEXT); stream = php_stream_open_wrapper_ex(Z_STRVAL_P(filename), "wb", ((0 & PHP_FILE_USE_INCLUDE_PATH) ? USE_PATH : 0) | REPORT_ERRORS, NULL, context); if (stream == NULL) { if (return_value) { RETURN_FALSE; } return; } switch (Z_TYPE_P(data)) { case IS_NULL: case IS_LONG: case IS_DOUBLE: case IS_TRUE: case IS_FALSE: case IS_CONSTANT: use_copy = zend_make_printable_zval(data, ©); if (use_copy) { data = © } /* no break */ case IS_STRING: if (Z_STRLEN_P(data)) { numbytes = php_stream_write(stream, Z_STRVAL_P(data), Z_STRLEN_P(data)); if (numbytes != Z_STRLEN_P(data)) { php_error_docref(NULL, E_WARNING, "Only %d of %d bytes written, possibly out of free disk space", numbytes, Z_STRLEN_P(data)); numbytes = -1; } } break; default: numbytes = -1; break; } php_stream_close(stream); if (use_copy) { zval_dtor(data); } if (numbytes < 0) { if (return_value) { RETURN_FALSE; } else { return; } } if (return_value) { RETURN_LONG(numbytes); } return;}
开发者ID:oscarmolinadev,项目名称:zephir,代码行数:76,
示例20: zend_optimizer_compact_literals//.........这里部分代码省略......... case ZEND_DECLARE_INHERITED_CLASS: case ZEND_DECLARE_INHERITED_CLASS_DELAYED: LITERAL_INFO(opline->op1.constant, LITERAL_VALUE, 0, 0, 2); break; case ZEND_RECV: case ZEND_RECV_VARIADIC: case ZEND_VERIFY_RETURN_TYPE: if (opline->op2.num != (uint32_t)-1) { opline->op2.num = cache_size; cache_size += sizeof(void *); } default: if (ZEND_OP1_TYPE(opline) == IS_CONST) { LITERAL_INFO(opline->op1.constant, LITERAL_VALUE, 1, 0, 1); } if (ZEND_OP2_TYPE(opline) == IS_CONST) { LITERAL_INFO(opline->op2.constant, LITERAL_VALUE, 1, 0, 1); } break; } opline++; }#if DEBUG_COMPACT_LITERALS { int i, use_copy; fprintf(stderr, "File %s func %s/n", op_array->filename->val, op_array->function_name ? op_array->function_name->val : "main"); fprintf(stderr, "Literlas table size %d/n", op_array->last_literal); for (i = 0; i < op_array->last_literal; i++) { zval zv; ZVAL_COPY_VALUE(&zv, op_array->literals + i); use_copy = zend_make_printable_zval(op_array->literals + i, &zv); fprintf(stderr, "Literal %d, val (%d):%s/n", i, Z_STRLEN(zv), Z_STRVAL(zv)); if (use_copy) { zval_dtor(&zv); } } fflush(stderr); }#endif /* Merge equal constants */ j = 0; zend_hash_init(&hash, op_array->last_literal, NULL, NULL, 0); map = (int*)zend_arena_alloc(&ctx->arena, op_array->last_literal * sizeof(int)); memset(map, 0, op_array->last_literal * sizeof(int)); for (i = 0; i < op_array->last_literal; i++) { if (!info[i].flags) { /* unsed literal */ zval_dtor(&op_array->literals[i]); continue; } switch (Z_TYPE(op_array->literals[i])) { case IS_NULL: /* Only checking MAY_MERGE for IS_NULL here * is because only IS_NULL can be default value for class type hinting(RECV_INIT). */ if ((info[i].flags & LITERAL_MAY_MERGE)) { if (l_null < 0) { l_null = j; if (i != j) { op_array->literals[j] = op_array->literals[i]; info[j] = info[i]; } j++;
开发者ID:LTD-Beget,项目名称:php-src,代码行数:67,
示例21: zephir_concat_vvvvsvvvoid zephir_concat_vvvvsvv(zval **result, zval *op1, zval *op2, zval *op3, zval *op4, const char *op5, zend_uint op5_len, zval *op6, zval *op7, int self_var TSRMLS_DC){ zval result_copy, op1_copy, op2_copy, op3_copy, op4_copy, op6_copy, op7_copy; int use_copy = 0, use_copy1 = 0, use_copy2 = 0, use_copy3 = 0, use_copy4 = 0, use_copy6 = 0, use_copy7 = 0; uint offset = 0, length; if (Z_TYPE_P(op1) != IS_STRING) { zend_make_printable_zval(op1, &op1_copy, &use_copy1); if (use_copy1) { op1 = &op1_copy; } } if (Z_TYPE_P(op2) != IS_STRING) { zend_make_printable_zval(op2, &op2_copy, &use_copy2); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op3) != IS_STRING) { zend_make_printable_zval(op3, &op3_copy, &use_copy3); if (use_copy3) { op3 = &op3_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { zend_make_printable_zval(op4, &op4_copy, &use_copy4); if (use_copy4) { op4 = &op4_copy; } } if (Z_TYPE_P(op6) != IS_STRING) { zend_make_printable_zval(op6, &op6_copy, &use_copy6); if (use_copy6) { op6 = &op6_copy; } } if (Z_TYPE_P(op7) != IS_STRING) { zend_make_printable_zval(op7, &op7_copy, &use_copy7); if (use_copy7) { op7 = &op7_copy; } } length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3) + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + Z_STRLEN_P(op7); if (self_var) { if (Z_TYPE_PP(result) != IS_STRING) { zend_make_printable_zval(*result, &result_copy, &use_copy); if (use_copy) { ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); } } offset = Z_STRLEN_PP(result); length += offset; Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); } else { Z_STRVAL_PP(result) = (char *) emalloc(length + 1); } memcpy(Z_STRVAL_PP(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2), Z_STRVAL_P(op3), Z_STRLEN_P(op3)); memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3), Z_STRVAL_P(op4), Z_STRLEN_P(op4)); memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3) + Z_STRLEN_P(op4), op5, op5_len); memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3) + Z_STRLEN_P(op4) + op5_len, Z_STRVAL_P(op6), Z_STRLEN_P(op6)); memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3) + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6), Z_STRVAL_P(op7), Z_STRLEN_P(op7)); Z_STRVAL_PP(result)[length] = 0; Z_TYPE_PP(result) = IS_STRING; Z_STRLEN_PP(result) = length; if (use_copy1) { zval_dtor(op1); } if (use_copy2) { zval_dtor(op2); } if (use_copy3) { zval_dtor(op3); } if (use_copy4) { zval_dtor(op4); } if (use_copy6) { zval_dtor(op6); } if (use_copy7) { zval_dtor(op7); }//.........这里部分代码省略.........
开发者ID:penlooktmp,项目名称:cmd,代码行数:101,
注:本文中的zend_make_printable_zval函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ zend_object_std_init函数代码示例 C++ zend_is_true函数代码示例 |