summaryrefslogtreecommitdiff
path: root/ext/standard/basic_functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/basic_functions.c')
-rw-r--r--ext/standard/basic_functions.c41
1 files changed, 31 insertions, 10 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 1ac31200b0..55e1f7e2eb 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -2679,6 +2679,25 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_version_compare, 0, 0, 2)
ZEND_ARG_INFO(0, oper)
ZEND_END_ARG_INFO()
/* }}} */
+/* {{{ win32/codepage.c */
+#ifdef PHP_WIN32
+ZEND_BEGIN_ARG_INFO_EX(arginfo_sapi_windows_cp_set, 0, 0, 1)
+ ZEND_ARG_TYPE_INFO(0, code_page, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_sapi_windows_cp_get, 0, 0, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_sapi_windows_cp_is_utf8, 0, 0, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_sapi_windows_cp_conv, 0, 0, 3)
+ ZEND_ARG_INFO(0, in_codepage)
+ ZEND_ARG_INFO(0, out_codepage)
+ ZEND_ARG_TYPE_INFO(0, subject, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+#endif
+/* }}} */
/* }}} */
const zend_function_entry basic_functions[] = { /* {{{ */
@@ -3373,6 +3392,12 @@ const zend_function_entry basic_functions[] = { /* {{{ */
PHP_FE(sys_get_temp_dir, arginfo_sys_get_temp_dir)
+#ifdef PHP_WIN32
+ PHP_FE(sapi_windows_cp_set, arginfo_sapi_windows_cp_set)
+ PHP_FE(sapi_windows_cp_get, arginfo_sapi_windows_cp_get)
+ PHP_FE(sapi_windows_cp_is_utf8, arginfo_sapi_windows_cp_is_utf8)
+ PHP_FE(sapi_windows_cp_conv, arginfo_sapi_windows_cp_conv)
+#endif
PHP_FE_END
};
/* }}} */
@@ -5120,7 +5145,8 @@ ZEND_API void php_get_highlight_struct(zend_syntax_highlighter_ini *syntax_highl
PHP_FUNCTION(highlight_file)
{
char *filename;
- size_t filename_len, ret;
+ size_t filename_len;
+ int ret;
zend_syntax_highlighter_ini syntax_highlighter_ini;
zend_bool i = 0;
@@ -5163,7 +5189,7 @@ PHP_FUNCTION(php_strip_whitespace)
char *filename;
size_t filename_len;
zend_lex_state original_lex_state;
- zend_file_handle file_handle = {{0}};
+ zend_file_handle file_handle;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
RETURN_FALSE;
@@ -5171,6 +5197,7 @@ PHP_FUNCTION(php_strip_whitespace)
php_output_start_default();
+ memset(&file_handle, 0, sizeof(file_handle));
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = filename;
file_handle.free_filename = 0;
@@ -5482,15 +5509,9 @@ PHP_FUNCTION(print_r)
}
if (do_return) {
- php_output_start_default();
- }
-
- zend_print_zval_r(var, 0);
-
- if (do_return) {
- php_output_get_contents(return_value);
- php_output_discard();
+ RETURN_STR(zend_print_zval_r_to_str(var, 0));
} else {
+ zend_print_zval_r(var, 0);
RETURN_TRUE;
}
}