|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patch 0001-remove-deleted-macros for yaml Bug #78353Patch version 2019-07-30 06:18 UTC Return to Bug #78353 | Download this patchThis patch is obsolete Obsoleted by patches: Patch Revisions:Developer: a.dankovtsev@mail.ru
From d63c35c2a3bbdc95f9ab7609f6dd72db9d18cc56 Mon Sep 17 00:00:00 2001
From: Aleksandr Dankovtsev <adankovtsev@avito.ru>
Date: Tue, 30 Jul 2019 09:05:05 +0300
Subject: [PATCH] remove deleted macros
---
emit.c | 154 ++++++++++++++++++++++++-------------------------
parse.c | 126 ++++++++++++++++++++--------------------
php_yaml.h | 6 +-
php_yaml_int.h | 12 ++--
yaml.c | 48 +++++++--------
5 files changed, 173 insertions(+), 173 deletions(-)
diff --git a/emit.c b/emit.c
index 34bdd12..c931b8d 100644
--- a/emit.c
+++ b/emit.c
@@ -40,7 +40,7 @@
*/
#define y_event_init_failed(e) \
yaml_event_delete(e); \
- php_error_docref(NULL TSRMLS_CC, E_WARNING,\
+ php_error_docref(NULL, E_WARNING,\
"Memory error: Not enough memory for creating an event (libyaml)")
#define Y_ARRAY_SEQUENCE 1
@@ -51,34 +51,34 @@
/* {{{ local prototypes
*/
static int y_event_emit(
- const y_emit_state_t *state, yaml_event_t *event TSRMLS_DC);
-static void y_handle_emitter_error(const y_emit_state_t *state TSRMLS_DC);
-static int y_array_is_sequence(HashTable *ht TSRMLS_DC);
-static void y_scan_recursion(const y_emit_state_t *state, zval *data TSRMLS_DC);
+ const y_emit_state_t *state, yaml_event_t *event);
+static void y_handle_emitter_error(const y_emit_state_t *state);
+static int y_array_is_sequence(HashTable *ht);
+static void y_scan_recursion(const y_emit_state_t *state, zval *data);
static zend_long y_search_recursive(
- const y_emit_state_t *state, const zend_ulong addr TSRMLS_DC);
+ const y_emit_state_t *state, const zend_ulong addr);
static int y_write_zval(
- const y_emit_state_t *state, zval *data, yaml_char_t *tag TSRMLS_DC);
+ const y_emit_state_t *state, zval *data, yaml_char_t *tag);
static int y_write_null(
- const y_emit_state_t *state, yaml_char_t *tag TSRMLS_DC);
+ const y_emit_state_t *state, yaml_char_t *tag);
static int y_write_bool(
- const y_emit_state_t *state, zval *data, yaml_char_t *tag TSRMLS_DC);
+ const y_emit_state_t *state, zval *data, yaml_char_t *tag);
static int y_write_long(
- const y_emit_state_t *state, zval *data, yaml_char_t *tag TSRMLS_DC);
+ const y_emit_state_t *state, zval *data, yaml_char_t *tag);
static int y_write_double(
- const y_emit_state_t *state, zval *data, yaml_char_t *tag TSRMLS_DC);
+ const y_emit_state_t *state, zval *data, yaml_char_t *tag);
static int y_write_string(
- const y_emit_state_t *state, zval *data, yaml_char_t *tag TSRMLS_DC);
+ const y_emit_state_t *state, zval *data, yaml_char_t *tag);
static int y_write_array(
- const y_emit_state_t *state, zval *data, yaml_char_t *tag TSRMLS_DC);
+ const y_emit_state_t *state, zval *data, yaml_char_t *tag);
static int y_write_timestamp(
- const y_emit_state_t *state, zval *data, yaml_char_t *tag TSRMLS_DC);
+ const y_emit_state_t *state, zval *data, yaml_char_t *tag);
static int y_write_object(
- const y_emit_state_t *state, zval *data, yaml_char_t *tag TSRMLS_DC);
+ const y_emit_state_t *state, zval *data, yaml_char_t *tag);
static int y_write_object_callback (
const y_emit_state_t *state, zval *callback, zval *data,
- const char *clazz_name TSRMLS_DC);
+ const char *clazz_name);
static inline unsigned int get_next_char(
const unsigned char *str, size_t str_len, size_t *cursor, int *status);
/* }}} */
@@ -88,11 +88,11 @@ static inline unsigned int get_next_char(
* send an event to the emitter
*/
static int
-y_event_emit(const y_emit_state_t *state, yaml_event_t *event TSRMLS_DC)
+y_event_emit(const y_emit_state_t *state, yaml_event_t *event)
{
if (!yaml_emitter_emit(state->emitter, event)) {
yaml_event_delete(event);
- y_handle_emitter_error(state TSRMLS_CC);
+ y_handle_emitter_error(state);
return FAILURE;
} else {
@@ -105,26 +105,26 @@ y_event_emit(const y_emit_state_t *state, yaml_event_t *event TSRMLS_DC)
/* {{{ y_handle_emitter_error()
* Emit a warning about an emitter error
*/
-static void y_handle_emitter_error(const y_emit_state_t *state TSRMLS_DC)
+static void y_handle_emitter_error(const y_emit_state_t *state)
{
switch (state->emitter->error) {
case YAML_MEMORY_ERROR:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Memory error: Not enough memory for emitting");
break;
case YAML_WRITER_ERROR:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Writer error: %s", state->emitter->problem);
break;
case YAML_EMITTER_ERROR:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Emitter error: %s", state->emitter->problem);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal error");
+ php_error_docref(NULL, E_WARNING, "Internal error");
break;
}
}
@@ -134,7 +134,7 @@ static void y_handle_emitter_error(const y_emit_state_t *state TSRMLS_DC)
/* {{{ y_array_is_sequence()
* Does the array encode a sequence?
*/
-static int y_array_is_sequence(HashTable *ht TSRMLS_DC)
+static int y_array_is_sequence(HashTable *ht)
{
zend_ulong kidx, idx;
zend_string *str_key;
@@ -159,7 +159,7 @@ static int y_array_is_sequence(HashTable *ht TSRMLS_DC)
/* {{{ y_scan_recursion()
* walk an object graph looking for recursive references
*/
-static void y_scan_recursion(const y_emit_state_t *state, zval *data TSRMLS_DC)
+static void y_scan_recursion(const y_emit_state_t *state, zval *data)
{
HashTable *ht;
zval *elm;
@@ -197,7 +197,7 @@ static void y_scan_recursion(const y_emit_state_t *state, zval *data TSRMLS_DC)
#endif
ZEND_HASH_FOREACH_VAL(ht, elm) {
- y_scan_recursion(state, elm TSRMLS_CC);
+ y_scan_recursion(state, elm);
} ZEND_HASH_FOREACH_END();
#if PHP_VERSION_ID >= 70300
@@ -219,7 +219,7 @@ static void y_scan_recursion(const y_emit_state_t *state, zval *data TSRMLS_DC)
* Search the recursive state hash for an address
*/
static zend_long y_search_recursive(
- const y_emit_state_t *state, const zend_ulong addr TSRMLS_DC)
+ const y_emit_state_t *state, const zend_ulong addr)
{
zval *entry;
zend_ulong num_key;
@@ -240,7 +240,7 @@ static zend_long y_search_recursive(
* Write a php zval to the emitter
*/
static int y_write_zval(
- const y_emit_state_t *state, zval *data, yaml_char_t *tag TSRMLS_DC)
+ const y_emit_state_t *state, zval *data, yaml_char_t *tag)
{
int status = FAILURE;
@@ -250,41 +250,41 @@ static int y_write_zval(
break;
case IS_NULL:
- status = y_write_null(state, tag TSRMLS_CC);
+ status = y_write_null(state, tag);
break;
case IS_TRUE:
case IS_FALSE:
- status = y_write_bool(state, data, tag TSRMLS_CC);
+ status = y_write_bool(state, data, tag);
break;
case IS_LONG:
- status = y_write_long(state, data, tag TSRMLS_CC);
+ status = y_write_long(state, data, tag);
break;
case IS_DOUBLE:
- status = y_write_double(state, data, tag TSRMLS_CC);
+ status = y_write_double(state, data, tag);
break;
case IS_STRING:
- status = y_write_string(state, data, tag TSRMLS_CC);
+ status = y_write_string(state, data, tag);
break;
case IS_ARRAY:
- status = y_write_array(state, data, tag TSRMLS_CC);
+ status = y_write_array(state, data, tag);
break;
case IS_OBJECT:
- status = y_write_object(state, data, tag TSRMLS_CC);
+ status = y_write_object(state, data, tag);
break;
case IS_RESOURCE: /* unsupported object */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ php_error_docref(NULL, E_NOTICE,
"Unable to emit PHP resources.");
break;
default: /* something we didn't think of */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ php_error_docref(NULL, E_NOTICE,
"Unsupported php zval type %d.", Z_TYPE_P(data));
break;
}
@@ -296,7 +296,7 @@ static int y_write_zval(
/* {{{ y_write_null()
*/
-static int y_write_null(const y_emit_state_t *state, yaml_char_t *tag TSRMLS_DC)
+static int y_write_null(const y_emit_state_t *state, yaml_char_t *tag)
{
yaml_event_t event;
int omit_tag = 0;
@@ -314,7 +314,7 @@ static int y_write_null(const y_emit_state_t *state, yaml_char_t *tag TSRMLS_DC)
y_event_init_failed(&event);
return FAILURE;
}
- return y_event_emit(state, &event TSRMLS_CC);
+ return y_event_emit(state, &event);
}
/* }}} */
@@ -322,7 +322,7 @@ static int y_write_null(const y_emit_state_t *state, yaml_char_t *tag TSRMLS_DC)
/* {{{ y_write_bool()
*/
static int y_write_bool(
- const y_emit_state_t *state, zval *data, yaml_char_t *tag TSRMLS_DC)
+ const y_emit_state_t *state, zval *data, yaml_char_t *tag)
{
yaml_event_t event;
int omit_tag = 0;
@@ -341,7 +341,7 @@ static int y_write_bool(
y_event_init_failed(&event);
return FAILURE;
}
- return y_event_emit(state, &event TSRMLS_CC);
+ return y_event_emit(state, &event);
}
/* }}} */
@@ -349,7 +349,7 @@ static int y_write_bool(
/* {{{ y_write_long()
*/
static int y_write_long(
- const y_emit_state_t *state, zval *data, yaml_char_t *tag TSRMLS_DC)
+ const y_emit_state_t *state, zval *data, yaml_char_t *tag)
{
yaml_event_t event;
int omit_tag = 0;
@@ -374,7 +374,7 @@ static int y_write_long(
y_event_init_failed(&event);
return FAILURE;
}
- return y_event_emit(state, &event TSRMLS_CC);
+ return y_event_emit(state, &event);
}
/* }}} */
@@ -382,7 +382,7 @@ static int y_write_long(
/* {{{ y_write_double()
*/
static int y_write_double(
- const y_emit_state_t *state, zval *data, yaml_char_t *tag TSRMLS_DC)
+ const y_emit_state_t *state, zval *data, yaml_char_t *tag)
{
yaml_event_t event;
int omit_tag = 0;
@@ -407,7 +407,7 @@ static int y_write_double(
y_event_init_failed(&event);
return FAILURE;
}
- return y_event_emit(state, &event TSRMLS_CC);
+ return y_event_emit(state, &event);
}
/* }}} */
@@ -415,7 +415,7 @@ static int y_write_double(
/* {{{ y_write_string()
*/
static int y_write_string(
- const y_emit_state_t *state, zval *data, yaml_char_t *tag TSRMLS_DC)
+ const y_emit_state_t *state, zval *data, yaml_char_t *tag)
{
yaml_event_t event;
int omit_tag = 0;
@@ -441,7 +441,7 @@ static int y_write_string(
us = get_next_char(s, len, &pos, &status);
if (status != SUCCESS) {
/* invalid UTF-8 character found */
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Invalid UTF-8 sequence in argument");
return FAILURE;
@@ -459,7 +459,7 @@ static int y_write_string(
y_event_init_failed(&event);
return FAILURE;
}
- return y_event_emit(state, &event TSRMLS_CC);
+ return y_event_emit(state, &event);
}
/* }}} */
@@ -467,7 +467,7 @@ static int y_write_string(
/* {{{ y_write_array()
*/
static int y_write_array(
- const y_emit_state_t *state, zval *data, yaml_char_t *tag TSRMLS_DC)
+ const y_emit_state_t *state, zval *data, yaml_char_t *tag)
{
yaml_event_t event;
int omit_tag = 0;
@@ -482,7 +482,7 @@ static int y_write_array(
char *anchor = { 0 };
size_t anchor_size;
- array_type = y_array_is_sequence(ht TSRMLS_CC);
+ array_type = y_array_is_sequence(ht);
if (NULL == tag) {
if (Y_ARRAY_SEQUENCE == array_type) {
@@ -503,7 +503,7 @@ static int y_write_array(
* if ht->nApplyCount > 0:
* emit a ref
*/
- recursive_idx = y_search_recursive(state, (zend_ulong) ht TSRMLS_CC);
+ recursive_idx = y_search_recursive(state, (zend_ulong) ht);
if (-1 != recursive_idx) {
/* create anchor to refer to this structure */
anchor_size = snprintf(anchor, 0, "refid%ld", recursive_idx + 1);
@@ -524,7 +524,7 @@ static int y_write_array(
return FAILURE;
}
- status = y_event_emit(state, &event TSRMLS_CC);
+ status = y_event_emit(state, &event);
efree(anchor);
return status;
}
@@ -547,7 +547,7 @@ static int y_write_array(
}
return FAILURE;
}
- status = y_event_emit(state, &event TSRMLS_CC);
+ status = y_event_emit(state, &event);
if (anchor) {
efree(anchor);
}
@@ -580,13 +580,13 @@ static int y_write_array(
}
/* emit key */
- status = y_write_zval(state, &key_zval, NULL TSRMLS_CC);
+ status = y_write_zval(state, &key_zval, NULL);
if (SUCCESS != status) {
return FAILURE;
}
}
- status = y_write_zval(state, elm, NULL TSRMLS_CC);
+ status = y_write_zval(state, elm, NULL);
if (SUCCESS != status) {
@@ -614,7 +614,7 @@ static int y_write_array(
y_event_init_failed(&event);
return FAILURE;
}
- return y_event_emit(state, &event TSRMLS_CC);
+ return y_event_emit(state, &event);
}
/* }}} */
@@ -622,7 +622,7 @@ static int y_write_array(
/* y_write_timestamp()
*/
static int y_write_timestamp(
- const y_emit_state_t *state, zval *data, yaml_char_t *tag TSRMLS_DC)
+ const y_emit_state_t *state, zval *data, yaml_char_t *tag)
{
yaml_event_t event;
int omit_tag = 0;
@@ -651,7 +651,7 @@ static int y_write_timestamp(
y_event_init_failed(&event);
return FAILURE;
}
- return y_event_emit(state, &event TSRMLS_CC);
+ return y_event_emit(state, &event);
}
/* }}} */
@@ -659,7 +659,7 @@ static int y_write_timestamp(
/* {{{ y_write_object()
*/
static int y_write_object(
- const y_emit_state_t *state, zval *data, yaml_char_t *tag TSRMLS_DC)
+ const y_emit_state_t *state, zval *data, yaml_char_t *tag)
{
yaml_event_t event;
int status;
@@ -673,17 +673,17 @@ static int y_write_object(
state->callbacks, clazz_name)) != NULL) {
/* found a registered callback for this class */
status = y_write_object_callback(
- state, callback, data, clazz_name->val TSRMLS_CC);
+ state, callback, data, clazz_name->val);
} else if (0 == strncmp(clazz_name->val, "DateTime", clazz_name->len)) {
- status = y_write_timestamp(state, data, tag TSRMLS_CC);
+ status = y_write_timestamp(state, data, tag);
} else {
/* tag and emit serialized version of object */
php_serialize_data_t var_hash;
smart_str buf = { 0 };
PHP_VAR_SERIALIZE_INIT(var_hash);
- php_var_serialize(&buf, data, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, data, &var_hash);
PHP_VAR_SERIALIZE_DESTROY(var_hash);
status = yaml_scalar_event_initialize(&event,
@@ -694,7 +694,7 @@ static int y_write_object(
y_event_init_failed(&event);
status = FAILURE;
} else {
- status = y_event_emit(state, &event TSRMLS_CC);
+ status = y_event_emit(state, &event);
}
smart_str_free(&buf);
}
@@ -708,7 +708,7 @@ static int y_write_object(
static int
y_write_object_callback (
const y_emit_state_t *state, zval *callback, zval *data,
- const char *clazz_name TSRMLS_DC) {
+ const char *clazz_name) {
zval argv[1];
argv[0] = *data;
zval zret;
@@ -718,9 +718,9 @@ y_write_object_callback (
/* call the user function */
if (FAILURE == call_user_function_ex(EG(function_table), NULL,
- callback, &zret, 1, argv, 0, NULL TSRMLS_CC) ||
+ callback, &zret, 1, argv, 0, NULL) ||
Z_TYPE_P(&zret) == IS_UNDEF) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Failed to apply callback for class '%s'"
" with user defined function", clazz_name);
return FAILURE;
@@ -728,7 +728,7 @@ y_write_object_callback (
/* return val should be array */
if (IS_ARRAY != Z_TYPE_P(&zret)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Expected callback for class '%s'"
" to return an array", clazz_name);
return FAILURE;
@@ -737,7 +737,7 @@ y_write_object_callback (
/* pull out the tag and surrogate object */
str_key = zend_string_init("tag", sizeof("tag") - 1, 0);
if ((ztag = zend_hash_find(Z_ARRVAL_P(&zret), str_key)) == NULL || Z_TYPE_P(ztag) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Expected callback result for class '%s'"
" to contain a key named 'tag' with a string value",
clazz_name);
@@ -748,7 +748,7 @@ y_write_object_callback (
str_key = zend_string_init("data", sizeof("data") - 1, 0);
if ((zdata = zend_hash_find(Z_ARRVAL_P(&zret), str_key)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Expected callback result for class '%s'"
" to contain a key named 'data'",
clazz_name);
@@ -760,7 +760,7 @@ y_write_object_callback (
/* emit surrogate object and tag */
return y_write_zval(
- state, zdata, (yaml_char_t *) Z_STRVAL_P(ztag) TSRMLS_CC);
+ state, zdata, (yaml_char_t *) Z_STRVAL_P(ztag));
}
/* }}} */
@@ -770,7 +770,7 @@ y_write_object_callback (
int
php_yaml_write_impl(
yaml_emitter_t *emitter, zval *data,
- yaml_encoding_t encoding, HashTable *callbacks TSRMLS_DC)
+ yaml_encoding_t encoding, HashTable *callbacks)
{
y_emit_state_t state;
yaml_event_t event;
@@ -780,7 +780,7 @@ php_yaml_write_impl(
/* scan for recursive objects */
ALLOC_HASHTABLE(state.recursive);
zend_hash_init(state.recursive, 8, NULL, NULL, 0);
- y_scan_recursion(&state, data TSRMLS_CC);
+ y_scan_recursion(&state, data);
state.callbacks = callbacks;
@@ -791,7 +791,7 @@ php_yaml_write_impl(
status = FAILURE;
goto cleanup;
}
- if (FAILURE == y_event_emit(&state, &event TSRMLS_CC)) {
+ if (FAILURE == y_event_emit(&state, &event)) {
status = FAILURE;
goto cleanup;
}
@@ -803,13 +803,13 @@ php_yaml_write_impl(
status = FAILURE;
goto cleanup;
}
- if (FAILURE == y_event_emit(&state, &event TSRMLS_CC)) {
+ if (FAILURE == y_event_emit(&state, &event)) {
status = FAILURE;
goto cleanup;
}
/* output data */
- if (FAILURE == y_write_zval(&state, data, NULL TSRMLS_CC)) {
+ if (FAILURE == y_write_zval(&state, data, NULL)) {
status = FAILURE;
goto cleanup;
}
@@ -821,7 +821,7 @@ php_yaml_write_impl(
status = FAILURE;
goto cleanup;
}
- if (FAILURE == y_event_emit(&state, &event TSRMLS_CC)) {
+ if (FAILURE == y_event_emit(&state, &event)) {
status = FAILURE;
goto cleanup;
}
@@ -833,7 +833,7 @@ php_yaml_write_impl(
status = FAILURE;
goto cleanup;
}
- if (FAILURE == y_event_emit(&state, &event TSRMLS_CC)) {
+ if (FAILURE == y_event_emit(&state, &event)) {
status = FAILURE;
goto cleanup;
}
diff --git a/parse.c b/parse.c
index 12832b3..6171f1d 100644
--- a/parse.c
+++ b/parse.c
@@ -46,7 +46,7 @@
#define Y_FILTER_SUCCESS 1
#define Y_FILTER_FAILURE -1
-#define NEXT_EVENT() yaml_next_event(state TSRMLS_CC)
+#define NEXT_EVENT() yaml_next_event(state)
#define COPY_EVENT(dest, state) \
memcpy(&dest, &state->event, sizeof(yaml_event_t)); \
@@ -57,30 +57,30 @@
/* {{{ local prototypes
*/
-static void handle_parser_error(const yaml_parser_t *parser TSRMLS_DC);
+static void handle_parser_error(const yaml_parser_t *parser);
-static inline int yaml_next_event(parser_state_t *state TSRMLS_DC);
+static inline int yaml_next_event(parser_state_t *state);
-void get_next_element( parser_state_t *state, zval *retval TSRMLS_DC);
+void get_next_element( parser_state_t *state, zval *retval);
-void handle_document(parser_state_t *state, zval *retval TSRMLS_DC);
+void handle_document(parser_state_t *state, zval *retval);
-void handle_mapping(parser_state_t *state, zval *retval TSRMLS_DC);
+void handle_mapping(parser_state_t *state, zval *retval);
-void handle_sequence(parser_state_t *state, zval *retval TSRMLS_DC);
+void handle_sequence(parser_state_t *state, zval *retval);
-void handle_scalar(parser_state_t *state, zval *retval TSRMLS_DC);
+void handle_scalar(parser_state_t *state, zval *retval);
-void handle_alias(parser_state_t *state, zval *retval TSRMLS_DC);
+void handle_alias(parser_state_t *state, zval *retval);
static zval *record_anchor_make_ref(zval *aliases, const char *anchor, zval *value);
static int apply_filter(
- zval *zp, yaml_event_t event, HashTable *callbacks TSRMLS_DC);
+ zval *zp, yaml_event_t event, HashTable *callbacks);
-static char *convert_to_char(zval *zv TSRMLS_DC);
+static char *convert_to_char(zval *zv);
-static int eval_timestamp(zval **zpp, const char *ts, size_t ts_len TSRMLS_DC);
+static int eval_timestamp(zval **zpp, const char *ts, size_t ts_len);
/* }}} */
@@ -88,7 +88,7 @@ static int eval_timestamp(zval **zpp, const char *ts, size_t ts_len TSRMLS_DC);
/* {{{ php_yaml_read_all()
* Process events from yaml parser
*/
-void php_yaml_read_all(parser_state_t *state, zend_long *ndocs, zval *retval TSRMLS_DC)
+void php_yaml_read_all(parser_state_t *state, zend_long *ndocs, zval *retval)
{
zval doc;
int code = Y_PARSER_CONTINUE;
@@ -125,7 +125,7 @@ void php_yaml_read_all(parser_state_t *state, zend_long *ndocs, zval *retval TSR
if (YAML_DOCUMENT_START_EVENT != state->event.type) {
code = Y_PARSER_FAILURE;
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"expected DOCUMENT_START event, got %d "
"(line %zd, column %zd)",
state->event.type,
@@ -134,7 +134,7 @@ void php_yaml_read_all(parser_state_t *state, zend_long *ndocs, zval *retval TSR
break;
}
- handle_document(state, &doc TSRMLS_CC);
+ handle_document(state, &doc);
if (Z_TYPE_P(&doc) == IS_UNDEF) {
code = Y_PARSER_FAILURE;
@@ -163,7 +163,7 @@ void php_yaml_read_all(parser_state_t *state, zend_long *ndocs, zval *retval TSR
* Read a particular document from the parser's document stream.
*/
void php_yaml_read_partial(
- parser_state_t *state, zend_long pos, zend_long *ndocs, zval *retval TSRMLS_DC)
+ parser_state_t *state, zend_long pos, zend_long *ndocs, zval *retval)
{
int code = Y_PARSER_CONTINUE;
@@ -175,7 +175,7 @@ void php_yaml_read_partial(
} else if (YAML_STREAM_END_EVENT == state->event.type) {
if (pos != 0) {
/* reached end of stream without finding what we wanted */
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"end of stream reached without finding document %ld",
pos);
code = Y_PARSER_FAILURE;
@@ -186,7 +186,7 @@ void php_yaml_read_partial(
}
} else if (YAML_DOCUMENT_START_EVENT == state->event.type) {
if (*ndocs == pos) {
- handle_document(state, retval TSRMLS_CC);
+ handle_document(state, retval);
if (Z_TYPE_P(retval) == IS_UNDEF) {
code = Y_PARSER_FAILURE;
break;
@@ -215,7 +215,7 @@ void php_yaml_read_partial(
/* {{{ handle_parser_error()
* Emit a warning about a parser error
*/
-static void handle_parser_error(const yaml_parser_t *parser TSRMLS_DC)
+static void handle_parser_error(const yaml_parser_t *parser)
{
const char *error_type;
@@ -244,7 +244,7 @@ static void handle_parser_error(const yaml_parser_t *parser TSRMLS_DC)
if (NULL != parser->problem) {
if (parser->context) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"%s error encountered during parsing: %s "
"(line %zd, column %zd), "
"context %s (line %zd, column %zd)",
@@ -255,7 +255,7 @@ static void handle_parser_error(const yaml_parser_t *parser TSRMLS_DC)
parser->context_mark.line + 1,
parser->context_mark.column + 1);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"%s error encountered during parsing: %s "
"(line %zd, column %zd)",
error_type,
@@ -264,7 +264,7 @@ static void handle_parser_error(const yaml_parser_t *parser TSRMLS_DC)
parser->problem_mark.column + 1);
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"%s error encountred during parsing", error_type);
}
}
@@ -274,7 +274,7 @@ static void handle_parser_error(const yaml_parser_t *parser TSRMLS_DC)
/* {{{ yaml_next_event()
* Load the next parser event
*/
-static inline int yaml_next_event(parser_state_t *state TSRMLS_DC)
+static inline int yaml_next_event(parser_state_t *state)
{
if (state->have_event) {
/* free prior event */
@@ -285,7 +285,7 @@ static inline int yaml_next_event(parser_state_t *state TSRMLS_DC)
if (!yaml_parser_parse(&state->parser, &state->event)) {
/* error encountered parsing input */
state->have_event = 0;
- handle_parser_error(&state->parser TSRMLS_CC);
+ handle_parser_error(&state->parser);
} else {
state->have_event = 1;
@@ -299,7 +299,7 @@ static inline int yaml_next_event(parser_state_t *state TSRMLS_DC)
/* {{{ get_next_element()
* Extract the next whole element from the parse stream
*/
-void get_next_element(parser_state_t *state, zval *retval TSRMLS_DC)
+void get_next_element(parser_state_t *state, zval *retval)
{
if (!NEXT_EVENT()) {
/* check state->event if you need to know the difference between
@@ -318,28 +318,28 @@ void get_next_element(parser_state_t *state, zval *retval TSRMLS_DC)
break;
case YAML_DOCUMENT_START_EVENT:
- handle_document(state, retval TSRMLS_CC);
+ handle_document(state, retval);
break;
case YAML_MAPPING_START_EVENT:
- handle_mapping(state, retval TSRMLS_CC);
+ handle_mapping(state, retval);
break;
case YAML_SEQUENCE_START_EVENT:
- handle_sequence(state, retval TSRMLS_CC);
+ handle_sequence(state, retval);
break;
case YAML_SCALAR_EVENT:
- handle_scalar(state, retval TSRMLS_CC);
+ handle_scalar(state, retval);
break;
case YAML_ALIAS_EVENT:
- handle_alias(state, retval TSRMLS_CC);
+ handle_alias(state, retval);
break;
default:
/* any other event is an error */
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Unexpected event type %d "
"(line %zd, column %zd)",
state->event.type,
@@ -354,13 +354,13 @@ void get_next_element(parser_state_t *state, zval *retval TSRMLS_DC)
/* {{{ handle_document()
* Handle a document event
*/
-void handle_document(parser_state_t *state, zval *retval TSRMLS_DC)
+void handle_document(parser_state_t *state, zval *retval)
{
/* make a new array to hold aliases */
array_init(&state->aliases);
/* document consists of next element */
- get_next_element(state, retval TSRMLS_CC);
+ get_next_element(state, retval);
/* clean up aliases */
zval_ptr_dtor(&state->aliases);
@@ -379,7 +379,7 @@ void handle_document(parser_state_t *state, zval *retval TSRMLS_DC)
/* {{{ handle_mapping()
* Handle a mapping event
*/
-void handle_mapping(parser_state_t *state, zval *retval TSRMLS_DC)
+void handle_mapping(parser_state_t *state, zval *retval)
{
yaml_event_t src_event = { YAML_NO_EVENT }, key_event = { YAML_NO_EVENT };
char *key_str;
@@ -401,8 +401,8 @@ void handle_mapping(parser_state_t *state, zval *retval TSRMLS_DC)
for (get_next_element(state, &key); Z_TYPE_P(&key) != IS_UNDEF; get_next_element(state, &key)) {
COPY_EVENT(key_event, state);
- key_str = convert_to_char(&key TSRMLS_CC);
- get_next_element(state, &value TSRMLS_CC);
+ key_str = convert_to_char(&key);
+ get_next_element(state, &value);
if (Z_TYPE_P(&value) == IS_UNDEF) {
//TODO Sean-Der
@@ -436,7 +436,7 @@ void handle_mapping(parser_state_t *state, zval *retval TSRMLS_DC)
Z_ARRVAL_P(arrval), Z_ARRVAL_P(zvalp),
zval_add_ref, 0);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"expected a mapping for merging, but found scalar "
"(line %zd, column %zd)",
state->parser.mark.line + 1,
@@ -464,7 +464,7 @@ void handle_mapping(parser_state_t *state, zval *retval TSRMLS_DC)
if (NULL != retval && NULL != state->callbacks) {
/* apply callbacks to the collected node */
if (Y_FILTER_FAILURE == apply_filter(
- retval, src_event, state->callbacks TSRMLS_CC)) {
+ retval, src_event, state->callbacks)) {
//TODO Sean-Der
ZVAL_UNDEF(retval);
}
@@ -478,7 +478,7 @@ void handle_mapping(parser_state_t *state, zval *retval TSRMLS_DC)
/* {{{ handle_sequence
* Handle a sequence event
*/
-void handle_sequence (parser_state_t *state, zval *retval TSRMLS_DC) {
+void handle_sequence (parser_state_t *state, zval *retval) {
yaml_event_t src_event = { YAML_NO_EVENT };
zval value = {{0} };
zval *arrval = retval;
@@ -508,7 +508,7 @@ void handle_sequence (parser_state_t *state, zval *retval TSRMLS_DC) {
if (NULL != retval && NULL != state->callbacks) {
/* apply callbacks to the collected node */
if (Y_FILTER_FAILURE == apply_filter(
- retval, src_event, state->callbacks TSRMLS_CC)) {
+ retval, src_event, state->callbacks)) {
//TODO Sean-Der
ZVAL_UNDEF(retval);
//zval_ptr_dtor(&retval);
@@ -524,8 +524,8 @@ void handle_sequence (parser_state_t *state, zval *retval TSRMLS_DC) {
/* {{{ handle_scalar()
* Handle a scalar event
*/
-void handle_scalar(parser_state_t *state, zval *retval TSRMLS_DC) {
- state->eval_func(state->event, state->callbacks, retval TSRMLS_CC);
+void handle_scalar(parser_state_t *state, zval *retval) {
+ state->eval_func(state->event, state->callbacks, retval);
if (NULL != retval && NULL != state->event.data.scalar.anchor) {
record_anchor_make_ref(&state->aliases, (char *) state->event.data.scalar.anchor, retval);
}
@@ -536,13 +536,13 @@ void handle_scalar(parser_state_t *state, zval *retval TSRMLS_DC) {
/* {{{ handle_alias()
* Handle an alias event
*/
-void handle_alias(parser_state_t *state, zval *retval TSRMLS_DC) {
+void handle_alias(parser_state_t *state, zval *retval) {
char *anchor = (char *) state->event.data.alias.anchor;
zend_string *anchor_zstring = zend_string_init(anchor, strlen(anchor), 0);
zval *alias;
if ((alias = zend_hash_find(Z_ARRVAL_P(&state->aliases), anchor_zstring)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"alias %s is not registered "
"(line %zd, column %zd)",
anchor,
@@ -580,7 +580,7 @@ static zval *record_anchor_make_ref(zval *aliases, const char *anchor, zval *val
* Apply user supplied hander to node
*/
static int
-apply_filter(zval *zp, yaml_event_t event, HashTable *callbacks TSRMLS_DC)
+apply_filter(zval *zp, yaml_event_t event, HashTable *callbacks)
{
char *tag = { 0 };
zend_string *tag_zstring;
@@ -625,7 +625,7 @@ apply_filter(zval *zp, yaml_event_t event, HashTable *callbacks TSRMLS_DC)
ZVAL_LONG(&callback_args[2], 0);
/* call the user function */
- callback_result = call_user_function_ex(EG(function_table), NULL, callback, &retval, 3, callback_args, 0, NULL TSRMLS_CC);
+ callback_result = call_user_function_ex(EG(function_table), NULL, callback, &retval, 3, callback_args, 0, NULL);
/* cleanup our temp variables */
zval_ptr_dtor(&callback_args[1]);
@@ -633,7 +633,7 @@ apply_filter(zval *zp, yaml_event_t event, HashTable *callbacks TSRMLS_DC)
zend_string_release(tag_zstring);
if (FAILURE == callback_result || Z_TYPE_P(&retval) == IS_UNDEF) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Failed to apply filter for tag '%s'"
" with user defined function", tag);
return Y_FILTER_FAILURE;
@@ -669,7 +669,7 @@ apply_filter(zval *zp, yaml_event_t event, HashTable *callbacks TSRMLS_DC)
* All YAML scalar types found at http://yaml.org/type/index.html.
*/
void eval_scalar(yaml_event_t event,
- HashTable * callbacks, zval *retval TSRMLS_DC)
+ HashTable * callbacks, zval *retval)
{
char *value = (char *) event.data.scalar.value;
size_t length = event.data.scalar.length;
@@ -743,7 +743,7 @@ void eval_scalar(yaml_event_t event,
if (IS_NOT_IMPLICIT_AND_TAG_IS(event, YAML_TIMESTAMP_TAG) ||
scalar_is_timestamp(value, length)) {
if (FAILURE == eval_timestamp(
- &retval, value, (int) length TSRMLS_CC)) {
+ &retval, value, (int) length)) {
ZVAL_NULL(retval);
}
return;
@@ -756,7 +756,7 @@ void eval_scalar(yaml_event_t event,
data = php_base64_decode((const unsigned char *) value, (int) length);
if (NULL == data) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Failed to decode binary");
ZVAL_NULL(retval);
@@ -777,8 +777,8 @@ void eval_scalar(yaml_event_t event,
PHP_VAR_UNSERIALIZE_INIT(var_hash);
if (!php_var_unserialize(
- retval, &p, p + (int) length, &var_hash TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ retval, &p, p + (int) length, &var_hash)) {
+ php_error_docref(NULL, E_NOTICE,
"Failed to unserialize class");
/* return the serialized string directly */
ZVAL_STRINGL(retval, value, length);
@@ -801,7 +801,7 @@ void eval_scalar(yaml_event_t event,
* filters if available.
*/
void eval_scalar_with_callbacks(yaml_event_t event,
- HashTable *callbacks, zval *retval TSRMLS_DC)
+ HashTable *callbacks, zval *retval)
{
const char *tag = (char *) event.data.scalar.tag;
zend_string *tag_zstring;
@@ -827,8 +827,8 @@ void eval_scalar_with_callbacks(yaml_event_t event,
ZVAL_STRINGL(&argv[1], tag, strlen(tag));
ZVAL_LONG(&argv[2], event.data.scalar.style);
- if (FAILURE == call_user_function_ex(EG(function_table), NULL, callback, retval, 3, argv, 0, NULL TSRMLS_CC) || Z_TYPE_P(retval) == IS_UNDEF) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ if (FAILURE == call_user_function_ex(EG(function_table), NULL, callback, retval, 3, argv, 0, NULL) || Z_TYPE_P(retval) == IS_UNDEF) {
+ php_error_docref(NULL, E_WARNING,
"Failed to evaluate value for tag '%s'"
" with user defined function", tag);
}
@@ -842,7 +842,7 @@ void eval_scalar_with_callbacks(yaml_event_t event,
/* no mapping, so handle raw */
zend_string_release(tag_zstring);
- return eval_scalar(event, NULL, retval TSRMLS_CC);
+ return eval_scalar(event, NULL, retval);
}
/* }}} */
@@ -850,7 +850,7 @@ void eval_scalar_with_callbacks(yaml_event_t event,
/* {{{ convert_to_char()
* Convert a zval to a character array.
*/
-static char *convert_to_char(zval *zv TSRMLS_DC)
+static char *convert_to_char(zval *zv)
{
char *str = { 0 };
@@ -892,7 +892,7 @@ static char *convert_to_char(zval *zv TSRMLS_DC)
{
zval tmp;
- if (SUCCESS == zend_std_cast_object_tostring(zv, &tmp, IS_STRING TSRMLS_CC)) {
+ if (SUCCESS == zend_std_cast_object_tostring(zv, &tmp, IS_STRING)) {
str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp));
zval_dtor(&tmp);
return str;
@@ -906,7 +906,7 @@ static char *convert_to_char(zval *zv TSRMLS_DC)
smart_str buf = {0};
PHP_VAR_SERIALIZE_INIT(var_hash);
- php_var_serialize(&buf, zv, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, zv, &var_hash);
PHP_VAR_SERIALIZE_DESTROY(var_hash);
if (buf.s) {
@@ -920,7 +920,7 @@ static char *convert_to_char(zval *zv TSRMLS_DC)
}
if (NULL == str) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Failed to convert %s to string", zend_zval_type_name(zv));
}
@@ -938,7 +938,7 @@ static char *convert_to_char(zval *zv TSRMLS_DC)
* - yaml.decode_timestamp=2 for date_create parsing
*/
static int
-eval_timestamp(zval **zpp, const char *ts, size_t ts_len TSRMLS_DC)
+eval_timestamp(zval **zpp, const char *ts, size_t ts_len)
{
if (NULL != YAML_G(timestamp_decoder) ||
1L == YAML_G(decode_timestamp) ||
@@ -964,8 +964,8 @@ eval_timestamp(zval **zpp, const char *ts, size_t ts_len TSRMLS_DC)
argv[0] = arg;
if (FAILURE == call_user_function_ex(EG(function_table), NULL, func,
- &retval, 1, argv, 0, NULL TSRMLS_CC) || Z_TYPE_P(&retval) == IS_UNDEF) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ &retval, 1, argv, 0, NULL) || Z_TYPE_P(&retval) == IS_UNDEF) {
+ php_error_docref(NULL, E_WARNING,
"Failed to evaluate string '%s' as timestamp", ts);
zval_ptr_dtor(&arg);
return FAILURE;
diff --git a/php_yaml.h b/php_yaml.h
index 104914a..1f2fbb7 100644
--- a/php_yaml.h
+++ b/php_yaml.h
@@ -40,14 +40,14 @@ extern "C" {
#endif
#ifdef HAVE_CONFIG_H
-# include "config.h"
+#include "config.h"
#endif
#include <php.h>
#include <php_ini.h>
#include <SAPI.h>
#ifdef ZTS
-# include "TSRM.h"
+#include "TSRM.h"
#endif
#include <ext/standard/info.h>
#include <ext/standard/base64.h>
@@ -87,7 +87,7 @@ ZEND_END_MODULE_GLOBALS(yaml)
ZEND_EXTERN_MODULE_GLOBALS(yaml)
#ifdef ZTS
-# define YAML_G(v) TSRMG(yaml_globals_id, zend_yaml_globals *, v)
+#define YAML_G(v) TSRMG(yaml_globals_id, zend_yaml_globals *, v)
#else
# define YAML_G(v) (yaml_globals.v)
#endif
diff --git a/php_yaml_int.h b/php_yaml_int.h
index 76f6efd..9d2a390 100644
--- a/php_yaml_int.h
+++ b/php_yaml_int.h
@@ -56,7 +56,7 @@ extern "C" {
/* {{{ ext/yaml types
*/
-typedef void (*eval_scalar_func_t)(yaml_event_t event, HashTable *callbacks, zval *retval TSRMLS_DC);
+typedef void (*eval_scalar_func_t)(yaml_event_t event, HashTable *callbacks, zval *retval);
typedef struct parser_state_s {
yaml_parser_t parser;
@@ -129,16 +129,16 @@ typedef struct y_emit_state_s {
/* {{{ ext/yaml prototypes
*/
-void php_yaml_read_all(parser_state_t *state, zend_long *ndocs, zval *retval TSRMLS_DC);
+void php_yaml_read_all(parser_state_t *state, zend_long *ndocs, zval *retval);
void php_yaml_read_partial(
- parser_state_t *state, zend_long pos, zend_long *ndocs, zval *retval TSRMLS_DC);
+ parser_state_t *state, zend_long pos, zend_long *ndocs, zval *retval);
void eval_scalar(yaml_event_t event,
- HashTable * callbacks, zval *retval TSRMLS_DC);
+ HashTable * callbacks, zval *retval);
void eval_scalar_with_callbacks(
- yaml_event_t event, HashTable *callbacks, zval *retval TSRMLS_DC);
+ yaml_event_t event, HashTable *callbacks, zval *retval);
const char *detect_scalar_type(
const char *value, size_t length, const yaml_event_t *event);
@@ -155,7 +155,7 @@ int scalar_is_numeric(
int scalar_is_timestamp(const char *value, size_t length);
int php_yaml_write_impl(yaml_emitter_t *emitter, zval *data,
- yaml_encoding_t encoding, HashTable *callbacks TSRMLS_DC);
+ yaml_encoding_t encoding, HashTable *callbacks);
int php_yaml_write_to_buffer(
void *data, unsigned char *buffer, size_t size);
diff --git a/yaml.c b/yaml.c
index 03d4af4..05e3cfb 100644
--- a/yaml.c
+++ b/yaml.c
@@ -37,7 +37,7 @@
/* {{{ local prototypes
*/
-static int php_yaml_check_callbacks(HashTable *callbacks TSRMLS_DC);
+static int php_yaml_check_callbacks(HashTable *callbacks);
static PHP_MINIT_FUNCTION(yaml);
static PHP_MSHUTDOWN_FUNCTION(yaml);
@@ -279,7 +279,7 @@ static PHP_GINIT_FUNCTION(yaml)
/* {{{ php_yaml_check_callbacks()
* Validate user supplied callback array contents
*/
-static int php_yaml_check_callbacks(HashTable *callbacks TSRMLS_DC)
+static int php_yaml_check_callbacks(HashTable *callbacks)
{
zval *entry;
zend_string *key;
@@ -288,15 +288,15 @@ static int php_yaml_check_callbacks(HashTable *callbacks TSRMLS_DC)
if (key) {
zend_string *name;
- if (!ZEND_IS_CALLABLE(entry, 0, &name)) {
+ if (!zend_is_callable(entry, 0, &name)) {
if (name != NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Callback for tag '%s', '%s' is not valid",
key->val, name->val);
efree(name);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Callback for tag '%s' is not valid", key->val);
}
return FAILURE;
@@ -307,7 +307,7 @@ static int php_yaml_check_callbacks(HashTable *callbacks TSRMLS_DC)
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ php_error_docref(NULL, E_NOTICE,
"Callback key should be a string");
}
} ZEND_HASH_FOREACH_END();
@@ -336,7 +336,7 @@ PHP_FUNCTION(yaml_parse)
YAML_G(timestamp_decoder) = NULL;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
"S|lz/a/", &input, &pos, &zndocs,
&zcallbacks)) {
return;
@@ -344,7 +344,7 @@ PHP_FUNCTION(yaml_parse)
if (zcallbacks != NULL) {
state.callbacks = Z_ARRVAL_P(zcallbacks);
- if (FAILURE == php_yaml_check_callbacks(state.callbacks TSRMLS_CC)) {
+ if (FAILURE == php_yaml_check_callbacks(state.callbacks)) {
RETURN_FALSE;
}
@@ -359,9 +359,9 @@ PHP_FUNCTION(yaml_parse)
if (pos < 0) {
- php_yaml_read_all(&state, &ndocs, &yaml TSRMLS_CC);
+ php_yaml_read_all(&state, &ndocs, &yaml);
} else {
- php_yaml_read_partial(&state, pos, &ndocs, &yaml TSRMLS_CC);
+ php_yaml_read_partial(&state, pos, &ndocs, &yaml);
}
yaml_parser_delete(&state.parser);
@@ -404,7 +404,7 @@ PHP_FUNCTION(yaml_parse_file)
YAML_G(timestamp_decoder) = NULL;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
"s|lza/", &filename, &filename_len, &pos, &zndocs,
&zcallbacks)) {
return;
@@ -412,7 +412,7 @@ PHP_FUNCTION(yaml_parse_file)
if (zcallbacks != NULL) {
state.callbacks = Z_ARRVAL_P(zcallbacks);
- if (FAILURE == php_yaml_check_callbacks(state.callbacks TSRMLS_CC)) {
+ if (FAILURE == php_yaml_check_callbacks(state.callbacks)) {
RETURN_FALSE;
}
@@ -438,10 +438,10 @@ PHP_FUNCTION(yaml_parse_file)
yaml_parser_set_input_file(&state.parser, fp);
if (pos < 0) {
- php_yaml_read_all(&state, &ndocs, &yaml TSRMLS_CC);
+ php_yaml_read_all(&state, &ndocs, &yaml);
} else {
- php_yaml_read_partial(&state, pos, &ndocs, &yaml TSRMLS_CC);
+ php_yaml_read_partial(&state, pos, &ndocs, &yaml);
}
yaml_parser_delete(&state.parser);
@@ -486,14 +486,14 @@ PHP_FUNCTION(yaml_parse_url)
YAML_G(timestamp_decoder) = NULL;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
"s|lza/", &url, &url_len, &pos, &zndocs, &zcallbacks)) {
return;
}
if (zcallbacks != NULL) {
state.callbacks = Z_ARRVAL_P(zcallbacks);
- if (FAILURE == php_yaml_check_callbacks(state.callbacks TSRMLS_CC)) {
+ if (FAILURE == php_yaml_check_callbacks(state.callbacks)) {
RETURN_FALSE;
}
@@ -517,9 +517,9 @@ PHP_FUNCTION(yaml_parse_url)
yaml_parser_set_input_string(&state.parser, (unsigned char *)input, size);
if (pos < 0) {
- php_yaml_read_all(&state, &ndocs, &yaml TSRMLS_CC);
+ php_yaml_read_all(&state, &ndocs, &yaml);
} else {
- php_yaml_read_partial(&state, pos, &ndocs, &yaml TSRMLS_CC);
+ php_yaml_read_partial(&state, pos, &ndocs, &yaml);
}
yaml_parser_delete(&state.parser);
@@ -553,14 +553,14 @@ PHP_FUNCTION(yaml_emit)
yaml_emitter_t emitter = { 0 };
smart_string str = { 0 };
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS()TSRMLS_CC, "z/|lla/",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "z/|lla/",
&data, &encoding, &linebreak, &zcallbacks)) {
return;
}
if (zcallbacks != NULL) {
callbacks = Z_ARRVAL_P(zcallbacks);
- if (FAILURE == php_yaml_check_callbacks(callbacks TSRMLS_CC)) {
+ if (FAILURE == php_yaml_check_callbacks(callbacks)) {
RETURN_FALSE;
}
}
@@ -577,7 +577,7 @@ PHP_FUNCTION(yaml_emit)
if (SUCCESS == php_yaml_write_impl(
&emitter, data, (yaml_encoding_t) encoding,
- callbacks TSRMLS_CC)) {
+ callbacks)) {
RETVAL_STRINGL(str.c, str.len);
} else {
@@ -605,14 +605,14 @@ PHP_FUNCTION(yaml_emit_file)
yaml_emitter_t emitter = { 0 };
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz/|lla/",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Sz/|lla/",
&filename, &data, &encoding, &linebreak, &zcallbacks)) {
return;
}
if (zcallbacks != NULL) {
callbacks = Z_ARRVAL_P(zcallbacks);
- if (FAILURE == php_yaml_check_callbacks(callbacks TSRMLS_CC)) {
+ if (FAILURE == php_yaml_check_callbacks(callbacks)) {
RETURN_FALSE;
}
}
@@ -639,7 +639,7 @@ PHP_FUNCTION(yaml_emit_file)
yaml_emitter_set_unicode(&emitter, YAML_ANY_ENCODING != encoding);
RETVAL_BOOL((SUCCESS == php_yaml_write_impl(
- &emitter, data, YAML_ANY_ENCODING, callbacks TSRMLS_CC)));
+ &emitter, data, YAML_ANY_ENCODING, callbacks)));
yaml_emitter_delete(&emitter);
php_stream_close(stream);
--
2.17.2 (Apple Git-113)
|
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 22:00:01 2025 UTC |