We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.
Of course, zend_bool is retained as an alias.
#endif
ZEND_API zend_utility_values zend_uv;
-ZEND_API zend_bool zend_dtrace_enabled;
+ZEND_API bool zend_dtrace_enabled;
/* version information */
static char *zend_version_info;
static zval *(*zend_get_configuration_directive_p)(zend_string *name);
#if ZEND_RC_DEBUG
-ZEND_API zend_bool zend_rc_debug = 0;
+ZEND_API bool zend_rc_debug = 0;
#endif
static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
static ZEND_INI_MH(OnUpdateGCEnabled) /* {{{ */
{
- zend_bool val;
+ bool val;
val = zend_ini_parse_bool(new_value);
gc_enable(val);
static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent);
-static void print_hash(smart_str *buf, HashTable *ht, int indent, zend_bool is_object) /* {{{ */
+static void print_hash(smart_str *buf, HashTable *ht, int indent, bool is_object) /* {{{ */
{
zval *tmp;
zend_string *string_key;
/* }}} */
#ifdef ZTS
-static zend_bool short_tags_default = 1;
+static bool short_tags_default = 1;
static uint32_t compiler_options_default = ZEND_COMPILE_DEFAULT;
#else
# define short_tags_default 1
}
/* }}} */
-static zend_bool php_auto_globals_create_globals(zend_string *name) /* {{{ */
+static bool php_auto_globals_create_globals(zend_string *name) /* {{{ */
{
/* While we keep registering $GLOBALS as an auto-global, we do not create an
* actual variable for it. Access to it handled specially by the compiler. */
zval params[4];
zval retval;
zval orig_user_error_handler;
- zend_bool in_compilation;
+ bool in_compilation;
zend_class_entry *saved_class_entry;
zend_stack loop_var_stack;
zend_stack delayed_oplines_stack;
va_end(va);
} /* }}} */
-ZEND_API ZEND_COLD void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) /* {{{ */
+ZEND_API ZEND_COLD void zend_output_debug_string(bool trigger_break, const char *format, ...) /* {{{ */
{
#if ZEND_DEBUG
va_list args;
} zend_utility_functions;
typedef struct _zend_utility_values {
- zend_bool html_errors;
+ bool html_errors;
} zend_utility_values;
typedef size_t (*zend_write_func_t)(const char *str, size_t str_length);
#define zend_print_variable(var) \
zend_print_zval((var), 0)
-ZEND_API ZEND_COLD void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
+ZEND_API ZEND_COLD void zend_output_debug_string(bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
ZEND_API void zend_activate(void);
ZEND_API void zend_deactivate(void);
extern ZEND_API zend_utility_values zend_uv;
/* If DTrace is available and enabled */
-extern ZEND_API zend_bool zend_dtrace_enabled;
+extern ZEND_API bool zend_dtrace_enabled;
END_EXTERN_C()
#define ZEND_UV(name) (zend_uv.name)
}
/* }}} */
-ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, zend_bool *dest) /* {{{ */
+ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, bool *dest) /* {{{ */
{
if (EXPECTED(Z_TYPE_P(arg) <= IS_STRING)) {
*dest = zend_is_true(arg);
}
/* }}} */
-ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, zend_bool *dest) /* {{{ */
+ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, bool *dest) /* {{{ */
{
if (UNEXPECTED(ZEND_ARG_USES_STRICT_TYPES())) {
return 0;
case 'l':
{
zend_long *p = va_arg(*va, zend_long *);
- zend_bool *is_null = NULL;
+ bool *is_null = NULL;
if (check_null) {
- is_null = va_arg(*va, zend_bool *);
+ is_null = va_arg(*va, bool *);
}
if (!zend_parse_arg_long(arg, p, is_null, check_null)) {
case 'd':
{
double *p = va_arg(*va, double *);
- zend_bool *is_null = NULL;
+ bool *is_null = NULL;
if (check_null) {
- is_null = va_arg(*va, zend_bool *);
+ is_null = va_arg(*va, bool *);
}
if (!zend_parse_arg_double(arg, p, is_null, check_null)) {
case 'b':
{
- zend_bool *p = va_arg(*va, zend_bool *);
- zend_bool *is_null = NULL;
+ bool *p = va_arg(*va, bool *);
+ bool *is_null = NULL;
if (check_null) {
- is_null = va_arg(*va, zend_bool *);
+ is_null = va_arg(*va, bool *);
}
if (!zend_parse_arg_bool(arg, p, is_null, check_null)) {
uint32_t max_num_args = 0;
uint32_t post_varargs = 0;
zval *arg;
- zend_bool have_varargs = 0;
- zend_bool have_optional_args = 0;
+ bool have_varargs = 0;
+ bool have_optional_args = 0;
zval **varargs = NULL;
int *n_varargs = NULL;
* Z_OBJ(EG(This)) to NULL when calling an internal function with common.scope == NULL.
* In that case EG(This) would still be the $this from the calling code and we'd take the
* wrong branch here. */
- zend_bool is_method = EG(current_execute_data)->func->common.scope != NULL;
+ bool is_method = EG(current_execute_data)->func->common.scope != NULL;
if (!is_method || !this_ptr || Z_TYPE_P(this_ptr) != IS_OBJECT) {
va_start(va, type_spec);
}
/* }}} */
-ZEND_API zend_result add_next_index_bool(zval *arg, zend_bool b) /* {{{ */
+ZEND_API zend_result add_next_index_bool(zval *arg, bool b) /* {{{ */
{
zval tmp;
/* }}} */
// TODO num_symbol_tables as unsigned int?
-ZEND_API zend_result zend_set_hash_symbol(zval *symbol, const char *name, size_t name_length, zend_bool is_ref, int num_symbol_tables, ...) /* {{{ */
+ZEND_API zend_result zend_set_hash_symbol(zval *symbol, const char *name, size_t name_length, bool is_ref, int num_symbol_tables, ...) /* {{{ */
{
HashTable *symbol_table;
va_list symbol_table_list;
}
/* }}} */
-ZEND_API zend_bool zend_is_callable_at_frame(
+ZEND_API bool zend_is_callable_at_frame(
zval *callable, zend_object *object, zend_execute_data *frame,
uint32_t check_flags, zend_fcall_info_cache *fcc, char **error) /* {{{ */
{
- zend_bool ret;
+ bool ret;
zend_fcall_info_cache fcc_local;
bool strict_class = 0;
}
/* }}} */
-ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error) /* {{{ */
+ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error) /* {{{ */
{
/* Determine callability at the first parent user frame. */
zend_execute_data *frame = EG(current_execute_data);
frame = frame->prev_execute_data;
}
- zend_bool ret = zend_is_callable_at_frame(callable, object, frame, check_flags, fcc, error);
+ bool ret = zend_is_callable_at_frame(callable, object, frame, check_flags, fcc, error);
if (callable_name) {
*callable_name = zend_get_callable_name_ex(callable, object);
}
return ret;
}
-ZEND_API zend_bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name) /* {{{ */
+ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name) /* {{{ */
{
return zend_is_callable_ex(callable, NULL, check_flags, callable_name, NULL, NULL);
}
/* }}} */
-ZEND_API zend_bool zend_make_callable(zval *callable, zend_string **callable_name) /* {{{ */
+ZEND_API bool zend_make_callable(zval *callable, zend_string **callable_name) /* {{{ */
{
zend_fcall_info_cache fcc;
return Z_STR_P(zv);
}
-static zend_always_inline zend_bool is_persistent_class(zend_class_entry *ce) {
+static zend_always_inline bool is_persistent_class(zend_class_entry *ce) {
return (ce->type & ZEND_INTERNAL_CLASS)
&& ce->info.internal.module->type == MODULE_PERSISTENT;
}
}
/* }}} */
-ZEND_API zend_result zend_try_assign_typed_ref_ex(zend_reference *ref, zval *val, zend_bool strict) /* {{{ */
+ZEND_API zend_result zend_try_assign_typed_ref_ex(zend_reference *ref, zval *val, bool strict) /* {{{ */
{
if (UNEXPECTED(!zend_verify_ref_assignable_zval(ref, val, strict))) {
zval_ptr_dtor(val);
}
/* }}} */
-ZEND_API zend_result zend_try_assign_typed_ref_bool(zend_reference *ref, zend_bool val) /* {{{ */
+ZEND_API zend_result zend_try_assign_typed_ref_bool(zend_reference *ref, bool val) /* {{{ */
{
zval tmp;
}
/* }}} */
-ZEND_API zend_result zend_try_assign_typed_ref_zval_ex(zend_reference *ref, zval *zv, zend_bool strict) /* {{{ */
+ZEND_API zend_result zend_try_assign_typed_ref_zval_ex(zend_reference *ref, zval *zv, bool strict) /* {{{ */
{
zval tmp;
}
/* }}} */
-ZEND_API void zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_bool value) /* {{{ */
+ZEND_API void zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, bool value) /* {{{ */
{
zval constant;
}
/* }}} */
-ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, zend_bool silent, zval *rv) /* {{{ */
+ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, bool silent, zval *rv) /* {{{ */
{
zval *value;
zend_class_entry *old_scope = EG(fake_scope);
}
/* }}} */
-ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_bool silent, zval *rv) /* {{{ */
+ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, bool silent, zval *rv) /* {{{ */
{
zval *value;
zend_string *str;
}
/* }}} */
-ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, zend_bool silent) /* {{{ */
+ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, bool silent) /* {{{ */
{
zval *property;
zend_class_entry *old_scope = EG(fake_scope);
}
/* }}} */
-ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent) /* {{{ */
+ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, bool silent) /* {{{ */
{
zend_string *key = zend_string_init(name, name_length, 0);
zval *property = zend_read_static_property_ex(scope, key, silent);
}
/* }}} */
-ZEND_API zend_bool zend_is_iterable(zval *iterable) /* {{{ */
+ZEND_API bool zend_is_iterable(zval *iterable) /* {{{ */
{
switch (Z_TYPE_P(iterable)) {
case IS_ARRAY:
}
/* }}} */
-ZEND_API zend_bool zend_is_countable(zval *countable) /* {{{ */
+ZEND_API bool zend_is_countable(zval *countable) /* {{{ */
{
switch (Z_TYPE_P(countable)) {
case IS_ARRAY:
ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc);
ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, zend_object *object);
ZEND_API zend_string *zend_get_callable_name(zval *callable);
-ZEND_API zend_bool zend_is_callable_at_frame(
+ZEND_API bool zend_is_callable_at_frame(
zval *callable, zend_object *object, zend_execute_data *frame,
uint32_t check_flags, zend_fcall_info_cache *fcc, char **error);
-ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error);
-ZEND_API zend_bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name);
-ZEND_API zend_bool zend_make_callable(zval *callable, zend_string **callable_name);
+ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error);
+ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name);
+ZEND_API bool zend_make_callable(zval *callable, zend_string **callable_name);
ZEND_API const char *zend_get_module_version(const char *module_name);
ZEND_API int zend_get_module_started(const char *module_name);
ZEND_API void zend_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value);
ZEND_API void zend_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length);
ZEND_API void zend_declare_class_constant_long(zend_class_entry *ce, const char *name, size_t name_length, zend_long value);
-ZEND_API void zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_bool value);
+ZEND_API void zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, bool value);
ZEND_API void zend_declare_class_constant_double(zend_class_entry *ce, const char *name, size_t name_length, double value);
ZEND_API void zend_declare_class_constant_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_length);
ZEND_API void zend_declare_class_constant_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value);
ZEND_API zend_result zend_update_static_property_string(zend_class_entry *scope, const char *name, size_t name_length, const char *value);
ZEND_API zend_result zend_update_static_property_stringl(zend_class_entry *scope, const char *name, size_t name_length, const char *value, size_t value_length);
-ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, zend_bool silent, zval *rv);
-ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_bool silent, zval *rv);
+ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, bool silent, zval *rv);
+ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, bool silent, zval *rv);
-ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, zend_bool silent);
-ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent);
+ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, bool silent);
+ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, bool silent);
ZEND_API const char *zend_get_type_by_const(int type);
ZEND_API zend_result add_next_index_long(zval *arg, zend_long n);
ZEND_API zend_result add_next_index_null(zval *arg);
-ZEND_API zend_result add_next_index_bool(zval *arg, zend_bool b);
+ZEND_API zend_result add_next_index_bool(zval *arg, bool b);
ZEND_API zend_result add_next_index_resource(zval *arg, zend_resource *r);
ZEND_API zend_result add_next_index_double(zval *arg, double d);
ZEND_API zend_result add_next_index_str(zval *arg, zend_string *str);
ZEND_API void zend_call_known_instance_method_with_2_params(
zend_function *fn, zend_object *object, zval *retval_ptr, zval *param1, zval *param2);
-ZEND_API zend_result zend_set_hash_symbol(zval *symbol, const char *name, size_t name_length, zend_bool is_ref, int num_symbol_tables, ...);
+ZEND_API zend_result zend_set_hash_symbol(zval *symbol, const char *name, size_t name_length, bool is_ref, int num_symbol_tables, ...);
ZEND_API zend_result zend_delete_global_variable(zend_string *name);
ZEND_API ZEND_COLD const char *zend_get_object_type(const zend_class_entry *ce);
-ZEND_API zend_bool zend_is_iterable(zval *iterable);
+ZEND_API bool zend_is_iterable(zval *iterable);
-ZEND_API zend_bool zend_is_countable(zval *countable);
+ZEND_API bool zend_is_countable(zval *countable);
ZEND_API zend_result zend_get_default_from_internal_arg_info(
zval *default_value_zval, zend_internal_arg_info *arg_info);
/* May modify arg in-place. Will free arg in failure case (and take ownership in success case).
* Prefer using the ZEND_TRY_ASSIGN_* macros over these APIs. */
-ZEND_API zend_result zend_try_assign_typed_ref_ex(zend_reference *ref, zval *zv, zend_bool strict);
+ZEND_API zend_result zend_try_assign_typed_ref_ex(zend_reference *ref, zval *zv, bool strict);
ZEND_API zend_result zend_try_assign_typed_ref(zend_reference *ref, zval *zv);
ZEND_API zend_result zend_try_assign_typed_ref_null(zend_reference *ref);
-ZEND_API zend_result zend_try_assign_typed_ref_bool(zend_reference *ref, zend_bool val);
+ZEND_API zend_result zend_try_assign_typed_ref_bool(zend_reference *ref, bool val);
ZEND_API zend_result zend_try_assign_typed_ref_long(zend_reference *ref, zend_long lval);
ZEND_API zend_result zend_try_assign_typed_ref_double(zend_reference *ref, double dval);
ZEND_API zend_result zend_try_assign_typed_ref_empty_string(zend_reference *ref);
ZEND_API zend_result zend_try_assign_typed_ref_arr(zend_reference *ref, zend_array *arr);
ZEND_API zend_result zend_try_assign_typed_ref_res(zend_reference *ref, zend_resource *res);
ZEND_API zend_result zend_try_assign_typed_ref_zval(zend_reference *ref, zval *zv);
-ZEND_API zend_result zend_try_assign_typed_ref_zval_ex(zend_reference *ref, zval *zv, zend_bool strict);
+ZEND_API zend_result zend_try_assign_typed_ref_zval_ex(zend_reference *ref, zval *zv, bool strict);
#define _ZEND_TRY_ASSIGN_NULL(zv, is_ref) do { \
zval *_zv = zv; \
zval *_real_arg, *_arg = NULL; \
zend_expected_type _expected_type = Z_EXPECTED_LONG; \
char *_error = NULL; \
- ZEND_ATTRIBUTE_UNUSED zend_bool _dummy; \
- zend_bool _optional = 0; \
+ ZEND_ATTRIBUTE_UNUSED bool _dummy; \
+ bool _optional = 0; \
int _error_code = ZPP_ERROR_OK; \
((void)_i); \
((void)_real_arg); \
/* Inlined implementations shared by new and old parameter parsing APIs */
ZEND_API bool ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pce, uint32_t num, bool check_null);
-ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, zend_bool *dest);
-ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, zend_bool *dest);
+ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, bool *dest);
+ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, bool *dest);
ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_slow(zval *arg, zend_long *dest);
ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(zval *arg, zend_long *dest);
ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(zval *arg, double *dest);
ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest);
ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_or_long_slow(zval *arg, zend_string **dest_str, zend_long *dest_long);
-static zend_always_inline bool zend_parse_arg_bool(zval *arg, zend_bool *dest, zend_bool *is_null, bool check_null)
+static zend_always_inline bool zend_parse_arg_bool(zval *arg, bool *dest, bool *is_null, bool check_null)
{
if (check_null) {
*is_null = 0;
return 1;
}
-static zend_always_inline bool zend_parse_arg_long(zval *arg, zend_long *dest, zend_bool *is_null, bool check_null)
+static zend_always_inline bool zend_parse_arg_long(zval *arg, zend_long *dest, bool *is_null, bool check_null)
{
if (check_null) {
*is_null = 0;
return 1;
}
-static zend_always_inline bool zend_parse_arg_double(zval *arg, double *dest, zend_bool *is_null, bool check_null)
+static zend_always_inline bool zend_parse_arg_double(zval *arg, double *dest, bool *is_null, bool check_null)
{
if (check_null) {
*is_null = 0;
}
static zend_always_inline bool zend_parse_arg_array_ht_or_long(
- zval *arg, HashTable **dest_ht, zend_long *dest_long, zend_bool *is_null, bool allow_null
+ zval *arg, HashTable **dest_ht, zend_long *dest_long, bool *is_null, bool allow_null
) {
if (allow_null) {
*is_null = 0;
}
static zend_always_inline bool zend_parse_arg_obj_or_long(
- zval *arg, zend_object **dest_obj, zend_class_entry *ce, zend_long *dest_long, zend_bool *is_null, bool allow_null
+ zval *arg, zend_object **dest_obj, zend_class_entry *ce, zend_long *dest_long, bool *is_null, bool allow_null
) {
if (allow_null) {
*is_null = 0;
}
static zend_always_inline bool zend_parse_arg_str_or_long(zval *arg, zend_string **dest_str, zend_long *dest_long,
- zend_bool *is_null, bool allow_null)
+ bool *is_null, bool allow_null)
{
if (allow_null) {
*is_null = 0;
return zend_mm_realloc_slow(heap, ptr, size, MIN(old_size, copy_size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
-static zend_always_inline void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, zend_bool use_copy_size, size_t copy_size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+static zend_always_inline void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, bool use_copy_size, size_t copy_size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
size_t page_offset;
size_t old_size;
#if ZEND_MM_CUSTOM
tmp = getenv("USE_ZEND_ALLOC");
if (tmp && !zend_atoi(tmp, 0)) {
- zend_bool tracked = (tmp = getenv("USE_TRACKED_ALLOC")) && zend_atoi(tmp, 0);
+ bool tracked = (tmp = getenv("USE_TRACKED_ALLOC")) && zend_atoi(tmp, 0);
zend_mm_heap *mm_heap = alloc_globals->mm_heap = malloc(sizeof(zend_mm_heap));
memset(mm_heap, 0, sizeof(zend_mm_heap));
mm_heap->use_custom_heap = ZEND_MM_CUSTOM_HEAP_STD;
arena->ptr = (char*)checkpoint;
}
-static zend_always_inline zend_bool zend_arena_contains(zend_arena *arena, void *ptr)
+static zend_always_inline bool zend_arena_contains(zend_arena *arena, void *ptr)
{
while (arena) {
if ((char*)ptr > (char*)arena && (char*)ptr <= arena->ptr) {
}
}
-static zend_always_inline zend_bool zend_arena_contains(zend_arena *arena, void *ptr)
+static zend_always_inline bool zend_arena_contains(zend_arena *arena, void *ptr)
{
/* TODO: Dummy */
return 1;
}
#endif
-static inline zend_bool is_power_of_two(uint32_t n) {
+static inline bool is_power_of_two(uint32_t n) {
return ((n != 0) && (n == (n & (~n + 1))));
}
}
}
-static ZEND_COLD void zend_ast_export_attributes(smart_str *str, zend_ast *ast, int indent, zend_bool newlines) {
+static ZEND_COLD void zend_ast_export_attributes(smart_str *str, zend_ast *ast, int indent, bool newlines) {
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
case ZEND_AST_METHOD:
decl = (zend_ast_decl *) ast;
if (decl->child[4]) {
- zend_bool newlines = !(ast->kind == ZEND_AST_CLOSURE || ast->kind == ZEND_AST_ARROW_FUNC);
+ bool newlines = !(ast->kind == ZEND_AST_CLOSURE || ast->kind == ZEND_AST_ARROW_FUNC);
zend_ast_export_attributes(str, decl->child[4], indent, newlines);
}
typedef void (*zend_ast_apply_func)(zend_ast **ast_ptr);
ZEND_API void zend_ast_apply(zend_ast *ast, zend_ast_apply_func fn);
-static zend_always_inline zend_bool zend_ast_is_special(zend_ast *ast) {
+static zend_always_inline bool zend_ast_is_special(zend_ast *ast) {
return (ast->kind >> ZEND_AST_SPECIAL_SHIFT) & 1;
}
-static zend_always_inline zend_bool zend_ast_is_list(zend_ast *ast) {
+static zend_always_inline bool zend_ast_is_list(zend_ast *ast) {
return (ast->kind >> ZEND_AST_IS_LIST_SHIFT) & 1;
}
static zend_always_inline zend_ast_list *zend_ast_get_list(zend_ast *ast) {
return smart_str_extract(&str);
}
-ZEND_API zend_bool zend_is_attribute_repeated(HashTable *attributes, zend_attribute *attr)
+ZEND_API bool zend_is_attribute_repeated(HashTable *attributes, zend_attribute *attr)
{
zend_attribute *other;
ZEND_API zend_result zend_get_attribute_value(zval *ret, zend_attribute *attr, uint32_t i, zend_class_entry *scope);
ZEND_API zend_string *zend_get_attribute_target_names(uint32_t targets);
-ZEND_API zend_bool zend_is_attribute_repeated(HashTable *attributes, zend_attribute *attr);
+ZEND_API bool zend_is_attribute_repeated(HashTable *attributes, zend_attribute *attr);
ZEND_API zend_internal_attribute *zend_internal_attribute_register(zend_class_entry *ce, uint32_t flags);
ZEND_API zend_internal_attribute *zend_internal_attribute_get(zend_string *lcname);
return (n + ((sizeof(zend_long) * 8) - 1)) / (sizeof(zend_long) * 8);
}
-static inline zend_bool zend_bitset_in(zend_bitset set, uint32_t n)
+static inline bool zend_bitset_in(zend_bitset set, uint32_t n)
{
return ZEND_BIT_TEST(set, n);
}
memset(set, 0xff, len * ZEND_BITSET_ELM_SIZE);
}
-static inline zend_bool zend_bitset_equal(zend_bitset set1, zend_bitset set2, uint32_t len)
+static inline bool zend_bitset_equal(zend_bitset set1, zend_bitset set2, uint32_t len)
{
return memcmp(set1, set2, len * ZEND_BITSET_ELM_SIZE) == 0;
}
}
}
-static inline zend_bool zend_bitset_subset(zend_bitset set1, zend_bitset set2, uint32_t len)
+static inline bool zend_bitset_subset(zend_bitset set1, zend_bitset set2, uint32_t len)
{
uint32_t i;
ZEND_FUNCTION(error_reporting)
{
zend_long err;
- zend_bool err_is_null = 1;
+ bool err_is_null = 1;
int old_error_reporting;
ZEND_PARSE_PARAMETERS_START(0, 1)
{
zend_string *name;
zval *val, val_free;
- zend_bool non_cs = 0;
+ bool non_cs = 0;
zend_constant c;
ZEND_PARSE_PARAMETERS_START(2, 3)
}
/* }}} */
-static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass) /* {{{ */
+static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, bool only_subclass) /* {{{ */
{
zval *obj;
zend_string *class_name;
zend_class_entry *instance_ce;
zend_class_entry *ce;
- zend_bool allow_string = only_subclass;
- zend_bool retval;
+ bool allow_string = only_subclass;
+ bool retval;
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_ZVAL(obj)
array_init_size(return_value, zend_hash_num_elements(properties));
ZEND_HASH_FOREACH_KEY_VAL(properties, num_key, key, value) {
- zend_bool is_dynamic = 1;
+ bool is_dynamic = 1;
if (Z_TYPE_P(value) == IS_INDIRECT) {
value = Z_INDIRECT_P(value);
if (UNEXPECTED(Z_ISUNDEF_P(value))) {
zend_string *name;
zend_string *lcname;
zend_class_entry *ce;
- zend_bool autoload = 1;
+ bool autoload = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STR(name)
ZEND_FUNCTION(function_exists)
{
zend_string *name;
- zend_bool exists;
+ bool exists;
zend_string *lcname;
ZEND_PARSE_PARAMETERS_START(1, 1)
char *alias_name;
zend_class_entry *ce;
size_t alias_name_len;
- zend_bool autoload = 1;
+ bool autoload = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ss|b", &class_name, &alias_name, &alias_name_len, &autoload) == FAILURE) {
RETURN_THROWS();
zval internal, user;
zend_string *key;
zend_function *func;
- zend_bool exclude_disabled = 1;
+ bool exclude_disabled = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &exclude_disabled) == FAILURE) {
RETURN_THROWS();
/* {{{ Return an array containing names of loaded extensions */
ZEND_FUNCTION(get_loaded_extensions)
{
- zend_bool zendext = 0;
+ bool zendext = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &zendext) == FAILURE) {
RETURN_THROWS();
/* {{{ Return an array containing the names and values of all defined constants */
ZEND_FUNCTION(get_defined_constants)
{
- zend_bool categorize = 0;
+ bool categorize = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &categorize) == FAILURE) {
RETURN_THROWS();
}
/* }}} */
-static inline zend_bool skip_internal_handler(zend_execute_data *skip) /* {{{ */
+static inline bool skip_internal_handler(zend_execute_data *skip) /* {{{ */
{
return !(skip->func && ZEND_USER_CODE(skip->func->common.type))
&& skip->prev_execute_data
}
} else {
/* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */
- zend_bool build_filename_arg = 1;
+ bool build_filename_arg = 1;
uint32_t include_kind = 0;
if (ptr->func && ZEND_USER_CODE(ptr->func->common.type) && ptr->opline->opcode == ZEND_INCLUDE_OR_EVAL) {
include_kind = ptr->opline->extended_value;
}
} else {
/* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */
- zend_bool build_filename_arg = 1;
+ bool build_filename_arg = 1;
zend_string *pseudo_function_name;
uint32_t include_kind = 0;
if (ptr->func && ZEND_USER_CODE(ptr->func->common.type) && ptr->opline->opcode == ZEND_INCLUDE_OR_EVAL) {
}
/* }}} */
-static zend_bool zend_valid_closure_binding(
+static bool zend_valid_closure_binding(
zend_closure *closure, zval *newthis, zend_class_entry *scope) /* {{{ */
{
zend_function *func = &closure->func;
- zend_bool is_fake_closure = (func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) != 0;
+ bool is_fake_closure = (func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) != 0;
if (newthis) {
if (func->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(E_WARNING, "Cannot bind an instance to a static closure");
}
/* }}} */
-int zend_closure_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, zend_bool check_only) /* {{{ */
+int zend_closure_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only) /* {{{ */
{
zend_closure *closure = (zend_closure *)obj;
*fptr_ptr = &closure->func;
zval val;
struct _zend_arg_info *arg_info = closure->func.common.arg_info;
HashTable *debug_info;
- zend_bool zstr_args = (closure->func.type == ZEND_USER_FUNCTION) || (closure->func.common.fn_flags & ZEND_ACC_USER_ARG_INFO);
+ bool zstr_args = (closure->func.type == ZEND_USER_FUNCTION) || (closure->func.common.fn_flags & ZEND_ACC_USER_ARG_INFO);
*is_temp = 1;
#endif
static zend_op *zend_emit_op(znode *result, zend_uchar opcode, znode *op1, znode *op2);
-static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast);
+static bool zend_try_ct_eval_array(zval *result, zend_ast *ast);
static void init_op(zend_op *op)
{
}
/* }}} */
-static zend_bool zend_get_unqualified_name(const zend_string *name, const char **result, size_t *result_len) /* {{{ */
+static bool zend_get_unqualified_name(const zend_string *name, const char **result, size_t *result_len) /* {{{ */
{
const char *ns_separator = zend_memrchr(ZSTR_VAL(name), '\\', ZSTR_LEN(name));
if (ns_separator != NULL) {
{NULL, 0}
};
-static zend_bool zend_is_reserved_class_name(const zend_string *name) /* {{{ */
+static bool zend_is_reserved_class_name(const zend_string *name) /* {{{ */
{
const struct reserved_class_name *reserved = reserved_class_names;
}
/* }}} */
-static zend_always_inline zend_bool zend_is_confusable_type(const zend_string *name, const char **correct_name) /* {{{ */
+static zend_always_inline bool zend_is_confusable_type(const zend_string *name, const char **correct_name) /* {{{ */
{
const confusable_type_info *info = confusable_types;
}
/* }}} */
-static zend_bool zend_is_not_imported(zend_string *name) {
+static bool zend_is_not_imported(zend_string *name) {
/* Assuming "name" is unqualified here. */
return !FC(imports) || zend_hash_find_ptr_lc(FC(imports), name) == NULL;
}
}
}
-static zend_bool zend_have_seen_symbol(zend_string *name, uint32_t kind) {
+static bool zend_have_seen_symbol(zend_string *name, uint32_t kind) {
zval *zv = zend_hash_find(&FC(seen_symbols), name);
return zv && (Z_LVAL_P(zv) & kind) != 0;
}
}
/* }}} */
-ZEND_API zend_bool zend_is_compiling(void) /* {{{ */
+ZEND_API bool zend_is_compiling(void) /* {{{ */
{
return CG(in_compilation);
}
}
/* }}} */
-static int zend_add_const_name_literal(zend_string *name, zend_bool unqualified) /* {{{ */
+static int zend_add_const_name_literal(zend_string *name, bool unqualified) /* {{{ */
{
zend_string *tmp_name;
}
static inline void zend_begin_loop(
- zend_uchar free_opcode, const znode *loop_var, zend_bool is_switch) /* {{{ */
+ zend_uchar free_opcode, const znode *loop_var, bool is_switch) /* {{{ */
{
zend_brk_cont_element *brk_cont_element;
int parent = CG(context).current_brk_cont;
}
zend_string *zend_resolve_non_class_name(
- zend_string *name, uint32_t type, zend_bool *is_fully_qualified,
- zend_bool case_sensitive, HashTable *current_import_sub
+ zend_string *name, uint32_t type, bool *is_fully_qualified,
+ bool case_sensitive, HashTable *current_import_sub
) {
char *compound;
*is_fully_qualified = 0;
}
/* }}} */
-zend_string *zend_resolve_function_name(zend_string *name, uint32_t type, zend_bool *is_fully_qualified) /* {{{ */
+zend_string *zend_resolve_function_name(zend_string *name, uint32_t type, bool *is_fully_qualified) /* {{{ */
{
return zend_resolve_non_class_name(
name, type, is_fully_qualified, 0, FC(imports_function));
}
/* }}} */
-zend_string *zend_resolve_const_name(zend_string *name, uint32_t type, zend_bool *is_fully_qualified) /* {{{ */ {
+zend_string *zend_resolve_const_name(zend_string *name, uint32_t type, bool *is_fully_qualified) /* {{{ */ {
return zend_resolve_non_class_name(
name, type, is_fully_qualified, 1, FC(imports_const));
}
}
/* }}} */
-static zend_bool zend_is_call(zend_ast *ast);
+static bool zend_is_call(zend_ast *ast);
static uint32_t zend_add_try_element(uint32_t try_op) /* {{{ */
{
}
/* }}} */
-static zend_never_inline ZEND_COLD ZEND_NORETURN void do_bind_function_error(zend_string *lcname, zend_op_array *op_array, zend_bool compile_time) /* {{{ */
+static zend_never_inline ZEND_COLD ZEND_NORETURN void do_bind_function_error(zend_string *lcname, zend_op_array *op_array, bool compile_time) /* {{{ */
{
zval *zv = zend_hash_find_ex(compile_time ? CG(function_table) : EG(function_table), lcname, 1);
int error_level = compile_time ? E_COMPILE_ERROR : E_ERROR;
}
if (type_mask & MAY_BE_NULL) {
- zend_bool is_union = !str || memchr(ZSTR_VAL(str), '|', ZSTR_LEN(str)) != NULL;
+ bool is_union = !str || memchr(ZSTR_VAL(str), '|', ZSTR_LEN(str)) != NULL;
if (!is_union) {
zend_string *nullable_str = zend_string_concat2("?", 1, ZSTR_VAL(str), ZSTR_LEN(str));
zend_string_release(str);
return zend_type_to_string_resolved(type, NULL);
}
-static zend_bool is_generator_compatible_class_type(zend_string *name) {
+static bool is_generator_compatible_class_type(zend_string *name) {
return zend_string_equals_literal_ci(name, "Traversable")
|| zend_string_equals_literal_ci(name, "Iterator")
|| zend_string_equals_literal_ci(name, "Generator");
if (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
zend_type return_type = CG(active_op_array)->arg_info[-1].type;
- zend_bool valid_type = (ZEND_TYPE_FULL_MASK(return_type) & (MAY_BE_ITERABLE | MAY_BE_OBJECT)) != 0;
+ bool valid_type = (ZEND_TYPE_FULL_MASK(return_type) & (MAY_BE_ITERABLE | MAY_BE_OBJECT)) != 0;
if (!valid_type) {
zend_type *single_type;
ZEND_TYPE_FOREACH(return_type, single_type) {
ZEND_API void zend_do_delayed_early_binding(zend_op_array *op_array, uint32_t first_early_binding_opline) /* {{{ */
{
if (first_early_binding_opline != (uint32_t)-1) {
- zend_bool orig_in_compilation = CG(in_compilation);
+ bool orig_in_compilation = CG(in_compilation);
uint32_t opline_num = first_early_binding_opline;
void **run_time_cache;
}
/* }}} */
-static zend_bool can_ct_eval_const(zend_constant *c) {
+static bool can_ct_eval_const(zend_constant *c) {
if (ZEND_CONSTANT_FLAGS(c) & CONST_DEPRECATED) {
return 0;
}
return 0;
}
-static zend_bool zend_try_ct_eval_const(zval *zv, zend_string *name, zend_bool is_fully_qualified) /* {{{ */
+static bool zend_try_ct_eval_const(zval *zv, zend_string *name, bool is_fully_qualified) /* {{{ */
{
zend_constant *c = zend_hash_find_ptr(EG(zend_constants), name);
if (c && can_ct_eval_const(c)) {
}
/* }}} */
-static inline zend_bool zend_is_scope_known() /* {{{ */
+static inline bool zend_is_scope_known() /* {{{ */
{
if (CG(active_op_array)->fn_flags & ZEND_ACC_CLOSURE) {
/* Closures can be rebound to a different scope */
}
/* }}} */
-static inline zend_bool class_name_refers_to_active_ce(zend_string *class_name, uint32_t fetch_type) /* {{{ */
+static inline bool class_name_refers_to_active_ce(zend_string *class_name, uint32_t fetch_type) /* {{{ */
{
if (!CG(active_class_entry)) {
return 0;
}
/* }}} */
-static zend_bool zend_try_compile_const_expr_resolve_class_name(zval *zv, zend_ast *class_ast) /* {{{ */
+static bool zend_try_compile_const_expr_resolve_class_name(zval *zv, zend_ast *class_ast) /* {{{ */
{
uint32_t fetch_type;
zval *class_name;
/* }}} */
/* We don't use zend_verify_const_access because we need to deal with unlinked classes. */
-static zend_bool zend_verify_ct_const_access(zend_class_constant *c, zend_class_entry *scope)
+static bool zend_verify_ct_const_access(zend_class_constant *c, zend_class_entry *scope)
{
if (Z_ACCESS_FLAGS(c->value) & ZEND_ACC_PUBLIC) {
return 1;
}
}
-static zend_bool zend_try_ct_eval_class_const(zval *zv, zend_string *class_name, zend_string *name) /* {{{ */
+static bool zend_try_ct_eval_class_const(zval *zv, zend_string *class_name, zend_string *name) /* {{{ */
{
uint32_t fetch_type = zend_get_class_fetch_type(class_name);
zend_class_constant *cc;
}
/* }}} */
-zend_bool zend_is_auto_global_str(const char *name, size_t len) /* {{{ */ {
+bool zend_is_auto_global_str(const char *name, size_t len) /* {{{ */ {
zend_auto_global *auto_global;
if ((auto_global = zend_hash_str_find_ptr(CG(auto_globals), name, len)) != NULL) {
}
/* }}} */
-zend_bool zend_is_auto_global(zend_string *name) /* {{{ */
+bool zend_is_auto_global(zend_string *name) /* {{{ */
{
zend_auto_global *auto_global;
}
/* }}} */
-zend_result zend_register_auto_global(zend_string *name, zend_bool jit, zend_auto_global_callback auto_global_callback) /* {{{ */
+zend_result zend_register_auto_global(zend_string *name, bool jit, zend_auto_global_callback auto_global_callback) /* {{{ */
{
zend_auto_global auto_global;
zend_result retval;
}
/* }}} */
-ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers) /* {{{ */
+ZEND_API void zend_initialize_class_data(zend_class_entry *ce, bool nullify_handlers) /* {{{ */
{
- zend_bool persistent_hashes = ce->type == ZEND_INTERNAL_CLASS;
+ bool persistent_hashes = ce->type == ZEND_INTERNAL_CLASS;
ce->refcount = 1;
ce->ce_flags = ZEND_ACC_CONSTANTS_UPDATED;
}
/* }}} */
-static zend_bool zend_ast_kind_is_short_circuited(zend_ast_kind ast_kind)
+static bool zend_ast_kind_is_short_circuited(zend_ast_kind ast_kind)
{
switch (ast_kind) {
case ZEND_AST_DIM:
}
}
-static zend_bool zend_ast_is_short_circuited(const zend_ast *ast)
+static bool zend_ast_is_short_circuited(const zend_ast *ast)
{
switch (ast->kind) {
case ZEND_AST_DIM:
static void zend_short_circuiting_commit(uint32_t checkpoint, znode *result, zend_ast *ast)
{
- zend_bool is_short_circuited = zend_ast_kind_is_short_circuited(ast->kind)
+ bool is_short_circuited = zend_ast_kind_is_short_circuited(ast->kind)
|| ast->kind == ZEND_AST_ISSET || ast->kind == ZEND_AST_EMPTY;
if (!is_short_circuited) {
ZEND_ASSERT(zend_stack_count(&CG(short_circuiting_opnums)) == checkpoint
}
static void zend_emit_return_type_check(
- znode *expr, zend_arg_info *return_info, zend_bool implicit) /* {{{ */
+ znode *expr, zend_arg_info *return_info, bool implicit) /* {{{ */
{
zend_type type = return_info->type;
if (ZEND_TYPE_IS_SET(type)) {
{
znode zn;
zend_op *ret;
- zend_bool returns_reference = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
+ bool returns_reference = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
if ((CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE)
&& !(CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR)) {
}
/* }}} */
-static inline zend_bool zend_is_variable(zend_ast *ast) /* {{{ */
+static inline bool zend_is_variable(zend_ast *ast) /* {{{ */
{
return ast->kind == ZEND_AST_VAR
|| ast->kind == ZEND_AST_DIM
}
/* }}} */
-static inline zend_bool zend_is_call(zend_ast *ast) /* {{{ */
+static inline bool zend_is_call(zend_ast *ast) /* {{{ */
{
return ast->kind == ZEND_AST_CALL
|| ast->kind == ZEND_AST_METHOD_CALL
}
/* }}} */
-static inline zend_bool zend_is_variable_or_call(zend_ast *ast) /* {{{ */
+static inline bool zend_is_variable_or_call(zend_ast *ast) /* {{{ */
{
return zend_is_variable(ast) || zend_is_call(ast);
}
/* }}} */
-static inline zend_bool zend_is_unticked_stmt(zend_ast *ast) /* {{{ */
+static inline bool zend_is_unticked_stmt(zend_ast *ast) /* {{{ */
{
return ast->kind == ZEND_AST_STMT_LIST || ast->kind == ZEND_AST_LABEL
|| ast->kind == ZEND_AST_PROP_DECL || ast->kind == ZEND_AST_CLASS_CONST_GROUP
}
/* }}} */
-static inline zend_bool zend_can_write_to_variable(zend_ast *ast) /* {{{ */
+static inline bool zend_can_write_to_variable(zend_ast *ast) /* {{{ */
{
while (
ast->kind == ZEND_AST_DIM
}
/* }}} */
-static inline zend_bool zend_is_const_default_class_ref(zend_ast *name_ast) /* {{{ */
+static inline bool zend_is_const_default_class_ref(zend_ast *name_ast) /* {{{ */
{
if (name_ast->kind != ZEND_AST_ZVAL) {
return 0;
}
/* }}} */
-static zend_bool is_this_fetch(zend_ast *ast) /* {{{ */
+static bool is_this_fetch(zend_ast *ast) /* {{{ */
{
if (ast->kind == ZEND_AST_VAR && ast->child[0]->kind == ZEND_AST_ZVAL) {
zval *name = zend_ast_get_zval(ast->child[0]);
return ast->kind == ZEND_AST_DIM && is_globals_fetch(ast->child[0]);
}
-static zend_bool this_guaranteed_exists() /* {{{ */
+static bool this_guaranteed_exists() /* {{{ */
{
zend_op_array *op_array = CG(active_op_array);
/* Instance methods always have a $this.
}
/* }}} */
-zend_op *zend_delayed_compile_var(znode *result, zend_ast *ast, uint32_t type, zend_bool by_ref);
+zend_op *zend_delayed_compile_var(znode *result, zend_ast *ast, uint32_t type, bool by_ref);
void zend_compile_assign(znode *result, zend_ast *ast);
static inline void zend_emit_assign_znode(zend_ast *var_ast, znode *value_node) /* {{{ */
znode obj_node, prop_node;
zend_op *opline;
- zend_bool nullsafe = ast->kind == ZEND_AST_NULLSAFE_PROP;
+ bool nullsafe = ast->kind == ZEND_AST_NULLSAFE_PROP;
if (is_this_fetch(obj_ast)) {
if (this_guaranteed_exists()) {
static inline void zend_emit_assign_ref_znode(zend_ast *var_ast, znode *value_node);
/* Propagate refs used on leaf elements to the surrounding list() structures. */
-static zend_bool zend_propagate_list_refs(zend_ast *ast) { /* {{{ */
+static bool zend_propagate_list_refs(zend_ast *ast) { /* {{{ */
zend_ast_list *list = zend_ast_get_list(ast);
- zend_bool has_refs = 0;
+ bool has_refs = 0;
uint32_t i;
for (i = 0; i < list->children; ++i) {
{
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
- zend_bool has_elems = 0;
- zend_bool is_keyed =
+ bool has_elems = 0;
+ bool is_keyed =
list->children > 0 && list->child[0] != NULL && list->child[0]->child[1] != NULL;
if (list->children && expr_node->op_type == IS_CONST && Z_TYPE(expr_node->u.constant) == IS_STRING) {
/* }}} */
/* Detects $a... = $a pattern */
-zend_bool zend_is_assign_to_self(zend_ast *var_ast, zend_ast *expr_ast) /* {{{ */
+bool zend_is_assign_to_self(zend_ast *var_ast, zend_ast *expr_ast) /* {{{ */
{
if (expr_ast->kind != ZEND_AST_VAR || expr_ast->child[0]->kind != ZEND_AST_ZVAL) {
return 0;
{
zend_string *name1 = zval_get_string(zend_ast_get_zval(var_ast->child[0]));
zend_string *name2 = zval_get_string(zend_ast_get_zval(expr_ast->child[0]));
- zend_bool result = zend_string_equals(name1, name2);
+ bool result = zend_string_equals(name1, name2);
zend_string_release_ex(name1, 0);
zend_string_release_ex(name2, 0);
return result;
{
zend_ast_list *args = zend_ast_get_list(ast);
uint32_t i;
- zend_bool uses_arg_unpack = 0;
+ bool uses_arg_unpack = 0;
uint32_t arg_count = 0; /* number of arguments not including unpacks */
/* Whether named arguments are used syntactically, to enforce language level limitations.
* May not actually use named argument passing. */
- zend_bool uses_named_args = 0;
+ bool uses_named_args = 0;
/* Whether there may be any undef arguments due to the use of named arguments. */
- zend_bool may_have_undef = 0;
+ bool may_have_undef = 0;
/* Whether there may be any extra named arguments collected into a variadic. */
*may_have_extra_named_args = 0;
}
/* }}} */
-zend_bool zend_compile_function_name(znode *name_node, zend_ast *name_ast) /* {{{ */
+bool zend_compile_function_name(znode *name_node, zend_ast *name_ast) /* {{{ */
{
zend_string *orig_name = zend_ast_get_str(name_ast);
- zend_bool is_fully_qualified;
+ bool is_fully_qualified;
name_node->op_type = IS_CONST;
ZVAL_STR(&name_node->u.constant, zend_resolve_function_name(
}
/* }}} */
-static inline zend_bool zend_args_contain_unpack_or_named(zend_ast_list *args) /* {{{ */
+static inline bool zend_args_contain_unpack_or_named(zend_ast_list *args) /* {{{ */
{
uint32_t i;
for (i = 0; i < args->children; ++i) {
/* We can only calculate the stack size for functions that have been fully compiled, otherwise
* additional CV or TMP slots may still be added. This prevents the use of INIT_FCALL for
* directly or indirectly recursive function calls. */
-static zend_bool fbc_is_finalized(zend_function *fbc) {
+static bool fbc_is_finalized(zend_function *fbc) {
return !ZEND_USER_CODE(fbc->type) || (fbc->common.fn_flags & ZEND_ACC_DONE_PASS_TWO);
}
&& args->child[1]->child[1]->kind == ZEND_AST_ARG_LIST) {
zend_string *orig_name = zend_ast_get_str(args->child[1]->child[0]);
zend_ast_list *list = zend_ast_get_list(args->child[1]->child[1]);
- zend_bool is_fully_qualified;
+ bool is_fully_qualified;
zend_string *name = zend_resolve_function_name(orig_name, args->child[1]->child[0]->attr, &is_fully_qualified);
if (zend_string_equals_literal_ci(name, "array_slice")
static zend_result zend_compile_func_in_array(znode *result, zend_ast_list *args) /* {{{ */
{
- zend_bool strict = 0;
+ bool strict = 0;
znode array, needly;
zend_op *opline;
} else if (args->child[2]->kind == ZEND_AST_CONST) {
zval value;
zend_ast *name_ast = args->child[2]->child[0];
- zend_bool is_fully_qualified;
+ bool is_fully_qualified;
zend_string *resolved_name = zend_resolve_const_name(
zend_ast_get_str(name_ast), name_ast->attr, &is_fully_qualified);
}
if (zend_hash_num_elements(Z_ARRVAL(array.u.constant)) > 0) {
- zend_bool ok = 1;
+ bool ok = 1;
zval *val, tmp;
HashTable *src = Z_ARRVAL(array.u.constant);
HashTable *dst = zend_new_array(zend_hash_num_elements(src));
&& args->child[1]->kind == ZEND_AST_ZVAL) {
zend_string *orig_name = zend_ast_get_str(args->child[0]->child[0]);
- zend_bool is_fully_qualified;
+ bool is_fully_qualified;
zend_string *name = zend_resolve_function_name(orig_name, args->child[0]->child[0]->attr, &is_fully_qualified);
zend_ast_list *list = zend_ast_get_list(args->child[0]->child[1]);
zval *zv = zend_ast_get_zval(args->child[1]);
}
{
- zend_bool runtime_resolution = zend_compile_function_name(&name_node, name_ast);
+ bool runtime_resolution = zend_compile_function_name(&name_node, name_ast);
if (runtime_resolution) {
if (zend_string_equals_literal_ci(zend_ast_get_str(name_ast), "assert")) {
zend_compile_assert(result, zend_ast_get_list(args_ast), Z_STR(name_node.u.constant), NULL);
znode obj_node, method_node;
zend_op *opline;
zend_function *fbc = NULL;
- zend_bool nullsafe = ast->kind == ZEND_AST_NULLSAFE_METHOD_CALL;
+ bool nullsafe = ast->kind == ZEND_AST_NULLSAFE_METHOD_CALL;
if (is_this_fetch(obj_ast)) {
if (this_guaranteed_exists()) {
}
/* }}} */
-static zend_bool zend_is_constructor(zend_string *name) /* {{{ */
+static bool zend_is_constructor(zend_string *name) /* {{{ */
{
return zend_string_equals_literal_ci(name, ZEND_CONSTRUCTOR_FUNC_NAME);
}
}
/* }}} */
-void zend_compile_class_decl(znode *result, zend_ast *ast, zend_bool toplevel);
+void zend_compile_class_decl(znode *result, zend_ast *ast, bool toplevel);
void zend_compile_new(znode *result, zend_ast *ast) /* {{{ */
{
void zend_compile_return(zend_ast *ast) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
- zend_bool is_generator = (CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0;
- zend_bool by_ref = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
+ bool is_generator = (CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0;
+ bool by_ref = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
znode expr_node;
zend_op *opline;
zend_ast *value_ast = ast->child[1];
zend_ast *key_ast = ast->child[2];
zend_ast *stmt_ast = ast->child[3];
- zend_bool by_ref = value_ast->kind == ZEND_AST_REF;
- zend_bool is_variable = zend_is_variable(expr_ast) && zend_can_write_to_variable(expr_ast);
+ bool by_ref = value_ast->kind == ZEND_AST_REF;
+ bool is_variable = zend_is_variable(expr_ast) && zend_can_write_to_variable(expr_ast);
znode expr_node, reset_node, value_node, key_node;
zend_op *opline;
return common_type;
}
-static zend_bool should_use_jumptable(zend_ast_list *cases, zend_uchar jumptable_type) {
+static bool should_use_jumptable(zend_ast_list *cases, zend_uchar jumptable_type) {
if (CG(compiler_options) & ZEND_COMPILE_NO_JUMPTABLES) {
return 0;
}
zend_ast_list *cases = zend_ast_get_list(ast->child[1]);
uint32_t i;
- zend_bool has_default_case = 0;
+ bool has_default_case = 0;
znode expr_node, case_node;
zend_op *opline;
return num_conds;
}
-static zend_bool can_match_use_jumptable(zend_ast_list *arms) {
+static bool can_match_use_jumptable(zend_ast_list *arms) {
for (uint32_t i = 0; i < arms->children; i++) {
zend_ast *arm_ast = arms->child[i];
if (!arm_ast->child[0]) {
{
zend_ast *expr_ast = ast->child[0];
zend_ast_list *arms = zend_ast_get_list(ast->child[1]);
- zend_bool has_default_arm = 0;
+ bool has_default_arm = 0;
uint32_t opnum_match = (uint32_t)-1;
znode expr_node;
uint32_t num_conds = count_match_conds(arms);
zend_uchar can_use_jumptable = can_match_use_jumptable(arms);
- zend_bool uses_jumptable = can_use_jumptable && num_conds >= 2;
+ bool uses_jumptable = can_use_jumptable && num_conds >= 2;
HashTable *jumptable = NULL;
uint32_t *jmpnz_opnums = NULL;
opnum_default_jmp = zend_emit_jump(0);
}
- zend_bool is_first_case = 1;
+ bool is_first_case = 1;
uint32_t cond_count = 0;
uint32_t *jmp_end_opnums = safe_emalloc(sizeof(uint32_t), arms->children, 0);
zend_ast *var_ast = catch_ast->child[1];
zend_ast *stmt_ast = catch_ast->child[2];
zend_string *var_name = var_ast ? zval_make_interned_string(zend_ast_get_zval(var_ast)) : NULL;
- zend_bool is_last_catch = (i + 1 == catches->children);
+ bool is_last_catch = (i + 1 == catches->children);
uint32_t *jmp_multicatch = safe_emalloc(sizeof(uint32_t), classes->children - 1, 0);
uint32_t opnum_catch = (uint32_t)-1;
for (j = 0; j < classes->children; j++) {
zend_ast *class_ast = classes->child[j];
- zend_bool is_last_class = (j + 1 == classes->children);
+ bool is_last_class = (j + 1 == classes->children);
if (!zend_is_const_default_class_ref(class_ast)) {
zend_error_noreturn(E_COMPILE_ERROR, "Bad class name in the catch statement");
/* }}} */
/* Encoding declarations must already be handled during parsing */
-zend_bool zend_handle_encoding_declaration(zend_ast *ast) /* {{{ */
+bool zend_handle_encoding_declaration(zend_ast *ast) /* {{{ */
{
zend_ast_list *declares = zend_ast_get_list(ast);
uint32_t i;
/* }}} */
/* Check whether this is the first statement, not counting declares. */
-static zend_result zend_is_first_statement(zend_ast *ast, zend_bool allow_nop) /* {{{ */
+static zend_result zend_is_first_statement(zend_ast *ast, bool allow_nop) /* {{{ */
{
uint32_t i = 0;
zend_ast_list *file_ast = zend_ast_get_list(CG(ast));
}
}
-static zend_bool zend_type_contains_traversable(zend_type type) {
+static bool zend_type_contains_traversable(zend_type type) {
zend_type *single_type;
ZEND_TYPE_FOREACH(type, single_type) {
if (ZEND_TYPE_HAS_NAME(*single_type)
// TODO: Ideally we'd canonicalize "iterable" into "array|Traversable" and essentially
// treat it as a built-in type alias.
static zend_type zend_compile_typename(
- zend_ast *ast, zend_bool force_allow_null) /* {{{ */
+ zend_ast *ast, bool force_allow_null) /* {{{ */
{
- zend_bool allow_null = force_allow_null;
+ bool allow_null = force_allow_null;
zend_ast_attr orig_ast_attr = ast->attr;
zend_type type = ZEND_TYPE_INIT_NONE(0);
if (ast->attr & ZEND_TYPE_NULLABLE) {
/* }}} */
/* May convert value from int to float. */
-static zend_bool zend_is_valid_default_value(zend_type type, zval *value)
+static bool zend_is_valid_default_value(zend_type type, zval *value)
{
ZEND_ASSERT(ZEND_TYPE_IS_SET(type));
if (ZEND_TYPE_CONTAINS_CODE(type, Z_TYPE_P(value))) {
if (args) {
ZEND_ASSERT(args->kind == ZEND_AST_ARG_LIST);
- zend_bool uses_named_args = 0;
+ bool uses_named_args = 0;
for (j = 0; j < args->children; j++) {
zend_ast **arg_ast_ptr = &args->child[j];
zend_ast *arg_ast = *arg_ast_ptr;
zend_ast *attributes_ast = param_ast->child[3];
zend_ast *doc_comment_ast = param_ast->child[4];
zend_string *name = zval_make_interned_string(zend_ast_get_zval(var_ast));
- zend_bool is_ref = (param_ast->attr & ZEND_PARAM_REF) != 0;
- zend_bool is_variadic = (param_ast->attr & ZEND_PARAM_VARIADIC) != 0;
+ bool is_ref = (param_ast->attr & ZEND_PARAM_REF) != 0;
+ bool is_variadic = (param_ast->attr & ZEND_PARAM_VARIADIC) != 0;
uint32_t visibility =
param_ast->attr & (ZEND_ACC_PUBLIC|ZEND_ACC_PROTECTED|ZEND_ACC_PRIVATE);
if (!optional_param) {
/* Ignore parameters of the form "Type $param = null".
* This is the PHP 5 style way of writing "?Type $param", so allow it for now. */
- zend_bool is_implicit_nullable =
+ bool is_implicit_nullable =
type_ast && Z_TYPE(default_node.u.constant) == IS_NULL;
if (!is_implicit_nullable) {
optional_param = name;
if (type_ast) {
uint32_t default_type = *default_ast_ptr ? Z_TYPE(default_node.u.constant) : IS_UNDEF;
- zend_bool force_nullable = default_type == IS_NULL && !visibility;
+ bool force_nullable = default_type == IS_NULL && !visibility;
op_array->fn_flags |= ZEND_ACC_HAS_TYPE_HINTS;
arg_info->type = zend_compile_typename(type_ast, force_nullable);
if (visibility) {
zend_op_array *op_array = CG(active_op_array);
zend_class_entry *scope = op_array->scope;
- zend_bool is_ctor =
+ bool is_ctor =
scope && zend_is_constructor(op_array->function_name);
if (!is_ctor) {
zend_error_noreturn(E_COMPILE_ERROR,
for (i = 0; i < list->children; i++) {
zend_ast *param_ast = list->child[i];
- zend_bool is_ref = (param_ast->attr & ZEND_PARAM_REF) != 0;
+ bool is_ref = (param_ast->attr & ZEND_PARAM_REF) != 0;
uint32_t visibility =
param_ast->attr & (ZEND_ACC_PUBLIC|ZEND_ACC_PROTECTED|ZEND_ACC_PRIVATE);
if (!visibility) {
typedef struct {
HashTable uses;
- zend_bool varvars_used;
+ bool varvars_used;
} closure_info;
static void find_implicit_binds_recursively(closure_info *info, zend_ast *ast) {
zend_string_init("stringable", sizeof("stringable") - 1, 0);
}
-zend_string *zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_bool has_body) /* {{{ */
+zend_string *zend_begin_method_decl(zend_op_array *op_array, zend_string *name, bool has_body) /* {{{ */
{
zend_class_entry *ce = CG(active_class_entry);
- zend_bool in_interface = (ce->ce_flags & ZEND_ACC_INTERFACE) != 0;
+ bool in_interface = (ce->ce_flags & ZEND_ACC_INTERFACE) != 0;
uint32_t fn_flags = op_array->fn_flags;
zend_string *lcname;
}
/* }}} */
-static void zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_ast_decl *decl, zend_bool toplevel) /* {{{ */
+static void zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_ast_decl *decl, bool toplevel) /* {{{ */
{
zend_string *unqualified_name, *name, *lcname, *key;
zend_op *opline;
}
/* }}} */
-void zend_compile_func_decl(znode *result, zend_ast *ast, zend_bool toplevel) /* {{{ */
+void zend_compile_func_decl(znode *result, zend_ast *ast, bool toplevel) /* {{{ */
{
zend_ast_decl *decl = (zend_ast_decl *) ast;
zend_ast *params_ast = decl->child[0];
zend_ast *uses_ast = decl->child[1];
zend_ast *stmt_ast = decl->child[2];
zend_ast *return_type_ast = decl->child[3];
- zend_bool is_method = decl->kind == ZEND_AST_METHOD;
+ bool is_method = decl->kind == ZEND_AST_METHOD;
zend_string *method_lcname;
zend_class_entry *orig_class_entry = CG(active_class_entry);
}
if (is_method) {
- zend_bool has_body = stmt_ast != NULL;
+ bool has_body = stmt_ast != NULL;
method_lcname = zend_begin_method_decl(op_array, decl->name, has_body);
} else {
zend_begin_func_decl(result, op_array, decl, toplevel);
return zend_new_interned_string(result);
}
-void zend_compile_class_decl(znode *result, zend_ast *ast, zend_bool toplevel) /* {{{ */
+void zend_compile_class_decl(znode *result, zend_ast *ast, bool toplevel) /* {{{ */
{
zend_ast_decl *decl = (zend_ast_decl *) ast;
zend_ast *extends_ast = decl->child[0];
zend_string *current_ns = FC(current_namespace);
uint32_t type = ast->attr;
HashTable *current_import = zend_get_import_ht(type);
- zend_bool case_sensitive = type == ZEND_SYMBOL_CONST;
+ bool case_sensitive = type == ZEND_SYMBOL_CONST;
for (i = 0; i < list->children; ++i) {
zend_ast *use_ast = list->child[i];
zend_ast *name_ast = ast->child[0];
zend_ast *stmt_ast = ast->child[1];
zend_string *name;
- zend_bool with_bracket = stmt_ast != NULL;
+ bool with_bracket = stmt_ast != NULL;
/* handle mixed syntax declaration or nested namespaces */
if (!FC(has_bracketed_namespaces)) {
}
}
- zend_bool is_first_namespace = (!with_bracket && !FC(current_namespace))
+ bool is_first_namespace = (!with_bracket && !FC(current_namespace))
|| (with_bracket && !FC(has_bracketed_namespaces));
if (is_first_namespace && FAILURE == zend_is_first_statement(ast, /* allow_nop */ 1)) {
zend_error_noreturn(E_COMPILE_ERROR, "Namespace declaration statement has to be "
}
/* }}} */
-static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast) /* {{{ */
+static bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast) /* {{{ */
{
zend_op_array *op_array = CG(active_op_array);
zend_class_entry *ce = CG(active_class_entry);
}
/* }}} */
-ZEND_API zend_bool zend_binary_op_produces_error(uint32_t opcode, zval *op1, zval *op2) /* {{{ */
+ZEND_API bool zend_binary_op_produces_error(uint32_t opcode, zval *op1, zval *op2) /* {{{ */
{
if ((opcode == ZEND_CONCAT || opcode == ZEND_FAST_CONCAT)) {
/* Array to string warning. */
}
/* }}} */
-static inline zend_bool zend_try_ct_eval_binary_op(zval *result, uint32_t opcode, zval *op1, zval *op2) /* {{{ */
+static inline bool zend_try_ct_eval_binary_op(zval *result, uint32_t opcode, zval *op1, zval *op2) /* {{{ */
{
if (zend_binary_op_produces_error(opcode, op1, op2)) {
return 0;
}
/* }}} */
-zend_bool zend_unary_op_produces_error(uint32_t opcode, zval *op)
+bool zend_unary_op_produces_error(uint32_t opcode, zval *op)
{
if (opcode == ZEND_BW_NOT) {
return Z_TYPE_P(op) <= IS_TRUE || Z_TYPE_P(op) == IS_ARRAY;
return 0;
}
-static inline zend_bool zend_try_ct_eval_unary_op(zval *result, uint32_t opcode, zval *op) /* {{{ */
+static inline bool zend_try_ct_eval_unary_op(zval *result, uint32_t opcode, zval *op) /* {{{ */
{
if (zend_unary_op_produces_error(opcode, op)) {
return 0;
}
/* }}} */
-static inline zend_bool zend_try_ct_eval_unary_pm(zval *result, zend_ast_kind kind, zval *op) /* {{{ */
+static inline bool zend_try_ct_eval_unary_pm(zval *result, zend_ast_kind kind, zval *op) /* {{{ */
{
zval right;
ZVAL_LONG(&right, (kind == ZEND_AST_UNARY_PLUS) ? 1 : -1);
}
/* }}} */
-static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
+static bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
zend_ast *last_elem_ast = NULL;
uint32_t i;
- zend_bool is_constant = 1;
+ bool is_constant = 1;
if (ast->attr == ZEND_ARRAY_SYNTAX_LIST) {
zend_error(E_COMPILE_ERROR, "Cannot use list() as standalone expression");
znode var_node_is, var_node_w, default_node, assign_node, *node;
zend_op *opline;
uint32_t coalesce_opnum;
- zend_bool need_frees = 0;
+ bool need_frees = 0;
/* Remember expressions compiled during the initial BP_VAR_IS lookup,
* to avoid double-evaluation when we compile again with BP_VAR_W. */
znode value_node, key_node;
znode *value_node_ptr = NULL, *key_node_ptr = NULL;
zend_op *opline;
- zend_bool returns_by_ref = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
+ bool returns_by_ref = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
zend_mark_function_as_generator();
zend_ast_list *list = zend_ast_get_list(ast);
zend_op *opline;
uint32_t i, opnum_init = -1;
- zend_bool packed = 1;
+ bool packed = 1;
if (zend_try_ct_eval_array(&result->u.constant, ast)) {
result->op_type = IS_CONST;
for (i = 0; i < list->children; ++i) {
zend_ast *elem_ast = list->child[i];
zend_ast *value_ast, *key_ast;
- zend_bool by_ref;
+ bool by_ref;
znode value_node, key_node, *key_node_ptr = NULL;
if (elem_ast == NULL) {
zend_op *opline;
- zend_bool is_fully_qualified;
+ bool is_fully_qualified;
zend_string *orig_name = zend_ast_get_str(name_ast);
zend_string *resolved_name = zend_resolve_const_name(orig_name, name_ast->attr, &is_fully_qualified);
}
/* }}} */
-zend_bool zend_is_allowed_in_const_expr(zend_ast_kind kind) /* {{{ */
+bool zend_is_allowed_in_const_expr(zend_ast_kind kind) /* {{{ */
{
return kind == ZEND_AST_ZVAL || kind == ZEND_AST_BINARY_OP
|| kind == ZEND_AST_GREATER || kind == ZEND_AST_GREATER_EQUAL
zend_ast *ast = *ast_ptr;
zend_ast *name_ast = ast->child[0];
zend_string *orig_name = zend_ast_get_str(name_ast);
- zend_bool is_fully_qualified;
+ bool is_fully_qualified;
zval result;
zend_string *resolved_name;
return opcode;
}
-zend_op *zend_delayed_compile_var(znode *result, zend_ast *ast, uint32_t type, zend_bool by_ref) /* {{{ */
+zend_op *zend_delayed_compile_var(znode *result, zend_ast *ast, uint32_t type, bool by_ref) /* {{{ */
{
switch (ast->kind) {
case ZEND_AST_VAR:
case ZEND_AST_AND:
case ZEND_AST_OR:
{
- zend_bool child0_is_true, child1_is_true;
+ bool child0_is_true, child1_is_true;
zend_eval_const_expr(&ast->child[0]);
zend_eval_const_expr(&ast->child[1]);
if (ast->child[0]->kind != ZEND_AST_ZVAL) {
case ZEND_AST_CONST:
{
zend_ast *name_ast = ast->child[0];
- zend_bool is_fully_qualified;
+ bool is_fully_qualified;
zend_string *resolved_name = zend_resolve_const_name(
zend_ast_get_str(name_ast), name_ast->attr, &is_fully_qualified);
zend_declarables declarables;
zend_string *current_namespace;
- zend_bool in_namespace;
- zend_bool has_bracketed_namespaces;
+ bool in_namespace;
+ bool has_bracketed_namespaces;
HashTable *imports;
HashTable *imports_function;
int cont;
int brk;
int parent;
- zend_bool is_switch;
+ bool is_switch;
} zend_brk_cont_element;
typedef struct _zend_label {
zend_ast *zend_negate_num_string(zend_ast *ast);
uint32_t zend_add_class_modifier(uint32_t flags, uint32_t new_flag);
uint32_t zend_add_member_modifier(uint32_t flags, uint32_t new_flag);
-zend_bool zend_handle_encoding_declaration(zend_ast *ast);
+bool zend_handle_encoding_declaration(zend_ast *ast);
/* parser-driven code generators */
void zend_do_free(znode *op1);
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle);
ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce);
ZEND_API void zend_cleanup_internal_classes(void);
-ZEND_API void zend_type_release(zend_type type, zend_bool persistent);
+ZEND_API void zend_type_release(zend_type type, bool persistent);
ZEND_API zend_string *zend_create_member_string(zend_string *class_name, zend_string *member_name);
#define ZEND_FUNCTION_DTOR zend_function_dtor
#define ZEND_CLASS_DTOR destroy_zend_class
-typedef zend_bool (*zend_needs_live_range_cb)(zend_op_array *op_array, zend_op *opline);
+typedef bool (*zend_needs_live_range_cb)(zend_op_array *op_array, zend_op *opline);
ZEND_API void zend_recalc_live_ranges(
zend_op_array *op_array, zend_needs_live_range_cb needs_live_range);
ZEND_API void pass_two(zend_op_array *op_array);
-ZEND_API zend_bool zend_is_compiling(void);
+ZEND_API bool zend_is_compiling(void);
ZEND_API char *zend_make_compiled_string_description(const char *name);
-ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers);
+ZEND_API void zend_initialize_class_data(zend_class_entry *ce, bool nullify_handlers);
uint32_t zend_get_class_fetch_type(zend_string *name);
ZEND_API zend_uchar zend_get_call_op(const zend_op *init_op, zend_function *fbc);
ZEND_API bool zend_is_smart_branch(const zend_op *opline);
-typedef zend_bool (*zend_auto_global_callback)(zend_string *name);
+typedef bool (*zend_auto_global_callback)(zend_string *name);
typedef struct _zend_auto_global {
zend_string *name;
zend_auto_global_callback auto_global_callback;
- zend_bool jit;
- zend_bool armed;
+ bool jit;
+ bool armed;
} zend_auto_global;
-ZEND_API zend_result zend_register_auto_global(zend_string *name, zend_bool jit, zend_auto_global_callback auto_global_callback);
+ZEND_API zend_result zend_register_auto_global(zend_string *name, bool jit, zend_auto_global_callback auto_global_callback);
ZEND_API void zend_activate_auto_globals(void);
-ZEND_API zend_bool zend_is_auto_global(zend_string *name);
-ZEND_API zend_bool zend_is_auto_global_str(const char *name, size_t len);
+ZEND_API bool zend_is_auto_global(zend_string *name);
+ZEND_API bool zend_is_auto_global_str(const char *name, size_t len);
ZEND_API size_t zend_dirname(char *path, size_t len);
ZEND_API void zend_set_function_arg_flags(zend_function *func);
/* The default value for CG(compiler_options) during eval() */
#define ZEND_COMPILE_DEFAULT_FOR_EVAL 0
-ZEND_API zend_bool zend_binary_op_produces_error(uint32_t opcode, zval *op1, zval *op2);
+ZEND_API bool zend_binary_op_produces_error(uint32_t opcode, zval *op1, zval *op2);
#endif /* ZEND_COMPILE_H */
zend_register_constant(&c);
}
-ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, zend_bool bval, int flags, int module_number)
+ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, bool bval, int flags, int module_number)
{
zend_constant c;
zend_string *lowercase_name = NULL;
zend_string *name;
zend_result ret = SUCCESS;
- zend_bool persistent = (ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) != 0;
+ bool persistent = (ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) != 0;
#if 0
printf("Registering constant for module %d\n", c->module_number);
ZEND_API zval *zend_get_constant(zend_string *name);
ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len);
ZEND_API zval *zend_get_constant_ex(zend_string *name, zend_class_entry *scope, uint32_t flags);
-ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, zend_bool bval, int flags, int module_number);
+ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, bool bval, int flags, int module_number);
ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int flags, int module_number);
ZEND_API void zend_register_long_constant(const char *name, size_t name_len, zend_long lval, int flags, int module_number);
ZEND_API void zend_register_double_constant(const char *name, size_t name_len, double dval, int flags, int module_number);
# endif
}
-static zend_bool is_avx_supported() {
+static bool is_avx_supported() {
if (!(cpuinfo.ecx & ZEND_CPU_FEATURE_AVX)) {
/* No support for AVX */
return 0;
return 1;
}
#else
-static zend_bool is_avx_supported() {
+static bool is_avx_supported() {
return 0;
}
#endif
}
/* }}} */
-static zend_always_inline zend_bool is_handle_exception_set() {
+static zend_always_inline bool is_handle_exception_set() {
zend_execute_data *execute_data = EG(current_execute_data);
return !execute_data->func
|| !ZEND_USER_CODE(execute_data->func->common.type)
{
zend_string *message = NULL, *filename = NULL;
zend_long code = 0, severity = E_ERROR, lineno;
- zend_bool lineno_is_null = 1;
+ bool lineno_is_null = 1;
zval tmp, *object, *previous = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|SllS!l!O!", &message, &code, &severity, &filename, &lineno, &lineno_is_null, &previous, zend_ce_throwable) == FAILURE) {
EG(current_execute_data)->opline = EG(exception_op);
}
-ZEND_API zend_bool zend_is_unwind_exit(zend_object *ex)
+ZEND_API bool zend_is_unwind_exit(zend_object *ex)
{
return ex->ce == &zend_ce_unwind_exit;
}
ZEND_API ZEND_COLD zend_result zend_exception_error(zend_object *exception, int severity);
ZEND_API ZEND_COLD void zend_throw_unwind_exit(void);
-ZEND_API zend_bool zend_is_unwind_exit(zend_object *ex);
+ZEND_API bool zend_is_unwind_exit(zend_object *ex);
#include "zend_globals.h"
zend_string_release(need_msg);
}
-static zend_bool zend_verify_weak_scalar_type_hint(uint32_t type_mask, zval *arg)
+static bool zend_verify_weak_scalar_type_hint(uint32_t type_mask, zval *arg)
{
zend_long lval;
double dval;
zend_string *str;
- zend_bool bval;
+ bool bval;
/* Type preference order: int -> float -> string -> bool */
if (type_mask & MAY_BE_LONG) {
}
/* Used to sanity-check internal arginfo types without performing any actual type conversions. */
-static zend_bool zend_verify_weak_scalar_type_hint_no_sideeffect(uint32_t type_mask, zval *arg)
+static bool zend_verify_weak_scalar_type_hint_no_sideeffect(uint32_t type_mask, zval *arg)
{
zend_long lval;
double dval;
- zend_bool bval;
+ bool bval;
if ((type_mask & MAY_BE_LONG) && zend_parse_arg_long_weak(arg, &lval)) {
return 1;
}
#endif
-ZEND_API zend_bool zend_verify_scalar_type_hint(uint32_t type_mask, zval *arg, zend_bool strict, zend_bool is_internal_arg)
+ZEND_API bool zend_verify_scalar_type_hint(uint32_t type_mask, zval *arg, bool strict, bool is_internal_arg)
{
if (UNEXPECTED(strict)) {
/* SSTH Exception: IS_LONG may be accepted as IS_DOUBLE (converted) */
}
}
-static zend_bool zend_check_and_resolve_property_class_type(
+static bool zend_check_and_resolve_property_class_type(
zend_property_info *info, zend_class_entry *object_ce) {
zend_class_entry *ce;
if (ZEND_TYPE_HAS_LIST(info->type)) {
}
}
-static zend_always_inline zend_bool i_zend_check_property_type(zend_property_info *info, zval *property, zend_bool strict)
+static zend_always_inline bool i_zend_check_property_type(zend_property_info *info, zval *property, bool strict)
{
ZEND_ASSERT(!Z_ISREF_P(property));
if (EXPECTED(ZEND_TYPE_CONTAINS_CODE(info->type, Z_TYPE_P(property)))) {
return zend_verify_scalar_type_hint(type_mask, property, strict, 0);
}
-static zend_always_inline zend_bool i_zend_verify_property_type(zend_property_info *info, zval *property, zend_bool strict)
+static zend_always_inline bool i_zend_verify_property_type(zend_property_info *info, zval *property, bool strict)
{
if (i_zend_check_property_type(info, property, strict)) {
return 1;
return 0;
}
-ZEND_API zend_bool zend_never_inline zend_verify_property_type(zend_property_info *info, zval *property, zend_bool strict) {
+ZEND_API bool zend_never_inline zend_verify_property_type(zend_property_info *info, zval *property, bool strict) {
return i_zend_verify_property_type(info, property, strict);
}
return zend_assign_to_variable(property_val, &tmp, IS_TMP_VAR, EX_USES_STRICT_TYPES());
}
-ZEND_API zend_bool zend_value_instanceof_static(zval *zv) {
+ZEND_API bool zend_value_instanceof_static(zval *zv) {
if (Z_TYPE_P(zv) != IS_OBJECT) {
return 0;
}
# define HAVE_CACHE_SLOT 1
#endif
-static zend_always_inline zend_bool zend_check_type_slow(
+static zend_always_inline bool zend_check_type_slow(
zend_type type, zval *arg, zend_reference *ref, void **cache_slot, zend_class_entry *scope,
- zend_bool is_return_type, zend_bool is_internal)
+ bool is_return_type, bool is_internal)
{
uint32_t type_mask;
if (ZEND_TYPE_HAS_CLASS(type) && Z_TYPE_P(arg) == IS_OBJECT) {
* because this case is already checked at compile-time. */
}
-static zend_always_inline zend_bool zend_check_type(
+static zend_always_inline bool zend_check_type(
zend_type type, zval *arg, void **cache_slot, zend_class_entry *scope,
- zend_bool is_return_type, zend_bool is_internal)
+ bool is_return_type, bool is_internal)
{
zend_reference *ref = NULL;
ZEND_ASSERT(ZEND_TYPE_IS_SET(type));
/* Determine whether an internal call should throw, because the passed arguments violate
* an arginfo constraint. This is only checked in debug builds. In release builds, we
* trust that arginfo matches what is enforced by zend_parse_parameters. */
-static zend_always_inline zend_bool zend_internal_call_should_throw(zend_function *fbc, zend_execute_data *call)
+static zend_always_inline bool zend_internal_call_should_throw(zend_function *fbc, zend_execute_data *call)
{
if (fbc->internal_function.handler == ZEND_FN(pass)) {
/* Be lenient about the special pass function. */
}
}
-static zend_never_inline zend_bool ZEND_FASTCALL zend_array_key_exists_fast(HashTable *ht, zval *key OPLINE_DC EXECUTE_DATA_DC)
+static zend_never_inline bool ZEND_FASTCALL zend_array_key_exists_fast(HashTable *ht, zval *key OPLINE_DC EXECUTE_DATA_DC)
{
zend_string *str;
zend_ulong hval;
}
}
-static zend_always_inline zend_bool promotes_to_array(zval *val) {
+static zend_always_inline bool promotes_to_array(zval *val) {
return Z_TYPE_P(val) <= IS_FALSE
|| (Z_ISREF_P(val) && Z_TYPE_P(Z_REFVAL_P(val)) <= IS_FALSE);
}
-static zend_always_inline zend_bool check_type_array_assignable(zend_type type) {
+static zend_always_inline bool check_type_array_assignable(zend_type type) {
if (!ZEND_TYPE_IS_SET(type)) {
return 1;
}
}
/* Checks whether an array can be assigned to the reference. Throws error if not assignable. */
-ZEND_API zend_bool zend_verify_ref_array_assignable(zend_reference *ref) {
+ZEND_API bool zend_verify_ref_array_assignable(zend_reference *ref) {
zend_property_info *prop;
ZEND_ASSERT(ZEND_REF_HAS_TYPE_SOURCES(ref));
ZEND_REF_FOREACH_TYPE_SOURCES(ref, prop) {
return zend_get_typed_property_info_for_slot(obj, slot);
}
-static zend_never_inline zend_bool zend_handle_fetch_obj_flags(
+static zend_never_inline bool zend_handle_fetch_obj_flags(
zval *result, zval *ptr, zend_object *obj, zend_property_info *prop_info, uint32_t flags)
{
switch (flags) {
return 1;
}
-static zend_always_inline void zend_fetch_property_address(zval *result, zval *container, uint32_t container_op_type, zval *prop_ptr, uint32_t prop_op_type, void **cache_slot, int type, uint32_t flags, zend_bool init_undef OPLINE_DC EXECUTE_DATA_DC)
+static zend_always_inline void zend_fetch_property_address(zval *result, zval *container, uint32_t container_op_type, zval *prop_ptr, uint32_t prop_op_type, void **cache_slot, int type, uint32_t flags, bool init_undef OPLINE_DC EXECUTE_DATA_DC)
{
zval *ptr;
zend_object *zobj;
/* 1: valid, 0: invalid, -1: may be valid after type coercion */
static zend_always_inline int i_zend_verify_type_assignable_zval(
- zend_property_info *info, zval *zv, zend_bool strict) {
+ zend_property_info *info, zval *zv, bool strict) {
zend_type type = info->type;
uint32_t type_mask;
zend_uchar zv_type = Z_TYPE_P(zv);
return -1;
}
-ZEND_API zend_bool ZEND_FASTCALL zend_verify_ref_assignable_zval(zend_reference *ref, zval *zv, zend_bool strict)
+ZEND_API bool ZEND_FASTCALL zend_verify_ref_assignable_zval(zend_reference *ref, zval *zv, bool strict)
{
zend_property_info *prop;
}
}
-ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *orig_value, zend_uchar value_type, zend_bool strict)
+ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *orig_value, zend_uchar value_type, bool strict)
{
- zend_bool ret;
+ bool ret;
zval value;
zend_refcounted *ref = NULL;
return variable_ptr;
}
-ZEND_API zend_bool ZEND_FASTCALL zend_verify_prop_assignable_by_ref(zend_property_info *prop_info, zval *orig_val, zend_bool strict) {
+ZEND_API bool ZEND_FASTCALL zend_verify_prop_assignable_by_ref(zend_property_info *prop_info, zval *orig_val, bool strict) {
zval *val = orig_val;
if (Z_ISREF_P(val) && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(val))) {
int result;
}
}
-static zend_always_inline void i_init_func_execute_data(zend_op_array *op_array, zval *return_value, zend_bool may_be_trampoline EXECUTE_DATA_DC) /* {{{ */
+static zend_always_inline void i_init_func_execute_data(zend_op_array *op_array, zval *return_value, bool may_be_trampoline EXECUTE_DATA_DC) /* {{{ */
{
uint32_t first_extra_arg, num_args;
ZEND_ASSERT(EX(func) == (zend_function*)op_array);
}
/* }}} */
-static zend_never_inline zend_bool ZEND_FASTCALL zend_fe_reset_iterator(zval *array_ptr, int by_ref OPLINE_DC EXECUTE_DATA_DC) /* {{{ */
+static zend_never_inline bool ZEND_FASTCALL zend_fe_reset_iterator(zval *array_ptr, int by_ref OPLINE_DC EXECUTE_DATA_DC) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(array_ptr);
zend_object_iterator *iter = ce->get_iterator(ce, array_ptr, by_ref);
- zend_bool is_empty;
+ bool is_empty;
if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) {
if (iter) {
ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value);
ZEND_API void execute_ex(zend_execute_data *execute_data);
ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_value);
-ZEND_API zend_bool zend_is_valid_class_name(zend_string *name);
+ZEND_API bool zend_is_valid_class_name(zend_string *name);
ZEND_API zend_class_entry *zend_lookup_class(zend_string *name);
ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, zend_string *lcname, uint32_t flags);
ZEND_API zend_class_entry *zend_get_called_scope(zend_execute_data *ex);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_function(const zend_function *fbc);
ZEND_COLD void ZEND_FASTCALL zend_param_must_be_ref(const zend_function *func, uint32_t arg_num);
-ZEND_API zend_bool ZEND_FASTCALL zend_verify_ref_assignable_zval(zend_reference *ref, zval *zv, zend_bool strict);
-ZEND_API zend_bool ZEND_FASTCALL zend_verify_prop_assignable_by_ref(zend_property_info *prop_info, zval *orig_val, zend_bool strict);
+ZEND_API bool ZEND_FASTCALL zend_verify_ref_assignable_zval(zend_reference *ref, zval *zv, bool strict);
+ZEND_API bool ZEND_FASTCALL zend_verify_prop_assignable_by_ref(zend_property_info *prop_info, zval *orig_val, bool strict);
ZEND_API ZEND_COLD void zend_throw_ref_type_error_zval(zend_property_info *prop, zval *zv);
ZEND_API ZEND_COLD void zend_throw_ref_type_error_type(zend_property_info *prop1, zend_property_info *prop2, zval *zv);
ZEND_API ZEND_COLD zend_result ZEND_FASTCALL zend_undefined_offset_write(HashTable *ht, zend_long lval);
ZEND_API ZEND_COLD zend_result ZEND_FASTCALL zend_undefined_index_write(HashTable *ht, zend_string *offset);
-ZEND_API zend_bool zend_verify_scalar_type_hint(uint32_t type_mask, zval *arg, zend_bool strict, zend_bool is_internal_arg);
+ZEND_API bool zend_verify_scalar_type_hint(uint32_t type_mask, zval *arg, bool strict, bool is_internal_arg);
ZEND_API ZEND_COLD void zend_verify_arg_error(
const zend_function *zf, const zend_arg_info *arg_info, int arg_num, zval *value);
ZEND_API ZEND_COLD void zend_verify_return_error(
const zend_function *zf, zval *value);
-ZEND_API zend_bool zend_verify_ref_array_assignable(zend_reference *ref);
-ZEND_API zend_bool zend_value_instanceof_static(zval *zv);
+ZEND_API bool zend_verify_ref_array_assignable(zend_reference *ref);
+ZEND_API bool zend_value_instanceof_static(zval *zv);
#define ZEND_REF_TYPE_SOURCES(ref) \
ZEND_API void ZEND_FASTCALL zend_ref_add_type_source(zend_property_info_source_list *source_list, zend_property_info *prop);
ZEND_API void ZEND_FASTCALL zend_ref_del_type_source(zend_property_info_source_list *source_list, zend_property_info *prop);
-ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *value, zend_uchar value_type, zend_bool strict);
+ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *value, zend_uchar value_type, bool strict);
static zend_always_inline void zend_copy_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type)
{
}
}
-static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type, zend_bool strict)
+static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type, bool strict)
{
do {
if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) {
ZEND_API zend_string *zend_get_executed_filename_ex(void);
ZEND_API uint32_t zend_get_executed_lineno(void);
ZEND_API zend_class_entry *zend_get_executed_scope(void);
-ZEND_API zend_bool zend_is_executing(void);
+ZEND_API bool zend_is_executing(void);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_cannot_pass_by_reference(uint32_t arg_num);
ZEND_API void zend_set_timeout(zend_long seconds, bool reset_signals);
#define ZEND_CLASS_HAS_TYPE_HINTS(ce) ((ce->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) == ZEND_ACC_HAS_TYPE_HINTS)
-ZEND_API zend_bool zend_verify_property_type(zend_property_info *info, zval *property, zend_bool strict);
+ZEND_API bool zend_verify_property_type(zend_property_info *info, zval *property, bool strict);
ZEND_COLD void zend_verify_property_type_error(zend_property_info *info, zval *property);
#define ZEND_REF_ADD_TYPE_SOURCE(ref, source) \
zend_string *key;
zval *zv;
#if ZEND_DEBUG
- zend_bool fast_shutdown = 0;
+ bool fast_shutdown = 0;
#else
- zend_bool fast_shutdown = is_zend_mm() && !EG(full_tables_cleanup);
+ bool fast_shutdown = is_zend_mm() && !EG(full_tables_cleanup);
#endif
zend_try {
}
/* }}} */
-ZEND_API zend_bool zend_is_executing(void) /* {{{ */
+ZEND_API bool zend_is_executing(void) /* {{{ */
{
return EG(current_execute_data) != 0;
}
for (i=0; i<fci->param_count; i++) {
zval *param = ZEND_CALL_ARG(call, i+1);
zval *arg = &fci->params[i];
- zend_bool must_wrap = 0;
+ bool must_wrap = 0;
if (UNEXPECTED(Z_ISUNDEF_P(arg))) {
/* Allow forwarding undef slots. This is only used by Closure::__invoke(). */
ZVAL_UNDEF(param);
zend_string *name;
zval *arg;
uint32_t arg_num = ZEND_CALL_NUM_ARGS(call) + 1;
- zend_bool have_named_params = 0;
+ bool have_named_params = 0;
ZEND_HASH_FOREACH_STR_KEY_VAL(fci->named_params, name, arg) {
- zend_bool must_wrap = 0;
+ bool must_wrap = 0;
zval *target;
if (name) {
void *cache_slot[2] = {NULL, NULL};
0xffffffff,
};
-ZEND_API zend_bool zend_is_valid_class_name(zend_string *name) {
+ZEND_API bool zend_is_valid_class_name(zend_string *name) {
for (size_t i = 0; i < ZSTR_LEN(name); i++) {
unsigned char c = ZSTR_VAL(name)[i];
if (!ZEND_BIT_TEST(valid_chars, c)) {
typedef struct _zend_gc_globals {
gc_root_buffer *buf; /* preallocated arrays of buffers */
- zend_bool gc_enabled;
- zend_bool gc_active; /* GC currently running, forbid nested GC */
- zend_bool gc_protected; /* GC protected, forbid root additions */
- zend_bool gc_full;
+ bool gc_enabled;
+ bool gc_active; /* GC currently running, forbid nested GC */
+ bool gc_protected; /* GC protected, forbid root additions */
+ bool gc_full;
uint32_t unused; /* linked list of unused buffers */
uint32_t first_unused; /* first unused buffer */
}
}
-ZEND_API zend_bool gc_enable(zend_bool enable)
+ZEND_API bool gc_enable(bool enable)
{
- zend_bool old_enabled = GC_G(gc_enabled);
+ bool old_enabled = GC_G(gc_enabled);
GC_G(gc_enabled) = enable;
if (enable && !old_enabled && GC_G(buf) == NULL) {
GC_G(buf) = (gc_root_buffer*) pemalloc(sizeof(gc_root_buffer) * GC_DEFAULT_BUF_SIZE, 1);
return old_enabled;
}
-ZEND_API zend_bool gc_enabled(void)
+ZEND_API bool gc_enabled(void)
{
return GC_G(gc_enabled);
}
-ZEND_API zend_bool gc_protect(zend_bool protect)
+ZEND_API bool gc_protect(bool protect)
{
- zend_bool old_protected = GC_G(gc_protected);
+ bool old_protected = GC_G(gc_protected);
GC_G(gc_protected) = protect;
return old_protected;
}
-ZEND_API zend_bool gc_protected(void)
+ZEND_API bool gc_protected(void)
{
return GC_G(gc_protected);
}
ZEND_API void ZEND_FASTCALL gc_remove_from_buffer(zend_refcounted *ref);
/* enable/disable automatic start of GC collection */
-ZEND_API zend_bool gc_enable(zend_bool enable);
-ZEND_API zend_bool gc_enabled(void);
+ZEND_API bool gc_enable(bool enable);
+ZEND_API bool gc_enabled(void);
/* enable/disable possible root additions */
-ZEND_API zend_bool gc_protect(zend_bool protect);
-ZEND_API zend_bool gc_protected(void);
+ZEND_API bool gc_protect(bool protect);
+ZEND_API bool gc_protected(void);
/* The default implementation of the gc_collect_cycles callback. */
ZEND_API int zend_gc_collect_cycles(void);
}
/* }}} */
-ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution) /* {{{ */
+ZEND_API void zend_generator_close(zend_generator *generator, bool finished_execution) /* {{{ */
{
if (EXPECTED(generator->execute_data)) {
zend_execute_data *execute_data = generator->execute_data;
static const zend_uchar ZEND_GENERATOR_DO_INIT = 0x8;
void zend_register_generator_ce(void);
-ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution);
+ZEND_API void zend_generator_close(zend_generator *generator, bool finished_execution);
ZEND_API void zend_generator_resume(zend_generator *generator);
ZEND_API void zend_generator_restore_call_stack(zend_generator *generator);
/* Refer to zend_yytnamerr() in zend_language_parser.y for meaning of values */
zend_uchar parse_error;
- zend_bool in_compilation;
- zend_bool short_tags;
+ bool in_compilation;
+ bool short_tags;
- zend_bool unclean_shutdown;
+ bool unclean_shutdown;
- zend_bool ini_parser_unbuffered_errors;
+ bool ini_parser_unbuffered_errors;
zend_llist open_files;
struct _zend_ini_parser_param *ini_parser_param;
- zend_bool skip_shebang;
- zend_bool increment_lineno;
+ bool skip_shebang;
+ bool increment_lineno;
zend_string *doc_comment;
uint32_t extra_fn_flags;
const zend_encoding **script_encoding_list;
size_t script_encoding_list_size;
- zend_bool multibyte;
- zend_bool detect_unicode;
- zend_bool encoding_declared;
+ bool multibyte;
+ bool detect_unicode;
+ bool encoding_declared;
zend_ast *ast;
zend_arena *ast_arena;
uint32_t persistent_classes_count;
HashTable *in_autoload;
- zend_bool full_tables_cleanup;
+ bool full_tables_cleanup;
/* for extended information support */
- zend_bool no_extensions;
+ bool no_extensions;
- zend_bool vm_interrupt;
- zend_bool timed_out;
+ bool vm_interrupt;
+ bool timed_out;
zend_long hard_timeout;
#ifdef ZEND_WIN32
struct _zend_module_entry *current_module;
- zend_bool active;
+ bool active;
zend_uchar flags;
zend_long assertions;
HashTable weakrefs;
- zend_bool exception_ignore_args;
+ bool exception_ignore_args;
zend_long exception_string_param_max_len;
zend_get_gc_buffer get_gc_buffer;
zend_stack state_stack;
zend_ptr_stack heredoc_label_stack;
zend_stack nest_location_stack; /* for syntax error reporting */
- zend_bool heredoc_scan_ahead;
+ bool heredoc_scan_ahead;
int heredoc_indentation;
- zend_bool heredoc_indentation_uses_spaces;
+ bool heredoc_indentation_uses_spaces;
/* original (unfiltered) script */
unsigned char *script_org;
.pDestructor = ZVAL_PTR_DTOR
};
-static zend_always_inline void _zend_hash_init_int(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent)
+static zend_always_inline void _zend_hash_init_int(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, bool persistent)
{
GC_SET_REFCOUNT(ht, 1);
GC_TYPE_INFO(ht) = GC_ARRAY | (persistent ? ((GC_PERSISTENT|GC_NOT_COLLECTABLE) << GC_FLAGS_SHIFT) : 0);
ht->nTableSize = zend_hash_check_size(nSize);
}
-ZEND_API void ZEND_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent)
+ZEND_API void ZEND_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, bool persistent)
{
_zend_hash_init_int(ht, nSize, pDestructor, persistent);
}
HT_SET_DATA_ADDR(ht, perealloc2(HT_GET_DATA_ADDR(ht), HT_SIZE_EX(ht->nTableSize, HT_MIN_MASK), HT_USED_SIZE(ht), GC_FLAGS(ht) & IS_ARRAY_PERSISTENT));
}
-ZEND_API void ZEND_FASTCALL zend_hash_real_init(HashTable *ht, zend_bool packed)
+ZEND_API void ZEND_FASTCALL zend_hash_real_init(HashTable *ht, bool packed)
{
IS_CONSISTENT(ht);
pefree(old_data, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
}
-ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, zend_bool packed)
+ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, bool packed)
{
HT_ASSERT_RC1(ht);
if (nSize == 0) return;
}
}
-static zend_always_inline Bucket *zend_hash_find_bucket(const HashTable *ht, zend_string *key, zend_bool known_hash)
+static zend_always_inline Bucket *zend_hash_find_bucket(const HashTable *ht, zend_string *key, bool known_hash)
{
zend_ulong h;
uint32_t nIndex;
}
-ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, zend_bool overwrite)
+ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, bool overwrite)
{
uint32_t idx;
Bucket *p;
}
-static zend_bool ZEND_FASTCALL zend_hash_replace_checker_wrapper(HashTable *target, zval *source_data, Bucket *p, void *pParam, merge_checker_func_t merge_checker_func)
+static bool ZEND_FASTCALL zend_hash_replace_checker_wrapper(HashTable *target, zval *source_data, Bucket *p, void *pParam, merge_checker_func_t merge_checker_func)
{
zend_hash_key hash_key;
q->h = h;
}
-ZEND_API void ZEND_FASTCALL zend_hash_sort_ex(HashTable *ht, sort_func_t sort, bucket_compare_func_t compar, zend_bool renumber)
+ZEND_API void ZEND_FASTCALL zend_hash_sort_ex(HashTable *ht, sort_func_t sort, bucket_compare_func_t compar, bool renumber)
{
Bucket *p;
uint32_t i, j;
}
}
-static zend_always_inline int zend_hash_compare_impl(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered) {
+static zend_always_inline int zend_hash_compare_impl(HashTable *ht1, HashTable *ht2, compare_func_t compar, bool ordered) {
uint32_t idx1, idx2;
if (ht1->nNumOfElements != ht2->nNumOfElements) {
return 0;
}
-ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered)
+ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, bool ordered)
{
int result;
IS_CONSISTENT(ht1);
* a "symtable" (contains integer and non-numeric string keys).
* If the proptable didn't need duplicating, its refcount is incremented.
*/
-ZEND_API HashTable* ZEND_FASTCALL zend_proptable_to_symtable(HashTable *ht, zend_bool always_duplicate)
+ZEND_API HashTable* ZEND_FASTCALL zend_proptable_to_symtable(HashTable *ht, bool always_duplicate)
{
zend_ulong num_key;
zend_string *str_key;
zend_string *key;
} zend_hash_key;
-typedef zend_bool (*merge_checker_func_t)(HashTable *target_ht, zval *source_data, zend_hash_key *hash_key, void *pParam);
+typedef bool (*merge_checker_func_t)(HashTable *target_ht, zval *source_data, zend_hash_key *hash_key, void *pParam);
BEGIN_EXTERN_C()
/* startup/shutdown */
-ZEND_API void ZEND_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent);
+ZEND_API void ZEND_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, bool persistent);
ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht);
ZEND_API void ZEND_FASTCALL zend_hash_clean(HashTable *ht);
#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) \
_zend_hash_init((ht), (nSize), (pDestructor), (persistent))
-ZEND_API void ZEND_FASTCALL zend_hash_real_init(HashTable *ht, zend_bool packed);
+ZEND_API void ZEND_FASTCALL zend_hash_real_init(HashTable *ht, bool packed);
ZEND_API void ZEND_FASTCALL zend_hash_real_init_packed(HashTable *ht);
ZEND_API void ZEND_FASTCALL zend_hash_real_init_mixed(HashTable *ht);
ZEND_API void ZEND_FASTCALL zend_hash_packed_to_hash(HashTable *ht);
ZEND_API void ZEND_FASTCALL zend_hash_to_packed(HashTable *ht);
-ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, zend_bool packed);
+ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, bool packed);
ZEND_API void ZEND_FASTCALL zend_hash_discard(HashTable *ht, uint32_t nNumUsed);
/* additions/updates/changes */
/* The same as zend_hash_find(), but hash value of the key must be already calculated */
ZEND_API zval* ZEND_FASTCALL _zend_hash_find_known_hash(const HashTable *ht, zend_string *key);
-static zend_always_inline zval *zend_hash_find_ex(const HashTable *ht, zend_string *key, zend_bool known_hash)
+static zend_always_inline zval *zend_hash_find_ex(const HashTable *ht, zend_string *key, bool known_hash)
{
if (known_hash) {
return _zend_hash_find_known_hash(ht, key);
/* Misc */
-static zend_always_inline zend_bool zend_hash_exists(const HashTable *ht, zend_string *key)
+static zend_always_inline bool zend_hash_exists(const HashTable *ht, zend_string *key)
{
return zend_hash_find(ht, key) != NULL;
}
-static zend_always_inline zend_bool zend_hash_str_exists(const HashTable *ht, const char *str, size_t len)
+static zend_always_inline bool zend_hash_str_exists(const HashTable *ht, const char *str, size_t len)
{
return zend_hash_str_find(ht, str, len) != NULL;
}
-static zend_always_inline zend_bool zend_hash_index_exists(const HashTable *ht, zend_ulong h)
+static zend_always_inline bool zend_hash_index_exists(const HashTable *ht, zend_ulong h)
{
return zend_hash_index_find(ht, h) != NULL;
}
/* Copying, merging and sorting */
ZEND_API void ZEND_FASTCALL zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor);
-ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, zend_bool overwrite);
+ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, bool overwrite);
ZEND_API void ZEND_FASTCALL zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, merge_checker_func_t pMergeSource, void *pParam);
ZEND_API void zend_hash_bucket_swap(Bucket *p, Bucket *q);
ZEND_API void zend_hash_bucket_renum_swap(Bucket *p, Bucket *q);
ZEND_API void zend_hash_bucket_packed_swap(Bucket *p, Bucket *q);
typedef int (*bucket_compare_func_t)(Bucket *a, Bucket *b);
-ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered);
-ZEND_API void ZEND_FASTCALL zend_hash_sort_ex(HashTable *ht, sort_func_t sort_func, bucket_compare_func_t compare_func, zend_bool renumber);
+ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, bool ordered);
+ZEND_API void ZEND_FASTCALL zend_hash_sort_ex(HashTable *ht, sort_func_t sort_func, bucket_compare_func_t compare_func, bool renumber);
ZEND_API zval* ZEND_FASTCALL zend_hash_minmax(const HashTable *ht, bucket_compare_func_t compar, uint32_t flag);
#define zend_hash_sort(ht, compare_func, renumber) \
ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht);
ZEND_API void ZEND_FASTCALL zend_symtable_clean(HashTable *ht);
ZEND_API HashTable* ZEND_FASTCALL zend_symtable_to_proptable(HashTable *ht);
-ZEND_API HashTable* ZEND_FASTCALL zend_proptable_to_symtable(HashTable *ht, zend_bool always_duplicate);
+ZEND_API HashTable* ZEND_FASTCALL zend_proptable_to_symtable(HashTable *ht, bool always_duplicate);
ZEND_API bool ZEND_FASTCALL _zend_handle_numeric_str_ex(const char *key, size_t length, zend_ulong *idx);
}
-static zend_always_inline zval *zend_hash_find_ex_ind(const HashTable *ht, zend_string *key, zend_bool known_hash)
+static zend_always_inline zval *zend_hash_find_ex_ind(const HashTable *ht, zend_string *key, bool known_hash)
{
zval *zv;
}
}
-static zend_always_inline void *zend_hash_find_ex_ptr(const HashTable *ht, zend_string *key, zend_bool known_hash)
+static zend_always_inline void *zend_hash_find_ex_ptr(const HashTable *ht, zend_string *key, bool known_hash)
{
zval *zv;
zend_class_entry *ce, const zend_property_info *child_prop,
const zend_property_info *parent_prop);
-static void zend_type_copy_ctor(zend_type *type, zend_bool persistent) {
+static void zend_type_copy_ctor(zend_type *type, bool persistent) {
if (ZEND_TYPE_HAS_LIST(*type)) {
zend_type_list *old_list = ZEND_TYPE_LIST(*type);
size_t size = ZEND_TYPE_LIST_SIZE(old_list->num_types);
}
/* }}} */
-static zend_always_inline zend_function *zend_duplicate_function(zend_function *func, zend_class_entry *ce, zend_bool is_interface) /* {{{ */
+static zend_always_inline zend_function *zend_duplicate_function(zend_function *func, zend_class_entry *ce, bool is_interface) /* {{{ */
{
if (UNEXPECTED(func->type == ZEND_INTERNAL_FUNCTION)) {
return zend_duplicate_internal_function(func, ce);
}
}
-static zend_bool class_visible(zend_class_entry *ce) {
+static bool class_visible(zend_class_entry *ce) {
if (ce->type == ZEND_INTERNAL_CLASS) {
return !(CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_CLASSES);
} else {
}
static zend_class_entry *lookup_class(
- zend_class_entry *scope, zend_string *name, zend_bool register_unresolved) {
+ zend_class_entry *scope, zend_string *name, bool register_unresolved) {
uint32_t flags = ZEND_FETCH_CLASS_ALLOW_UNLINKED | ZEND_FETCH_CLASS_NO_AUTOLOAD;
zend_class_entry *ce = zend_lookup_class_ex(name, NULL, flags);
if (!CG(in_compilation)) {
}
/* Instanceof that's safe to use on unlinked classes. */
-static zend_bool unlinked_instanceof(zend_class_entry *ce1, zend_class_entry *ce2) {
+static bool unlinked_instanceof(zend_class_entry *ce1, zend_class_entry *ce2) {
if (ce1 == ce2) {
return 1;
}
return 0;
}
-static zend_bool zend_type_contains_traversable(zend_type type) {
+static bool zend_type_contains_traversable(zend_type type) {
zend_type *single_type;
if (ZEND_TYPE_FULL_MASK(type) & MAY_BE_OBJECT) {
return 1;
return 0;
}
-static zend_bool zend_type_permits_self(
+static bool zend_type_permits_self(
zend_type type, zend_class_entry *scope, zend_class_entry *self) {
if (ZEND_TYPE_FULL_MASK(type) & MAY_BE_OBJECT) {
return 1;
static inheritance_status zend_perform_covariant_class_type_check(
zend_class_entry *fe_scope, zend_string *fe_class_name, zend_class_entry *fe_ce,
zend_class_entry *proto_scope, zend_type proto_type,
- zend_bool register_unresolved) {
- zend_bool have_unresolved = 0;
+ bool register_unresolved) {
+ bool have_unresolved = 0;
if (ZEND_TYPE_FULL_MASK(proto_type) & MAY_BE_OBJECT) {
/* Currently, any class name would be allowed here. We still perform a class lookup
* for forward-compatibility reasons, as we may have named types in the future that
}
zend_type *single_type;
- zend_bool all_success = 1;
+ bool all_success = 1;
/* First try to check whether we can succeed without resolving anything */
ZEND_TYPE_FOREACH(fe_type, single_type) {
{
uint32_t i, num_args, proto_num_args, fe_num_args;
inheritance_status status, local_status;
- zend_bool proto_is_variadic, fe_is_variadic;
+ bool proto_is_variadic, fe_is_variadic;
/* Checks for constructors only if they are declared in an interface,
* or explicitly marked as abstract
zend_function *child, zend_class_entry *child_scope,
zend_function *parent, zend_class_entry *parent_scope,
zend_class_entry *ce, zval *child_zv,
- zend_bool check_visibility, zend_bool check_only, zend_bool checked) /* {{{ */
+ bool check_visibility, bool check_only, bool checked) /* {{{ */
{
uint32_t child_flags;
uint32_t parent_flags = parent->common.fn_flags;
static zend_never_inline void do_inheritance_check_on_method(
zend_function *child, zend_class_entry *child_scope,
zend_function *parent, zend_class_entry *parent_scope,
- zend_class_entry *ce, zval *child_zv, zend_bool check_visibility)
+ zend_class_entry *ce, zval *child_zv, bool check_visibility)
{
do_inheritance_check_on_method_ex(child, child_scope, parent, parent_scope, ce, child_zv, check_visibility, 0, 0);
}
-static zend_always_inline void do_inherit_method(zend_string *key, zend_function *parent, zend_class_entry *ce, zend_bool is_interface, zend_bool checked) /* {{{ */
+static zend_always_inline void do_inherit_method(zend_string *key, zend_function *parent, zend_class_entry *ce, bool is_interface, bool checked) /* {{{ */
{
zval *child = zend_hash_find_ex(&ce->function_table, key, 1);
} ZEND_HASH_FOREACH_END();
}
-ZEND_API void zend_do_inheritance_ex(zend_class_entry *ce, zend_class_entry *parent_ce, zend_bool checked) /* {{{ */
+ZEND_API void zend_do_inheritance_ex(zend_class_entry *ce, zend_class_entry *parent_ce, bool checked) /* {{{ */
{
zend_property_info *property_info;
zend_function *func;
}
/* }}} */
-static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zend_class_constant *parent_constant, zend_string *name, const zend_class_entry *iface) /* {{{ */
+static bool do_inherit_constant_check(HashTable *child_constants_table, zend_class_constant *parent_constant, zend_string *name, const zend_class_entry *iface) /* {{{ */
{
zval *zv = zend_hash_find_ex(child_constants_table, name, 1);
zend_class_constant *old_constant;
zend_property_info *new_prop;
zend_string* prop_name;
const char* class_name_unused;
- zend_bool not_compatible;
+ bool not_compatible;
zval* prop_value;
uint32_t flags;
zend_string *doc_comment;
{
zend_function *func;
zend_abstract_info ai;
- zend_bool is_explicit_abstract = (ce->ce_flags & ZEND_ACC_EXPLICIT_ABSTRACT_CLASS) != 0;
+ bool is_explicit_abstract = (ce->ce_flags & ZEND_ACC_EXPLICIT_ABSTRACT_CLASS) != 0;
memset(&ai, 0, sizeof(ai));
ZEND_HASH_FOREACH_PTR(&ce->function_table, func) {
}
/* }}} */
-zend_bool zend_try_early_bind(zend_class_entry *ce, zend_class_entry *parent_ce, zend_string *lcname, zval *delayed_early_binding) /* {{{ */
+bool zend_try_early_bind(zend_class_entry *ce, zend_class_entry *parent_ce, zend_string *lcname, zval *delayed_early_binding) /* {{{ */
{
inheritance_status status = zend_can_early_bind(ce, parent_ce);
BEGIN_EXTERN_C()
ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface);
-ZEND_API void zend_do_inheritance_ex(zend_class_entry *ce, zend_class_entry *parent_ce, zend_bool checked);
+ZEND_API void zend_do_inheritance_ex(zend_class_entry *ce, zend_class_entry *parent_ce, bool checked);
#define zend_do_inheritance(ce, parent_ce) \
zend_do_inheritance_ex(ce, parent_ce, 0)
void zend_verify_abstract_class(zend_class_entry *ce);
void zend_build_properties_info_table(zend_class_entry *ce);
-zend_bool zend_try_early_bind(zend_class_entry *ce, zend_class_entry *parent_ce, zend_string *lcname, zval *delayed_early_binding);
+bool zend_try_early_bind(zend_class_entry *ce, zend_class_entry *parent_ce, zend_string *lcname, zval *delayed_early_binding);
END_EXTERN_C()
zend_ini_entry *ini_entry;
zend_string *duplicate;
uint8_t modifiable;
- zend_bool modified;
+ bool modified;
if ((ini_entry = zend_hash_find_ptr(EG(ini_directives), name)) == NULL) {
return FAILURE;
}
/* }}} */
-ZEND_API char *zend_ini_string_ex(const char *name, size_t name_length, int orig, zend_bool *exists) /* {{{ */
+ZEND_API char *zend_ini_string_ex(const char *name, size_t name_length, int orig, bool *exists) /* {{{ */
{
zend_ini_entry *ini_entry;
ZEND_API char *zend_ini_string(const char *name, size_t name_length, int orig) /* {{{ */
{
- zend_bool exists = 1;
+ bool exists = 1;
char *return_value;
return_value = zend_ini_string_ex(name, name_length, orig, &exists);
}
/* }}} */
-ZEND_API zend_bool zend_ini_parse_bool(zend_string *str)
+ZEND_API bool zend_ini_parse_bool(zend_string *str)
{
if ((ZSTR_LEN(str) == 4 && strcasecmp(ZSTR_VAL(str), "true") == 0)
|| (ZSTR_LEN(str) == 3 && strcasecmp(ZSTR_VAL(str), "yes") == 0)
/* Standard message handlers */
ZEND_API ZEND_INI_MH(OnUpdateBool) /* {{{ */
{
- zend_bool *p = (zend_bool *) ZEND_INI_GET_ADDR();
+ bool *p = (bool *) ZEND_INI_GET_ADDR();
*p = zend_ini_parse_bool(new_value);
return SUCCESS;
}
ZEND_API zend_long zend_ini_long(const char *name, size_t name_length, int orig);
ZEND_API double zend_ini_double(const char *name, size_t name_length, int orig);
ZEND_API char *zend_ini_string(const char *name, size_t name_length, int orig);
-ZEND_API char *zend_ini_string_ex(const char *name, size_t name_length, int orig, zend_bool *exists);
+ZEND_API char *zend_ini_string_ex(const char *name, size_t name_length, int orig, bool *exists);
ZEND_API zend_string *zend_ini_get_value(zend_string *name);
-ZEND_API zend_bool zend_ini_parse_bool(zend_string *str);
+ZEND_API bool zend_ini_parse_bool(zend_string *str);
ZEND_API zend_result zend_ini_register_displayer(const char *name, uint32_t name_length, void (*displayer)(zend_ini_entry *ini_entry, int type));
#define INI_INT(name) zend_ini_long((name), strlen(name), 0)
#define INI_FLT(name) zend_ini_double((name), strlen(name), 0)
#define INI_STR(name) zend_ini_string_ex((name), strlen(name), 0, NULL)
-#define INI_BOOL(name) ((zend_bool) INI_INT(name))
+#define INI_BOOL(name) ((bool) INI_INT(name))
#define INI_ORIG_INT(name) zend_ini_long((name), strlen(name), 1)
#define INI_ORIG_FLT(name) zend_ini_double((name), strlen(name), 1)
#define INI_ORIG_STR(name) zend_ini_string((name), strlen(name), 1)
-#define INI_ORIG_BOOL(name) ((zend_bool) INI_ORIG_INT(name))
+#define INI_ORIG_BOOL(name) ((bool) INI_ORIG_INT(name))
#define REGISTER_INI_ENTRIES() zend_register_ini_entries(ini_entries, module_number)
#define UNREGISTER_INI_ENTRIES() zend_unregister_ini_entries(module_number)
/* INI parsing engine */
typedef void (*zend_ini_parser_cb_t)(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg);
BEGIN_EXTERN_C()
-ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg);
-ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg);
+ZEND_API int zend_parse_ini_file(zend_file_handle *fh, bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg);
+ZEND_API int zend_parse_ini_string(char *str, bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg);
END_EXTERN_C()
/* INI entries */
/* }}} */
/* {{{ zend_parse_ini_file() */
-ZEND_API zend_result zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg)
+ZEND_API zend_result zend_parse_ini_file(zend_file_handle *fh, bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg)
{
int retval;
zend_ini_parser_param ini_parser_param;
/* }}} */
/* {{{ zend_parse_ini_string() */
-ZEND_API zend_result zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg)
+ZEND_API zend_result zend_parse_ini_string(char *str, bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg)
{
int retval;
zend_ini_parser_param ini_parser_param;
typedef struct {
zend_object std;
zend_object_iterator *iter;
- zend_bool rewind_called;
+ bool rewind_called;
} zend_internal_iterator;
static zend_object *zend_internal_iterator_create(zend_class_entry *ce) {
char *label;
int length;
int indentation;
- zend_bool indentation_uses_spaces;
+ bool indentation_uses_spaces;
} zend_heredoc_label;
/* Track locations of unclosed {, [, (, etc. for better syntax error reporting */
static zend_op_array *zend_compile(int type)
{
zend_op_array *op_array = NULL;
- zend_bool original_in_compilation = CG(in_compilation);
+ bool original_in_compilation = CG(in_compilation);
CG(in_compilation) = 1;
CG(ast) = NULL;
ZEND_API zend_ast *zend_compile_string_to_ast(
zend_string *code, zend_arena **ast_arena, const char *filename) {
zval code_zv;
- zend_bool original_in_compilation;
+ bool original_in_compilation;
zend_lex_state original_lex_state;
zend_ast *ast;
/* cache where we started so we can parse after validating */
char *start = s + 1;
size_t len = 0;
- zend_bool valid = 1;
+ bool valid = 1;
unsigned long codepoint;
if (*start != '{') {
return NULL;
}
-static zend_bool strip_multiline_string_indentation(
- zval *zendlval, int indentation, zend_bool using_spaces,
- zend_bool newline_at_start, zend_bool newline_at_end)
+static bool strip_multiline_string_indentation(
+ zval *zendlval, int indentation, bool using_spaces,
+ bool newline_at_start, bool newline_at_end)
{
const char *str = Z_STRVAL_P(zendlval), *end = str + Z_STRLEN_P(zendlval);
char *copy = Z_STRVAL_P(zendlval);
/* The +/- 2 skips "0b" */
size_t len = yyleng - 2;
char *end, *bin = yytext + 2;
- zend_bool contains_underscores;
+ bool contains_underscores;
/* Skip any leading 0s */
while (len > 0 && (*bin == '0' || *bin == '_')) {
/* The +/- 2 skips "0o" */
size_t len = yyleng - 2;
char *end, *octal = yytext + 2;
- zend_bool contains_underscores = (memchr(octal, '_', len) != NULL);
+ bool contains_underscores = (memchr(octal, '_', len) != NULL);
/* Skip any leading 0s */
while (len > 0 && (*octal == '0' || *octal == '_')) {
<ST_IN_SCRIPTING>{LNUM} {
size_t len = yyleng;
char *end, *lnum = yytext;
- zend_bool is_octal = lnum[0] == '0';
- zend_bool contains_underscores = (memchr(lnum, '_', len) != NULL);
+ bool is_octal = lnum[0] == '0';
+ bool contains_underscores = (memchr(lnum, '_', len) != NULL);
if (contains_underscores) {
lnum = estrndup(lnum, len);
/* The +/- 2 skips "0x" */
size_t len = yyleng - 2;
char *end, *hex = yytext + 2;
- zend_bool contains_underscores;
+ bool contains_underscores;
/* Skip any leading 0s */
while (len > 0 && (*hex == '0' || *hex == '_')) {
const char *end;
size_t len = yyleng;
char *dnum = yytext;
- zend_bool contains_underscores = (memchr(dnum, '_', len) != NULL);
+ bool contains_underscores = (memchr(dnum, '_', len) != NULL);
if (contains_underscores) {
dnum = estrndup(dnum, len);
unsigned char *saved_cursor;
int bprefix = (yytext[0] != '<') ? 1 : 0, spacing = 0, indentation = 0;
zend_heredoc_label *heredoc_label = emalloc(sizeof(zend_heredoc_label));
- zend_bool is_heredoc = 1;
+ bool is_heredoc = 1;
CG(zend_lineno)++;
heredoc_label->length = yyleng-bprefix-3-1-(yytext[yyleng-2]=='\r'?1:0);
ZVAL_STRINGL(zendlval, yytext, yyleng - newline);
if (!SCNG(heredoc_scan_ahead) && !EG(exception) && PARSER_MODE()) {
- zend_bool newline_at_start = *(yytext - 1) == '\n' || *(yytext - 1) == '\r';
+ bool newline_at_start = *(yytext - 1) == '\n' || *(yytext - 1) == '\r';
zend_string *copy = Z_STR_P(zendlval);
if (!strip_multiline_string_indentation(
ZVAL_STRINGL(zendlval, yytext, yyleng - newline);
if (!EG(exception) && spacing != -1 && PARSER_MODE()) {
- zend_bool newline_at_start = *(yytext - 1) == '\n' || *(yytext - 1) == '\r';
+ bool newline_at_start = *(yytext - 1) == '\n' || *(yytext - 1) == '\r';
if (!strip_multiline_string_indentation(
zendlval, indentation, spacing == HEREDOC_USING_SPACES,
newline_at_start, newline != 0)) {
/* }}} */
-static zend_always_inline zend_bool is_derived_class(zend_class_entry *child_class, zend_class_entry *parent_class) /* {{{ */
+static zend_always_inline bool is_derived_class(zend_class_entry *child_class, zend_class_entry *parent_class) /* {{{ */
{
child_class = child_class->parent;
while (child_class) {
}
/* }}} */
-ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name, zend_bool is_dynamic) /* {{{ */
+ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name, bool is_dynamic) /* {{{ */
{
zend_property_info *property_info;
const char *class_name = NULL;
}
/* }}} */
-static zend_always_inline zend_bool property_uses_strict_types() {
+static zend_always_inline bool property_uses_strict_types() {
zend_execute_data *execute_data = EG(current_execute_data);
return execute_data
&& execute_data->func
return zend_std_get_static_property_with_info(ce, property_name, type, &prop_info);
}
-ZEND_API ZEND_COLD zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name) /* {{{ */
+ZEND_API ZEND_COLD bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name) /* {{{ */
{
zend_throw_error(NULL, "Attempt to unset static property %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(property_name));
return 0;
}
/* }}} */
-ZEND_API int zend_std_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, zend_bool check_only) /* {{{ */
+ZEND_API int zend_std_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only) /* {{{ */
{
zval *func;
zend_class_entry *ce = obj->ce;
* Returns FAILURE if the object does not have any sense of overloaded dimensions */
typedef int (*zend_object_count_elements_t)(zend_object *object, zend_long *count);
-typedef int (*zend_object_get_closure_t)(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, zend_bool check_only);
+typedef int (*zend_object_get_closure_t)(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only);
typedef HashTable *(*zend_object_get_gc_t)(zend_object *object, zval **table, int *n);
ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name_strval, const zval *key);
ZEND_API zval *zend_std_get_static_property_with_info(zend_class_entry *ce, zend_string *property_name, int type, struct _zend_property_info **prop_info);
ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, int type);
-ZEND_API ZEND_COLD zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name);
+ZEND_API ZEND_COLD bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name);
ZEND_API zend_function *zend_std_get_constructor(zend_object *object);
ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_string *member, int silent);
ZEND_API HashTable *zend_std_get_properties(zend_object *object);
ZEND_API zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string *method_name, const zval *key);
ZEND_API zend_string *zend_std_get_class_name(const zend_object *zobj);
ZEND_API int zend_std_compare_objects(zval *o1, zval *o2);
-ZEND_API int zend_std_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, zend_bool check_only);
+ZEND_API int zend_std_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only);
ZEND_API void rebuild_object_properties(zend_object *zobj);
ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope);
-ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name, zend_bool is_dynamic);
+ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name, bool is_dynamic);
ZEND_API zend_function *zend_get_call_trampoline_func(zend_class_entry *ce, zend_string *method_name, int is_static);
}
}
-ZEND_API void ZEND_FASTCALL zend_objects_store_free_object_storage(zend_objects_store *objects, zend_bool fast_shutdown)
+ZEND_API void ZEND_FASTCALL zend_objects_store_free_object_storage(zend_objects_store *objects, bool fast_shutdown)
{
zend_object **obj_ptr, **end, *obj;
ZEND_API void ZEND_FASTCALL zend_objects_store_init(zend_objects_store *objects, uint32_t init_size);
ZEND_API void ZEND_FASTCALL zend_objects_store_call_destructors(zend_objects_store *objects);
ZEND_API void ZEND_FASTCALL zend_objects_store_mark_destructed(zend_objects_store *objects);
-ZEND_API void ZEND_FASTCALL zend_objects_store_free_object_storage(zend_objects_store *objects, zend_bool fast_shutdown);
+ZEND_API void ZEND_FASTCALL zend_objects_store_free_object_storage(zend_objects_store *objects, bool fast_shutdown);
ZEND_API void ZEND_FASTCALL zend_objects_store_destroy(zend_objects_store *objects);
/* Store API functions */
zend_function_dtor(&tmp);
}
-ZEND_API void zend_type_release(zend_type type, zend_bool persistent) {
+ZEND_API void zend_type_release(zend_type type, bool persistent) {
if (ZEND_TYPE_HAS_LIST(type)) {
zend_type *list_type;
ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(type), list_type) {
emit_live_range_raw(op_array, var_num, kind, start, end);
}
-static zend_bool is_fake_def(zend_op *opline) {
+static bool is_fake_def(zend_op *opline) {
/* These opcodes only modify the result, not create it. */
return opline->opcode == ZEND_ROPE_ADD
|| opline->opcode == ZEND_ADD_ARRAY_ELEMENT
|| opline->opcode == ZEND_ADD_ARRAY_UNPACK;
}
-static zend_bool keeps_op1_alive(zend_op *opline) {
+static bool keeps_op1_alive(zend_op *opline) {
/* These opcodes don't consume their OP1 operand,
* it is later freed by something else. */
if (opline->opcode == ZEND_CASE
}
/* }}} */
-static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(zval *op, zend_bool *failed) /* {{{ */
+static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(zval *op, bool *failed) /* {{{ */
{
*failed = 0;
switch (Z_TYPE_P(op)) {
#define convert_op1_op2_long(op1, op1_lval, op2, op2_lval, result, opcode, sigil) \
do { \
if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) { \
- zend_bool failed; \
+ bool failed; \
if (Z_ISREF_P(op1)) { \
op1 = Z_REFVAL_P(op1); \
if (Z_TYPE_P(op1) == IS_LONG) { \
} while (0); \
do { \
if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) { \
- zend_bool failed; \
+ bool failed; \
if (Z_ISREF_P(op2)) { \
op2 = Z_REFVAL_P(op2); \
if (Z_TYPE_P(op2) == IS_LONG) { \
}
/* }}} */
-ZEND_API zend_bool ZEND_FASTCALL _try_convert_to_string(zval *op) /* {{{ */
+ZEND_API bool ZEND_FASTCALL _try_convert_to_string(zval *op) /* {{{ */
{
zend_string *str;
}
/* }}} */
-static zend_always_inline zend_string* __zval_get_string_func(zval *op, zend_bool try) /* {{{ */
+static zend_always_inline zend_string* __zval_get_string_func(zval *op, bool try) /* {{{ */
{
try_again:
switch (Z_TYPE_P(op)) {
}
if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) {
- zend_bool failed;
+ bool failed;
ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(ZEND_BW_OR);
op1_lval = zendi_try_get_long(op1, &failed);
if (UNEXPECTED(failed)) {
op1_lval = Z_LVAL_P(op1);
}
if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) {
- zend_bool failed;
+ bool failed;
ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_BW_OR);
op2_lval = zendi_try_get_long(op2, &failed);
if (UNEXPECTED(failed)) {
}
if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) {
- zend_bool failed;
+ bool failed;
ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(ZEND_BW_AND);
op1_lval = zendi_try_get_long(op1, &failed);
if (UNEXPECTED(failed)) {
op1_lval = Z_LVAL_P(op1);
}
if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) {
- zend_bool failed;
+ bool failed;
ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_BW_AND);
op2_lval = zendi_try_get_long(op2, &failed);
if (UNEXPECTED(failed)) {
}
if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) {
- zend_bool failed;
+ bool failed;
ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(ZEND_BW_XOR);
op1_lval = zendi_try_get_long(op1, &failed);
if (UNEXPECTED(failed)) {
op1_lval = Z_LVAL_P(op1);
}
if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) {
- zend_bool failed;
+ bool failed;
ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_BW_XOR);
op2_lval = zendi_try_get_long(op2, &failed);
if (UNEXPECTED(failed)) {
}
/* }}} */
-ZEND_API int ZEND_FASTCALL string_compare_function_ex(zval *op1, zval *op2, zend_bool case_insensitive) /* {{{ */
+ZEND_API int ZEND_FASTCALL string_compare_function_ex(zval *op1, zval *op2, bool case_insensitive) /* {{{ */
{
zend_string *tmp_str1, *tmp_str2;
zend_string *str1 = zval_get_tmp_string(op1, &tmp_str1);
}
/* }}} */
-ZEND_API zend_bool ZEND_FASTCALL zend_is_identical(zval *op1, zval *op2) /* {{{ */
+ZEND_API bool ZEND_FASTCALL zend_is_identical(zval *op1, zval *op2) /* {{{ */
{
if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) {
return 0;
}
/* }}} */
-ZEND_API zend_bool ZEND_FASTCALL zend_class_implements_interface(const zend_class_entry *class_ce, const zend_class_entry *interface_ce) /* {{{ */
+ZEND_API bool ZEND_FASTCALL zend_class_implements_interface(const zend_class_entry *class_ce, const zend_class_entry *interface_ce) /* {{{ */
{
uint32_t i;
ZEND_ASSERT(!(class_ce->ce_flags & ZEND_ACC_INTERFACE));
}
/* }}} */
-ZEND_API zend_bool ZEND_FASTCALL instanceof_function_slow(const zend_class_entry *instance_ce, const zend_class_entry *ce) /* {{{ */
+ZEND_API bool ZEND_FASTCALL instanceof_function_slow(const zend_class_entry *instance_ce, const zend_class_entry *ce) /* {{{ */
{
ZEND_ASSERT(instance_ce != ce && "Should have been checked already");
if (ce->ce_flags & ZEND_ACC_INTERFACE) {
ZEND_API zend_result ZEND_FASTCALL shift_right_function(zval *result, zval *op1, zval *op2);
ZEND_API zend_result ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2);
-ZEND_API zend_bool ZEND_FASTCALL zend_is_identical(zval *op1, zval *op2);
+ZEND_API bool ZEND_FASTCALL zend_is_identical(zval *op1, zval *op2);
ZEND_API zend_result ZEND_FASTCALL is_equal_function(zval *result, zval *op1, zval *op2);
ZEND_API zend_result ZEND_FASTCALL is_identical_function(zval *result, zval *op1, zval *op2);
ZEND_API zend_result ZEND_FASTCALL is_smaller_function(zval *result, zval *op1, zval *op2);
ZEND_API zend_result ZEND_FASTCALL is_smaller_or_equal_function(zval *result, zval *op1, zval *op2);
-ZEND_API zend_bool ZEND_FASTCALL zend_class_implements_interface(const zend_class_entry *class_ce, const zend_class_entry *interface_ce);
-ZEND_API zend_bool ZEND_FASTCALL instanceof_function_slow(const zend_class_entry *instance_ce, const zend_class_entry *ce);
+ZEND_API bool ZEND_FASTCALL zend_class_implements_interface(const zend_class_entry *class_ce, const zend_class_entry *interface_ce);
+ZEND_API bool ZEND_FASTCALL instanceof_function_slow(const zend_class_entry *instance_ce, const zend_class_entry *ce);
-static zend_always_inline zend_bool instanceof_function(
+static zend_always_inline bool instanceof_function(
const zend_class_entry *instance_ce, const zend_class_entry *ce) {
return instance_ce == ce || instanceof_function_slow(instance_ce, ce);
}
/* Like convert_to_string(), but returns whether the conversion succeeded and does not modify the
* zval in-place if it fails. */
-ZEND_API zend_bool ZEND_FASTCALL _try_convert_to_string(zval *op);
-static zend_always_inline zend_bool try_convert_to_string(zval *op) {
+ZEND_API bool ZEND_FASTCALL _try_convert_to_string(zval *op);
+static zend_always_inline bool try_convert_to_string(zval *op) {
if (Z_TYPE_P(op) == IS_STRING) {
return 1;
}
ZEND_API zend_result ZEND_FASTCALL compare_function(zval *result, zval *op1, zval *op2);
ZEND_API int ZEND_FASTCALL numeric_compare_function(zval *op1, zval *op2);
-ZEND_API int ZEND_FASTCALL string_compare_function_ex(zval *op1, zval *op2, zend_bool case_insensitive);
+ZEND_API int ZEND_FASTCALL string_compare_function_ex(zval *op1, zval *op2, bool case_insensitive);
ZEND_API int ZEND_FASTCALL string_compare_function(zval *op1, zval *op2);
ZEND_API int ZEND_FASTCALL string_case_compare_function(zval *op1, zval *op2);
ZEND_API int ZEND_FASTCALL string_locale_compare_function(zval *op1, zval *op2);
return zend_compare(op1, op2) == 0;
}
-static zend_always_inline zend_bool fast_is_identical_function(zval *op1, zval *op2)
+static zend_always_inline bool fast_is_identical_function(zval *op1, zval *op2)
{
if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) {
return 0;
return zend_is_identical(op1, op2);
}
-static zend_always_inline zend_bool fast_is_not_identical_function(zval *op1, zval *op2)
+static zend_always_inline bool fast_is_not_identical_function(zval *op1, zval *op2)
{
if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) {
return 1;
#if (defined(HAVE_ALLOCA) || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN)
# define ZEND_ALLOCA_MAX_SIZE (32 * 1024)
# define ALLOCA_FLAG(name) \
- zend_bool name;
+ bool name;
# define SET_ALLOCA_FLAG(name) \
name = 1
# define do_alloca_ex(size, limit, use_heap) \
#include "zend_ptr_stack.h"
#include <stdarg.h>
-ZEND_API void zend_ptr_stack_init_ex(zend_ptr_stack *stack, zend_bool persistent)
+ZEND_API void zend_ptr_stack_init_ex(zend_ptr_stack *stack, bool persistent)
{
stack->top_element = stack->elements = NULL;
stack->top = stack->max = 0;
}
-ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elements)
+ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), bool free_elements)
{
zend_ptr_stack_apply(stack, func);
if (free_elements) {
int top, max;
void **elements;
void **top_element;
- zend_bool persistent;
+ bool persistent;
} zend_ptr_stack;
BEGIN_EXTERN_C()
ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack);
-ZEND_API void zend_ptr_stack_init_ex(zend_ptr_stack *stack, zend_bool persistent);
+ZEND_API void zend_ptr_stack_init_ex(zend_ptr_stack *stack, bool persistent);
ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...);
ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...);
ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack);
ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *));
ZEND_API void zend_ptr_stack_reverse_apply(zend_ptr_stack *stack, void (*func)(void *));
-ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elements);
+ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), bool free_elements);
ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack);
END_EXTERN_C()
int blocked; /* 1==TRUE, 0==FALSE */
int running; /* in signal handler execution */
int active; /* internal signal handling is enabled */
- zend_bool check; /* check for replaced handlers on shutdown */
- zend_bool reset; /* reset signal handlers on each request */
+ bool check; /* check for replaced handlers on shutdown */
+ bool reset; /* reset signal handlers on each request */
zend_signal_entry_t handlers[NSIG];
zend_signal_queue_t pstorage[ZEND_SIGNAL_QUEUE_SIZE], *phead, *ptail, *pavail; /* pending queue */
} zend_signal_globals_t;
END_EXTERN_C()
-static zend_always_inline size_t smart_str_alloc(smart_str *str, size_t len, zend_bool persistent) {
+static zend_always_inline size_t smart_str_alloc(smart_str *str, size_t len, bool persistent) {
if (UNEXPECTED(!str->s)) {
goto do_smart_str_realloc;
} else {
return len;
}
-static zend_always_inline char* smart_str_extend_ex(smart_str *dest, size_t len, zend_bool persistent) {
+static zend_always_inline char* smart_str_extend_ex(smart_str *dest, size_t len, bool persistent) {
size_t new_len = smart_str_alloc(dest, len, persistent);
char *ret = ZSTR_VAL(dest->s) + ZSTR_LEN(dest->s);
ZSTR_LEN(dest->s) = new_len;
return ret;
}
-static zend_always_inline void smart_str_free_ex(smart_str *str, zend_bool persistent) {
+static zend_always_inline void smart_str_free_ex(smart_str *str, bool persistent) {
if (str->s) {
zend_string_release_ex(str->s, persistent);
str->s = NULL;
}
}
-static zend_always_inline void smart_str_appendc_ex(smart_str *dest, char ch, zend_bool persistent) {
+static zend_always_inline void smart_str_appendc_ex(smart_str *dest, char ch, bool persistent) {
size_t new_len = smart_str_alloc(dest, 1, persistent);
ZSTR_VAL(dest->s)[new_len - 1] = ch;
ZSTR_LEN(dest->s) = new_len;
}
-static zend_always_inline void smart_str_appendl_ex(smart_str *dest, const char *str, size_t len, zend_bool persistent) {
+static zend_always_inline void smart_str_appendl_ex(smart_str *dest, const char *str, size_t len, bool persistent) {
size_t new_len = smart_str_alloc(dest, len, persistent);
memcpy(ZSTR_VAL(dest->s) + ZSTR_LEN(dest->s), str, len);
ZSTR_LEN(dest->s) = new_len;
}
-static zend_always_inline void smart_str_append_ex(smart_str *dest, const zend_string *src, zend_bool persistent) {
+static zend_always_inline void smart_str_append_ex(smart_str *dest, const zend_string *src, bool persistent) {
smart_str_appendl_ex(dest, ZSTR_VAL(src), ZSTR_LEN(src), persistent);
}
-static zend_always_inline void smart_str_append_smart_str_ex(smart_str *dest, const smart_str *src, zend_bool persistent) {
+static zend_always_inline void smart_str_append_smart_str_ex(smart_str *dest, const smart_str *src, bool persistent) {
if (src->s && ZSTR_LEN(src->s)) {
smart_str_append_ex(dest, src->s, persistent);
}
}
-static zend_always_inline void smart_str_append_long_ex(smart_str *dest, zend_long num, zend_bool persistent) {
+static zend_always_inline void smart_str_append_long_ex(smart_str *dest, zend_long num, bool persistent) {
char buf[32];
char *result = zend_print_long_to_buf(buf + sizeof(buf) - 1, num);
smart_str_appendl_ex(dest, result, buf + sizeof(buf) - 1 - result, persistent);
}
-static zend_always_inline void smart_str_append_unsigned_ex(smart_str *dest, zend_ulong num, zend_bool persistent) {
+static zend_always_inline void smart_str_append_unsigned_ex(smart_str *dest, zend_ulong num, bool persistent) {
char buf[32];
char *result = zend_print_ulong_to_buf(buf + sizeof(buf) - 1, num);
smart_str_appendl_ex(dest, result, buf + sizeof(buf) - 1 - result, persistent);
ZEND_API void ZEND_FASTCALL _smart_string_alloc_persistent(smart_string *str, size_t len);
ZEND_API void ZEND_FASTCALL _smart_string_alloc(smart_string *str, size_t len);
-static zend_always_inline size_t smart_string_alloc(smart_string *str, size_t len, zend_bool persistent) {
+static zend_always_inline size_t smart_string_alloc(smart_string *str, size_t len, bool persistent) {
if (UNEXPECTED(!str->c) || UNEXPECTED(len >= str->a - str->len)) {
if (persistent) {
_smart_string_alloc_persistent(str, len);
return str->len + len;
}
-static zend_always_inline void smart_string_free_ex(smart_string *str, zend_bool persistent) {
+static zend_always_inline void smart_string_free_ex(smart_string *str, bool persistent) {
if (str->c) {
pefree(str->c, persistent);
str->c = NULL;
}
}
-static zend_always_inline void smart_string_appendc_ex(smart_string *dest, char ch, zend_bool persistent) {
+static zend_always_inline void smart_string_appendc_ex(smart_string *dest, char ch, bool persistent) {
dest->len = smart_string_alloc(dest, 1, persistent);
dest->c[dest->len - 1] = ch;
}
-static zend_always_inline void smart_string_appendl_ex(smart_string *dest, const char *str, size_t len, zend_bool persistent) {
+static zend_always_inline void smart_string_appendl_ex(smart_string *dest, const char *str, size_t len, bool persistent) {
size_t new_len = smart_string_alloc(dest, len, persistent);
memcpy(dest->c + dest->len, str, len);
dest->len = new_len;
}
-static zend_always_inline void smart_string_append_long_ex(smart_string *dest, zend_long num, zend_bool persistent) {
+static zend_always_inline void smart_string_append_long_ex(smart_string *dest, zend_long num, bool persistent) {
char buf[32];
char *result = zend_print_long_to_buf(buf + sizeof(buf) - 1, num);
smart_string_appendl_ex(dest, result, buf + sizeof(buf) - 1 - result, persistent);
}
-static zend_always_inline void smart_string_append_unsigned_ex(smart_string *dest, zend_ulong num, zend_bool persistent) {
+static zend_always_inline void smart_string_append_unsigned_ex(smart_string *dest, zend_ulong num, bool persistent) {
char buf[32];
char *result = zend_print_ulong_to_buf(buf + sizeof(buf) - 1, num);
smart_string_appendl_ex(dest, result, buf + sizeof(buf) - 1 - result, persistent);
}
}
-ZEND_API void zend_stack_clean(zend_stack *stack, void (*func)(void *), zend_bool free_elements)
+ZEND_API void zend_stack_clean(zend_stack *stack, void (*func)(void *), bool free_elements)
{
int i;
ZEND_API int zend_stack_count(const zend_stack *stack);
ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element));
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg);
-ZEND_API void zend_stack_clean(zend_stack *stack, void (*func)(void *), zend_bool free_elements);
+ZEND_API void zend_stack_clean(zend_stack *stack, void (*func)(void *), bool free_elements);
END_EXTERN_C()
#define ZEND_STACK_APPLY_TOPDOWN 1
zend_stream_type type;
/* free_filename is used by wincache */
/* TODO: Clean up filename vs opened_path mess */
- zend_bool free_filename;
+ bool free_filename;
char *buf;
size_t len;
} zend_file_handle;
interned_string_init_request_handler = init_handler;
}
-ZEND_API void zend_interned_strings_switch_storage(zend_bool request)
+ZEND_API void zend_interned_strings_switch_storage(bool request)
{
if (request) {
zend_new_interned_string = interned_string_request_handler;
}
#if defined(__GNUC__) && defined(__i386__)
-ZEND_API zend_bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_string *s2)
+ZEND_API bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_string *s2)
{
char *ptr = ZSTR_VAL(s1);
size_t delta = (char*)s2 - (char*)s1;
}
#ifdef HAVE_VALGRIND
-ZEND_API zend_bool ZEND_FASTCALL I_WRAP_SONAME_FNNAME_ZU(NONE,zend_string_equal_val)(zend_string *s1, zend_string *s2)
+ZEND_API bool ZEND_FASTCALL I_WRAP_SONAME_FNNAME_ZU(NONE,zend_string_equal_val)(zend_string *s1, zend_string *s2)
{
size_t len = ZSTR_LEN(s1);
char *ptr1 = ZSTR_VAL(s1);
#endif
#elif defined(__GNUC__) && defined(__x86_64__) && !defined(__ILP32__)
-ZEND_API zend_bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_string *s2)
+ZEND_API bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_string *s2)
{
char *ptr = ZSTR_VAL(s1);
size_t delta = (char*)s2 - (char*)s1;
}
#ifdef HAVE_VALGRIND
-ZEND_API zend_bool ZEND_FASTCALL I_WRAP_SONAME_FNNAME_ZU(NONE,zend_string_equal_val)(zend_string *s1, zend_string *s2)
+ZEND_API bool ZEND_FASTCALL I_WRAP_SONAME_FNNAME_ZU(NONE,zend_string_equal_val)(zend_string *s1, zend_string *s2)
{
size_t len = ZSTR_LEN(s1);
char *ptr1 = ZSTR_VAL(s1);
ZEND_API void zend_interned_strings_activate(void);
ZEND_API void zend_interned_strings_deactivate(void);
ZEND_API void zend_interned_strings_set_request_storage_handlers(zend_new_interned_string_func_t handler, zend_string_init_interned_func_t init_handler);
-ZEND_API void zend_interned_strings_switch_storage(zend_bool request);
+ZEND_API void zend_interned_strings_switch_storage(bool request);
ZEND_API extern zend_string *zend_empty_string;
ZEND_API extern zend_string *zend_one_char_string[256];
#if defined(__GNUC__) && (defined(__i386__) || (defined(__x86_64__) && !defined(__ILP32__)))
BEGIN_EXTERN_C()
-ZEND_API zend_bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_string *s2);
+ZEND_API bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_string *s2);
END_EXTERN_C()
#else
-static zend_always_inline zend_bool zend_string_equal_val(zend_string *s1, zend_string *s2)
+static zend_always_inline bool zend_string_equal_val(zend_string *s1, zend_string *s2)
{
return !memcmp(ZSTR_VAL(s1), ZSTR_VAL(s2), ZSTR_LEN(s1));
}
#endif
-static zend_always_inline zend_bool zend_string_equal_content(zend_string *s1, zend_string *s2)
+static zend_always_inline bool zend_string_equal_content(zend_string *s1, zend_string *s2)
{
return ZSTR_LEN(s1) == ZSTR_LEN(s2) && zend_string_equal_val(s1, s2);
}
-static zend_always_inline zend_bool zend_string_equals(zend_string *s1, zend_string *s2)
+static zend_always_inline bool zend_string_equals(zend_string *s1, zend_string *s2)
{
return s1 == s2 || zend_string_equal_content(s1, s2);
}
}
/* delegates */
-ZEND_API void zend_ts_hash_init(TsHashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent)
+ZEND_API void zend_ts_hash_init(TsHashTable *ht, uint32_t nSize, dtor_func_t pDestructor, bool persistent)
{
#ifdef ZTS
ht->mx_reader = tsrm_mutex_alloc();
end_write(ht);
}
-ZEND_API int zend_ts_hash_compare(TsHashTable *ht1, TsHashTable *ht2, compare_func_t compar, zend_bool ordered)
+ZEND_API int zend_ts_hash_compare(TsHashTable *ht1, TsHashTable *ht2, compare_func_t compar, bool ordered)
{
int retval;
#define TS_HASH(table) (&(table->hash))
/* startup/shutdown */
-ZEND_API void zend_ts_hash_init(TsHashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent);
+ZEND_API void zend_ts_hash_init(TsHashTable *ht, uint32_t nSize, dtor_func_t pDestructor, bool persistent);
ZEND_API void zend_ts_hash_destroy(TsHashTable *ht);
ZEND_API void zend_ts_hash_clean(TsHashTable *ht);
ZEND_API void zend_ts_hash_merge(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, bool overwrite);
ZEND_API void zend_ts_hash_merge_ex(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, merge_checker_func_t pMergeSource, void *pParam);
ZEND_API void zend_ts_hash_sort(TsHashTable *ht, sort_func_t sort_func, bucket_compare_func_t compare_func, bool renumber);
-ZEND_API int zend_ts_hash_compare(TsHashTable *ht1, TsHashTable *ht2, compare_func_t compar, zend_bool ordered);
+ZEND_API int zend_ts_hash_compare(TsHashTable *ht1, TsHashTable *ht2, compare_func_t compar, bool ordered);
ZEND_API zval *zend_ts_hash_minmax(TsHashTable *ht, bucket_compare_func_t compar, int flag);
ZEND_API int zend_ts_hash_num_elements(TsHashTable *ht);
#endif
#if ZEND_RC_DEBUG
-extern ZEND_API zend_bool zend_rc_debug;
+extern ZEND_API bool zend_rc_debug;
# define ZEND_RC_MOD_CHECK(p) do { \
if (zend_rc_debug && zval_gc_type((p)->u.type_info) != IS_OBJECT) { \
ZEND_ASSERT(!(zval_gc_flags((p)->u.type_info) & GC_IMMUTABLE)); \
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R);
EG(current_execute_data) = call;
#if ZEND_DEBUG
- zend_bool should_throw = zend_internal_call_should_throw(fbc, call);
+ bool should_throw = zend_internal_call_should_throw(fbc, call);
#endif
ret = RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : &retval;
EG(current_execute_data) = call;
#if ZEND_DEBUG
- zend_bool should_throw = zend_internal_call_should_throw(fbc, call);
+ bool should_throw = zend_internal_call_should_throw(fbc, call);
#endif
ret = RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : &retval;
EG(current_execute_data) = call;
#if ZEND_DEBUG
- zend_bool should_throw = zend_internal_call_should_throw(fbc, call);
+ bool should_throw = zend_internal_call_should_throw(fbc, call);
#endif
ret = RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : &retval;
HashTable *ht = Z_ARRVAL_P(args);
zval *arg, *top;
zend_string *name;
- zend_bool have_named_params = 0;
+ bool have_named_params = 0;
zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, zend_hash_num_elements(ht));
} else if (EXPECTED(Z_TYPE_P(args) == IS_OBJECT)) {
zend_class_entry *ce = Z_OBJCE_P(args);
zend_object_iterator *iter;
- zend_bool have_named_params = 0;
+ bool have_named_params = 0;
if (!ce || !ce->get_iterator) {
zend_type_error("Only arrays and Traversables can be unpacked");
arg_num = 1;
param = ZEND_CALL_ARG(EX(call), 1);
ZEND_HASH_FOREACH_VAL(ht, arg) {
- zend_bool must_wrap = 0;
+ bool must_wrap = 0;
if (skip > 0) {
skip--;
continue;
FREE_OP2();
} else {
zend_string *name;
- zend_bool have_named_params;
+ bool have_named_params;
zend_vm_stack_extend_call_frame(&EX(call), 0, zend_hash_num_elements(ht));
arg_num = 1;
param = ZEND_CALL_ARG(EX(call), 1);
HANDLE_EXCEPTION();
}
- zend_bool must_wrap = 0;
+ bool must_wrap = 0;
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
if (UNEXPECTED(!Z_ISREF_P(arg))) {
if (!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
FREE_OP1_IF_VAR();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
- zend_bool is_empty = zend_fe_reset_iterator(array_ptr, 0 OPLINE_CC EXECUTE_DATA_CC);
+ bool is_empty = zend_fe_reset_iterator(array_ptr, 0 OPLINE_CC EXECUTE_DATA_CC);
FREE_OP1();
if (UNEXPECTED(EG(exception))) {
FREE_OP1_VAR_PTR();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
- zend_bool is_empty = zend_fe_reset_iterator(array_ptr, 1 OPLINE_CC EXECUTE_DATA_CC);
+ bool is_empty = zend_fe_reset_iterator(array_ptr, 1 OPLINE_CC EXECUTE_DATA_CC);
if (OP1_TYPE == IS_VAR) {
FREE_OP1_VAR_PTR();
zval *key, *subject;
HashTable *ht;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
{
USE_OPLINE
zval *expr;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
expr = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
FREE_OP1();
ZEND_VM_NEXT_OPCODE();
} else {
- zend_bool strict;
+ bool strict;
if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_TYPE_P(value) == IS_REFERENCE) {
value = Z_REFVAL_P(value);
EG(current_execute_data) = call;
#if ZEND_DEBUG
- zend_bool should_throw = zend_internal_call_should_throw(fbc, call);
+ bool should_throw = zend_internal_call_should_throw(fbc, call);
#endif
if (ret == NULL) {
/* (Infinite recursion when comparing arrays is an uncatchable fatal error) */
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
EG(current_execute_data) = call;
#if ZEND_DEBUG
- zend_bool should_throw = zend_internal_call_should_throw(fbc, call);
+ bool should_throw = zend_internal_call_should_throw(fbc, call);
#endif
ret = 0 ? EX_VAR(opline->result.var) : &retval;
EG(current_execute_data) = call;
#if ZEND_DEBUG
- zend_bool should_throw = zend_internal_call_should_throw(fbc, call);
+ bool should_throw = zend_internal_call_should_throw(fbc, call);
#endif
ret = 1 ? EX_VAR(opline->result.var) : &retval;
EG(current_execute_data) = call;
#if ZEND_DEBUG
- zend_bool should_throw = zend_internal_call_should_throw(fbc, call);
+ bool should_throw = zend_internal_call_should_throw(fbc, call);
#endif
ret = 0 ? EX_VAR(opline->result.var) : &retval;
EG(current_execute_data) = call;
#if ZEND_DEBUG
- zend_bool should_throw = zend_internal_call_should_throw(fbc, call);
+ bool should_throw = zend_internal_call_should_throw(fbc, call);
#endif
ret = 1 ? EX_VAR(opline->result.var) : &retval;
EG(current_execute_data) = call;
#if ZEND_DEBUG
- zend_bool should_throw = zend_internal_call_should_throw(fbc, call);
+ bool should_throw = zend_internal_call_should_throw(fbc, call);
#endif
ret = RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : &retval;
EG(current_execute_data) = call;
#if ZEND_DEBUG
- zend_bool should_throw = zend_internal_call_should_throw(fbc, call);
+ bool should_throw = zend_internal_call_should_throw(fbc, call);
#endif
ret = 0 ? EX_VAR(opline->result.var) : &retval;
EG(current_execute_data) = call;
#if ZEND_DEBUG
- zend_bool should_throw = zend_internal_call_should_throw(fbc, call);
+ bool should_throw = zend_internal_call_should_throw(fbc, call);
#endif
ret = 1 ? EX_VAR(opline->result.var) : &retval;
EG(current_execute_data) = call;
#if ZEND_DEBUG
- zend_bool should_throw = zend_internal_call_should_throw(fbc, call);
+ bool should_throw = zend_internal_call_should_throw(fbc, call);
#endif
ret = RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : &retval;
HashTable *ht = Z_ARRVAL_P(args);
zval *arg, *top;
zend_string *name;
- zend_bool have_named_params = 0;
+ bool have_named_params = 0;
zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, zend_hash_num_elements(ht));
} else if (EXPECTED(Z_TYPE_P(args) == IS_OBJECT)) {
zend_class_entry *ce = Z_OBJCE_P(args);
zend_object_iterator *iter;
- zend_bool have_named_params = 0;
+ bool have_named_params = 0;
if (!ce || !ce->get_iterator) {
zend_type_error("Only arrays and Traversables can be unpacked");
arg_num = 1;
param = ZEND_CALL_ARG(EX(call), 1);
ZEND_HASH_FOREACH_VAL(ht, arg) {
- zend_bool must_wrap = 0;
+ bool must_wrap = 0;
if (skip > 0) {
skip--;
continue;
FREE_OP(opline->op2_type, opline->op2.var);
} else {
zend_string *name;
- zend_bool have_named_params;
+ bool have_named_params;
zend_vm_stack_extend_call_frame(&EX(call), 0, zend_hash_num_elements(ht));
arg_num = 1;
param = ZEND_CALL_ARG(EX(call), 1);
HANDLE_EXCEPTION();
}
- zend_bool must_wrap = 0;
+ bool must_wrap = 0;
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
if (UNEXPECTED(!Z_ISREF_P(arg))) {
if (!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
EG(current_execute_data) = call;
#if ZEND_DEBUG
- zend_bool should_throw = zend_internal_call_should_throw(fbc, call);
+ bool should_throw = zend_internal_call_should_throw(fbc, call);
#endif
if (ret == NULL) {
EG(current_execute_data) = call;
#if ZEND_DEBUG
- zend_bool should_throw = zend_internal_call_should_throw(fbc, call);
+ bool should_throw = zend_internal_call_should_throw(fbc, call);
#endif
if (ret == NULL) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
- zend_bool is_empty = zend_fe_reset_iterator(array_ptr, 0 OPLINE_CC EXECUTE_DATA_CC);
+ bool is_empty = zend_fe_reset_iterator(array_ptr, 0 OPLINE_CC EXECUTE_DATA_CC);
if (UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
- zend_bool is_empty = zend_fe_reset_iterator(array_ptr, 1 OPLINE_CC EXECUTE_DATA_CC);
+ bool is_empty = zend_fe_reset_iterator(array_ptr, 1 OPLINE_CC EXECUTE_DATA_CC);
if (IS_CONST == IS_VAR) {
ZEND_VM_NEXT_OPCODE();
} else {
- zend_bool strict;
+ bool strict;
if ((IS_CONST & (IS_VAR|IS_CV)) && Z_TYPE_P(value) == IS_REFERENCE) {
value = Z_REFVAL_P(value);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = RT_CONSTANT(opline, opline->op1);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = RT_CONSTANT(opline, opline->op1);
zval *key, *subject;
HashTable *ht;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
zval *key, *subject;
HashTable *ht;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
zval *key, *subject;
HashTable *ht;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
ZEND_VM_NEXT_OPCODE();
} else {
- zend_bool strict;
+ bool strict;
if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_TYPE_P(value) == IS_REFERENCE) {
value = Z_REFVAL_P(value);
zval *key, *subject;
HashTable *ht;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
{
USE_OPLINE
zval *expr;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
expr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC);
zval *key, *subject;
HashTable *ht;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
{
USE_OPLINE
zval *expr;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
expr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *expr;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
expr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC);
zval *key, *subject;
HashTable *ht;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
- zend_bool is_empty = zend_fe_reset_iterator(array_ptr, 0 OPLINE_CC EXECUTE_DATA_CC);
+ bool is_empty = zend_fe_reset_iterator(array_ptr, 0 OPLINE_CC EXECUTE_DATA_CC);
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
if (UNEXPECTED(EG(exception))) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
- zend_bool is_empty = zend_fe_reset_iterator(array_ptr, 1 OPLINE_CC EXECUTE_DATA_CC);
+ bool is_empty = zend_fe_reset_iterator(array_ptr, 1 OPLINE_CC EXECUTE_DATA_CC);
if (IS_TMP_VAR == IS_VAR) {
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC);
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
- zend_bool is_empty = zend_fe_reset_iterator(array_ptr, 0 OPLINE_CC EXECUTE_DATA_CC);
+ bool is_empty = zend_fe_reset_iterator(array_ptr, 0 OPLINE_CC EXECUTE_DATA_CC);
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
if (UNEXPECTED(EG(exception))) {
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
- zend_bool is_empty = zend_fe_reset_iterator(array_ptr, 1 OPLINE_CC EXECUTE_DATA_CC);
+ bool is_empty = zend_fe_reset_iterator(array_ptr, 1 OPLINE_CC EXECUTE_DATA_CC);
if (IS_VAR == IS_VAR) {
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_var_deref(opline->op1.var EXECUTE_DATA_CC);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
- zend_bool is_empty = zend_fe_reset_iterator(array_ptr, 0 OPLINE_CC EXECUTE_DATA_CC);
+ bool is_empty = zend_fe_reset_iterator(array_ptr, 0 OPLINE_CC EXECUTE_DATA_CC);
if (UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
- zend_bool is_empty = zend_fe_reset_iterator(array_ptr, 1 OPLINE_CC EXECUTE_DATA_CC);
+ bool is_empty = zend_fe_reset_iterator(array_ptr, 1 OPLINE_CC EXECUTE_DATA_CC);
if (IS_CV == IS_VAR) {
ZEND_VM_NEXT_OPCODE();
} else {
- zend_bool strict;
+ bool strict;
if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(value) == IS_REFERENCE) {
value = Z_REFVAL_P(value);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
zval *key, *subject;
HashTable *ht;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
{
USE_OPLINE
zval *expr;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
expr = EX_VAR(opline->op1.var);
/* (Infinite recursion when comparing arrays is an uncatchable fatal error) */
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
op1 = EX_VAR(opline->op1.var);
op2 = RT_CONSTANT(opline, opline->op2);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
op1 = EX_VAR(opline->op1.var);
op2 = RT_CONSTANT(opline, opline->op2);
zval *key, *subject;
HashTable *ht;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *expr;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
expr = EX_VAR(opline->op1.var);
{
USE_OPLINE
zval *expr;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
expr = EX_VAR(opline->op1.var);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
zval *key, *subject;
HashTable *ht;
- zend_bool result;
+ bool result;
SAVE_OPLINE();
/* (Infinite recursion when comparing arrays is an uncatchable fatal error) */
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
op1 = EX_VAR(opline->op1.var);
op2 = EX_VAR(opline->op2.var);
{
USE_OPLINE
zval *op1, *op2;
- zend_bool result;
+ bool result;
op1 = EX_VAR(opline->op1.var);
op2 = EX_VAR(opline->op2.var);
return &wr->std;
}
-static zend_always_inline zend_bool zend_weakref_find(zend_object *referent, zval *return_value) {
+static zend_always_inline bool zend_weakref_find(zend_object *referent, zval *return_value) {
void *tagged_ptr = zend_hash_index_find_ptr(&EG(weakrefs), (zend_ulong) referent);
if (!tagged_ptr) {
return 0;
{
zend_string *left, *right;
zend_long scale_param;
- zend_bool scale_param_is_null = 1;
+ bool scale_param_is_null = 1;
bc_num first, second, result;
int scale;
{
zend_string *left, *right;
zend_long scale_param;
- zend_bool scale_param_is_null = 1;
+ bool scale_param_is_null = 1;
bc_num first, second, result;
int scale;
{
zend_string *left, *right;
zend_long scale_param;
- zend_bool scale_param_is_null = 1;
+ bool scale_param_is_null = 1;
bc_num first, second, result;
int scale;
{
zend_string *left, *right;
zend_long scale_param;
- zend_bool scale_param_is_null = 1;
+ bool scale_param_is_null = 1;
bc_num first, second, result;
int scale = BCG(bc_precision);
{
zend_string *left, *right;
zend_long scale_param;
- zend_bool scale_param_is_null = 1;
+ bool scale_param_is_null = 1;
bc_num first, second, result;
int scale = BCG(bc_precision);
{
zend_string *left, *right, *modulus;
zend_long scale_param;
- zend_bool scale_param_is_null = 1;
+ bool scale_param_is_null = 1;
bc_num first, second, mod, result;
int scale = BCG(bc_precision);
{
zend_string *left, *right;
zend_long scale_param;
- zend_bool scale_param_is_null = 1;
+ bool scale_param_is_null = 1;
bc_num first, second, result;
int scale = BCG(bc_precision);
{
zend_string *left;
zend_long scale_param;
- zend_bool scale_param_is_null = 1;
+ bool scale_param_is_null = 1;
bc_num result;
int scale = BCG(bc_precision);
{
zend_string *left, *right;
zend_long scale_param;
- zend_bool scale_param_is_null = 1;
+ bool scale_param_is_null = 1;
bc_num first, second;
int scale = BCG(bc_precision);
PHP_FUNCTION(bcscale)
{
zend_long old_scale, new_scale;
- zend_bool new_scale_is_null = 1;
+ bool new_scale_is_null = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
zend_string *dest;
size_t source_len;
int error;
- zend_bool small = 0;
+ bool small = 0;
#ifdef PHP_WIN32
unsigned __int64 size = 0;
#else
{
time_t ts;
zend_long tl = 0;
- zend_bool tl_is_null = 1;
+ bool tl_is_null = 1;
struct tm *ta, tmbuf;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &tl, &tl_is_null) == FAILURE) {
PHP_FUNCTION(jdtojewish)
{
zend_long julday, fl = 0;
- zend_bool heb = 0;
+ bool heb = 0;
int year, month, day;
char *dayp, *yearp;
struct tm te;
zend_long year, golden, solar, lunar, pfm, dom, tmp, easter, result;
zend_long method = CAL_EASTER_DEFAULT;
- zend_bool year_is_null = 1;
+ bool year_is_null = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(),
"|l!l", &year, &year_is_null, &method) == FAILURE) {
char *module_name;
size_t module_name_len;
zend_long code_page;
- zend_bool code_page_is_null = 1;
+ bool code_page_is_null = 1;
IUnknown *unk = NULL;
IDispatch *obj = NULL;
HRESULT res;
char *ifacename = NULL;
char *typelibname = NULL;
size_t ifacelen;
- zend_bool wantsink = 0;
+ bool wantsink = 0;
php_com_dotnet_object *obj = NULL;
ITypeInfo *typeinfo;
char *name;
size_t namelen;
ITypeLib *pTL = NULL;
- zend_bool cs = TRUE;
+ bool cs = TRUE;
int codepage = COMG(code_page);
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &name, &namelen, &cs)) {
f.arg_info = ecalloc(bindptr.lpfuncdesc->cParams, sizeof(zend_arg_info));
for (i = 0; i < bindptr.lpfuncdesc->cParams; i++) {
- zend_bool by_ref = (bindptr.lpfuncdesc->lprgelemdescParam[i].paramdesc.wParamFlags & PARAMFLAG_FOUT) != 0;
+ bool by_ref = (bindptr.lpfuncdesc->lprgelemdescParam[i].paramdesc.wParamFlags & PARAMFLAG_FOUT) != 0;
f.arg_info[i].type = (zend_type) ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(by_ref, 0));
}
HRESULT res;
char *filename, *fullpath = NULL;
size_t filename_len;
- zend_bool remember = TRUE;
+ bool remember = TRUE;
OLECHAR *olefilename = NULL;
CPH_FETCH();
PHP_MINFO_FUNCTION(com_dotnet);
ZEND_BEGIN_MODULE_GLOBALS(com_dotnet)
- zend_bool allow_dcom;
- zend_bool autoreg_verbose;
- zend_bool autoreg_on;
- zend_bool autoreg_case_sensitive;
+ bool allow_dcom;
+ bool autoreg_verbose;
+ bool autoreg_on;
+ bool autoreg_case_sensitive;
void *dotnet_runtime_stuff; /* opaque to avoid cluttering up other modules */
int code_page; /* default code_page if left unspecified */
- zend_bool rshutdown_started;
+ bool rshutdown_started;
ZEND_END_MODULE_GLOBALS(com_dotnet)
#if defined(ZTS) && defined(COMPILE_DL_COM_DOTNET)
struct _php_curl_free *to_free;
struct _php_curl_send_headers header;
struct _php_curl_error err;
- zend_bool in_callback;
+ bool in_callback;
uint32_t* clone;
zval postfields;
/* For CURLOPT_PRIVATE */
zval *zid;
php_curl *ch;
zend_long option;
- zend_bool option_is_null = 1;
+ bool option_is_null = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_OBJECT_OF_CLASS(zid, curl_ce)
{
zend_string *format;
zend_long ts;
- zend_bool ts_is_null = 1;
+ bool ts_is_null = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STR(format)
{
zend_string *format;
zend_long ts;
- zend_bool ts_is_null = 1;
+ bool ts_is_null = 1;
int ret;
ZEND_PARSE_PARAMETERS_START(1, 2)
int parse_error, epoch_does_not_fit_in_zend_long;
timelib_error_container *error;
zend_long preset_ts, ts;
- zend_bool preset_ts_is_null = 1;
+ bool preset_ts_is_null = 1;
timelib_time *t, *now;
timelib_tzinfo *tzi;
PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
{
zend_long hou, min, sec, mon, day, yea;
- zend_bool min_is_null = 1, sec_is_null = 1, mon_is_null = 1, day_is_null = 1, yea_is_null = 1;
+ bool min_is_null = 1, sec_is_null = 1, mon_is_null = 1, day_is_null = 1, yea_is_null = 1;
timelib_time *now;
timelib_tzinfo *tzi = NULL;
zend_long ts, adjust_seconds = 0;
{
zend_string *format;
zend_long timestamp;
- zend_bool timestamp_is_null = 1;
+ bool timestamp_is_null = 1;
struct tm ta;
int max_reallocs = 5;
size_t buf_len = 256, real_len;
PHP_FUNCTION(localtime)
{
zend_long timestamp;
- zend_bool timestamp_is_null = 1;
- zend_bool associative = 0;
+ bool timestamp_is_null = 1;
+ bool associative = 0;
timelib_tzinfo *tzi;
timelib_time *ts;
PHP_FUNCTION(getdate)
{
zend_long timestamp;
- zend_bool timestamp_is_null = 1;
+ bool timestamp_is_null = 1;
timelib_tzinfo *tzi;
timelib_time *ts;
zval *object1, *object2;
php_date_obj *dateobj1, *dateobj2;
php_interval_obj *interval;
- zend_bool absolute = 0;
+ bool absolute = 0;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO|b", &object1, date_ce_interface, &object2, date_ce_interface, &absolute) == FAILURE) {
RETURN_THROWS();
static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_sunset)
{
double latitude, longitude, zenith, gmt_offset, altitude;
- zend_bool latitude_is_null = 1, longitude_is_null = 1, zenith_is_null = 1, gmt_offset_is_null = 1;
+ bool latitude_is_null = 1, longitude_is_null = 1, zenith_is_null = 1, gmt_offset_is_null = 1;
double h_rise, h_set, N;
timelib_sll rise, set, transit;
zend_long time, retformat = SUNFUNCS_RET_STRING;
zend_string *opened_path = NULL;
char *lock_name;
#ifdef PHP_WIN32
- zend_bool restarted = 0;
- zend_bool need_creation = 0;
+ bool restarted = 0;
+ bool need_creation = 0;
#endif
if (ac < 2) {
fcntl(info->fd, F_SETFL, flags & ~O_APPEND);
#elif defined(PHP_WIN32)
} else if (modenr == DBA_CREAT && need_creation && !restarted) {
- zend_bool close_both;
+ bool close_both;
close_both = (info->fp != info->lock.fp);
php_stream_close(info->lock.fp);
PHP_FUNCTION(dba_handlers)
{
dba_handler *hptr;
- zend_bool full_info = 0;
+ bool full_info = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &full_info) == FAILURE) {
RETURN_THROWS();
DBA_DELETE_FUNC(inifile)
{
int res;
- zend_bool found = 0;
+ bool found = 0;
INIFILE_DATA;
INIFILE_GKEY;
/* {{{ inifile_filter
* copy from to dba while ignoring key name (group must equal)
*/
-static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend_bool *found)
+static int inifile_filter(inifile *dba, inifile *from, const key_type *key, bool *found)
{
size_t pos_start = 0, pos_next = 0, pos_curr;
int ret = SUCCESS;
switch(inifile_key_cmp(&ln.key, key)) {
case 0:
if (found) {
- *found = (zend_bool) 1;
+ *found = (bool) 1;
}
pos_curr = php_stream_tell(from->fp);
if (pos_start != pos_next) {
/* }}} */
/* {{{ inifile_delete_replace_append */
-static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append, zend_bool *found)
+static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append, bool *found)
{
size_t pos_grp_start=0, pos_grp_next;
inifile *ini_tmp = NULL;
/* }}} */
/* {{{ inifile_delete_ex */
-int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found)
+int inifile_delete_ex(inifile *dba, const key_type *key, bool *found)
{
return inifile_delete_replace_append(dba, key, NULL, 0, found);
}
/* }}} */
/* {{{ inifile_replace_ex */
-int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *value, zend_bool *found)
+int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *value, bool *found)
{
return inifile_delete_replace_append(dba, key, value, 0, found);
}
int inifile_firstkey(inifile *dba);
int inifile_nextkey(inifile *dba);
int inifile_delete(inifile *dba, const key_type *key);
-int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found);
+int inifile_delete_ex(inifile *dba, const key_type *key, bool *found);
int inifile_replace(inifile *dba, const key_type *key, const val_type *val);
-int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *val, zend_bool *found);
+int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *val, bool *found);
int inifile_append(inifile *dba, const key_type *key, const val_type *val);
char *inifile_version();
xmlNodePtr nodep, retnodep;
dom_object *intern, *nodeobj;
int ret;
- zend_bool recursive = 0;
+ bool recursive = 0;
/* See http://www.xmlsoft.org/html/libxml-tree.html#xmlDocCopyNode for meaning of values */
int extended_recursive;
int previndex=0;
HashTable *nodeht;
zval *entry;
- zend_bool do_curobj_undef = 1;
+ bool do_curobj_undef = 1;
php_dom_iterator *iterator = (php_dom_iterator *)iter;
}
/* }}} end dom_element_has_attribute_ns */
-static void php_set_attribute_id(xmlAttrPtr attrp, zend_bool is_id) /* {{{ */
+static void php_set_attribute_id(xmlAttrPtr attrp, bool is_id) /* {{{ */
{
if (is_id == 1 && attrp->atype != XML_ATTRIBUTE_ID) {
xmlChar *id_val;
dom_object *intern;
char *name;
size_t name_len;
- zend_bool is_id;
+ bool is_id;
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "sb", &name, &name_len, &is_id) == FAILURE) {
dom_object *intern;
size_t uri_len, name_len;
char *uri, *name;
- zend_bool is_id;
+ bool is_id;
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssb", &uri, &uri_len, &name, &name_len, &is_id) == FAILURE) {
xmlNode *nodep;
xmlAttrPtr attrp;
dom_object *intern, *attrobj;
- zend_bool is_id;
+ bool is_id;
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ob", &node, dom_attr_class_entry, &is_id) == FAILURE) {
xmlNode *n, *node;
int ret;
dom_object *intern;
- zend_bool recursive = 0;
+ bool recursive = 0;
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &recursive) == FAILURE) {
xmlDocPtr docp;
xmlNodeSetPtr nodeset = NULL;
dom_object *intern;
- zend_bool exclusive=0, with_comments=0;
+ bool exclusive=0, with_comments=0;
xmlChar **inclusive_ns_prefixes = NULL;
char *file = NULL;
int ret = -1;
/* }}} */
/* {{{ php_dom_create_object */
-PHP_DOM_EXPORT zend_bool php_dom_create_object(xmlNodePtr obj, zval *return_value, dom_object *domobj)
+PHP_DOM_EXPORT bool php_dom_create_object(xmlNodePtr obj, zval *return_value, dom_object *domobj)
{
zend_class_entry *ce;
dom_object *intern;
/* }}} */
/* }}} end dom_element_get_elements_by_tag_name_ns_raw */
-static inline zend_bool is_empty_node(xmlNodePtr nodep)
+static inline bool is_empty_node(xmlNodePtr nodep)
{
xmlChar *strContent = xmlNodeGetContent(nodep);
- zend_bool ret = strContent == NULL || *strContent == '\0';
+ bool ret = strContent == NULL || *strContent == '\0';
xmlFree(strContent);
return ret;
}
PHP_DOM_EXPORT extern zend_class_entry *dom_node_class_entry;
PHP_DOM_EXPORT dom_object *php_dom_object_get_data(xmlNodePtr obj);
-PHP_DOM_EXPORT zend_bool php_dom_create_object(xmlNodePtr obj, zval* return_value, dom_object *domobj);
+PHP_DOM_EXPORT bool php_dom_create_object(xmlNodePtr obj, zval* return_value, dom_object *domobj);
PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj);
#define DOM_XMLNS_NAMESPACE \
PHP_METHOD(DOMXPath, __construct)
{
zval *doc;
- zend_bool register_node_ns = 1;
+ bool register_node_ns = 1;
xmlDocPtr docp = NULL;
dom_object *docobj;
dom_xpath_object *intern;
char *expr;
xmlDoc *docp = NULL;
xmlNsPtr *ns = NULL;
- zend_bool register_node_ns;
+ bool register_node_ns;
id = ZEND_THIS;
intern = Z_XPATHOBJ_P(id);
char *valid_end; /* exclusive */
} exif_offset_info;
-static zend_always_inline zend_bool ptr_offset_overflows(char *ptr, size_t offset) {
+static zend_always_inline bool ptr_offset_overflows(char *ptr, size_t offset) {
return UINTPTR_MAX - (uintptr_t) ptr < offset;
}
return start;
}
-static inline zend_bool exif_offset_info_contains(
+static inline bool exif_offset_info_contains(
const exif_offset_info *info, char *start, size_t length) {
char *end;
if (ptr_offset_overflows(start, length)) {
PHP_FUNCTION(exif_read_data)
{
zend_string *z_sections_needed = NULL;
- zend_bool sub_arrays = 0, read_thumbnail = 0, read_all = 0;
+ bool sub_arrays = 0, read_thumbnail = 0, read_all = 0;
zval *stream;
bool ret;
int i, sections_needed = 0;
typedef struct _zend_ffi_field {
size_t offset;
- zend_bool is_const;
- zend_bool is_nested; /* part of nested anonymous struct */
+ bool is_const;
+ bool is_nested; /* part of nested anonymous struct */
uint8_t first_bit;
uint8_t bits;
zend_ffi_type *type;
typedef struct _zend_ffi_symbol {
zend_ffi_symbol_kind kind;
- zend_bool is_const;
+ bool is_const;
zend_ffi_type *type;
union {
void *addr;
DL_HANDLE lib;
HashTable *symbols;
HashTable *tags;
- zend_bool persistent;
+ bool persistent;
} zend_ffi;
#define ZEND_FFI_TYPE_OWNED (1<<0)
static void zend_ffi_finalize_type(zend_ffi_dcl *dcl);
static int zend_ffi_is_same_type(zend_ffi_type *type1, zend_ffi_type *type2);
static zend_ffi_type *zend_ffi_remember_type(zend_ffi_type *type);
-static char *zend_ffi_parse_directives(const char *filename, char *code_pos, char **scope_name, char **lib, zend_bool preload);
+static char *zend_ffi_parse_directives(const char *filename, char *code_pos, char **scope_name, char **lib, bool preload);
static ZEND_FUNCTION(ffi_trampoline);
static ZEND_COLD void zend_ffi_return_unsupported(zend_ffi_type *type);
static ZEND_COLD void zend_ffi_pass_unsupported(zend_ffi_type *type);
}
/* }}} */
-static zend_always_inline void zend_ffi_cdata_to_zval(zend_ffi_cdata *cdata, void *ptr, zend_ffi_type *type, int read_type, zval *rv, zend_ffi_flags flags, zend_bool is_ret, zend_bool debug_union) /* {{{ */
+static zend_always_inline void zend_ffi_cdata_to_zval(zend_ffi_cdata *cdata, void *ptr, zend_ffi_type *type, int read_type, zval *rv, zend_ffi_flags flags, bool is_ret, bool debug_union) /* {{{ */
{
if (read_type == BP_VAR_R) {
zend_ffi_type_kind kind = type->kind;
zend_object_iterator it;
zend_long key;
zval value;
- zend_bool by_ref;
+ bool by_ref;
} zend_ffi_cdata_iterator;
static void zend_ffi_cdata_it_dtor(zend_object_iterator *iter) /* {{{ */
}
/* }}} */
-static int zend_ffi_cdata_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, zend_bool check_only) /* {{{ */
+static int zend_ffi_cdata_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only) /* {{{ */
{
zend_ffi_cdata *cdata = (zend_ffi_cdata*)obj;
zend_ffi_type *type = ZEND_FFI_TYPE(cdata->type);
}
/* }}} */
-static zend_ffi *zend_ffi_load(const char *filename, zend_bool preload) /* {{{ */
+static zend_ffi *zend_ffi_load(const char *filename, bool preload) /* {{{ */
{
struct stat buf;
int fd;
}
/* }}} */
-static int zend_ffi_validate_incomplete_type(zend_ffi_type *type, zend_bool allow_incomplete_tag, zend_bool allow_incomplete_array) /* {{{ */
+static int zend_ffi_validate_incomplete_type(zend_ffi_type *type, bool allow_incomplete_tag, bool allow_incomplete_array) /* {{{ */
{
if (!allow_incomplete_tag && (type->attr & ZEND_FFI_ATTR_INCOMPLETE_TAG)) {
if (FFI_G(tags)) {
}
/* }}} */
-static int zend_ffi_validate_type(zend_ffi_type *type, zend_bool allow_incomplete_tag, zend_bool allow_incomplete_array) /* {{{ */
+static int zend_ffi_validate_type(zend_ffi_type *type, bool allow_incomplete_tag, bool allow_incomplete_array) /* {{{ */
{
if (type->kind == ZEND_FFI_TYPE_VOID) {
zend_ffi_throw_parser_error("void type is not allowed at line %d", FFI_G(line));
}
/* }}} */
-static int zend_ffi_validate_var_type(zend_ffi_type *type, zend_bool allow_incomplete_array) /* {{{ */
+static int zend_ffi_validate_var_type(zend_ffi_type *type, bool allow_incomplete_array) /* {{{ */
{
if (type->kind == ZEND_FFI_TYPE_FUNC) {
zend_ffi_throw_parser_error("function type is not allowed at line %d", FFI_G(line));
zend_ffi_type *type, *type_ptr;
zend_ffi_cdata *cdata;
void *ptr;
- zend_bool owned = 1;
- zend_bool persistent = 0;
- zend_bool is_const = 0;
+ bool owned = 1;
+ bool persistent = 0;
+ bool is_const = 0;
zend_ffi_flags flags = ZEND_FFI_FLAG_OWNED;
ZEND_FFI_VALIDATE_API_RESTRICTION();
zend_object *ztype = NULL;
zend_ffi_type *old_type, *type, *type_ptr;
zend_ffi_cdata *old_cdata, *cdata;
- zend_bool is_const = 0;
+ bool is_const = 0;
zval *zv, *arg;
void *ptr;
zend_ffi_type *type;
void *ptr;
zend_long size;
- zend_bool size_is_null = 1;
+ bool size_is_null = 1;
ZEND_FFI_VALIDATE_API_RESTRICTION();
ZEND_PARSE_PARAMETERS_START(1, 2)
}
}
-static char *zend_ffi_parse_directives(const char *filename, char *code_pos, char **scope_name, char **lib, zend_bool preload) /* {{{ */
+static char *zend_ffi_parse_directives(const char *filename, char *code_pos, char **scope_name, char **lib, bool preload) /* {{{ */
{
char *p;
{
zend_ffi *ffi;
char *s = NULL, *e, *filename;
- zend_bool is_glob = 0;
+ bool is_glob = 0;
e = preload;
while (*e) {
const zend_ffi_type *sym_type;
int64_t value;
zend_ffi_type *enum_type = ZEND_FFI_TYPE(enum_dcl->type);
- zend_bool overflow = 0;
- zend_bool is_signed =
+ bool overflow = 0;
+ bool is_signed =
(enum_type->enumeration.kind == ZEND_FFI_TYPE_SINT8 ||
enum_type->enumeration.kind == ZEND_FFI_TYPE_SINT16 ||
enum_type->enumeration.kind == ZEND_FFI_TYPE_SINT32 ||
struct_type->size += field_type->size;
}
field->type = field_dcl->type;
- field->is_const = (zend_bool)(field_dcl->attr & ZEND_FFI_ATTR_CONST);
+ field->is_const = (bool)(field_dcl->attr & ZEND_FFI_ATTR_CONST);
field->is_nested = 0;
field->first_bit = 0;
field->bits = 0;
}
}
field->type = field_dcl->type;
- field->is_const = (zend_bool)(field_dcl->attr & ZEND_FFI_ATTR_CONST);
+ field->is_const = (bool)(field_dcl->attr & ZEND_FFI_ATTR_CONST);
field->is_nested = 0;
field_dcl->type = field_type; /* reset "owned" flag */
if ((dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) == ZEND_FFI_DCL_TYPEDEF
&& sym->kind == ZEND_FFI_SYM_TYPE
&& zend_ffi_is_same_type(ZEND_FFI_TYPE(sym->type), ZEND_FFI_TYPE(dcl->type))
- && sym->is_const == (zend_bool)(dcl->attr & ZEND_FFI_ATTR_CONST)) {
+ && sym->is_const == (bool)(dcl->attr & ZEND_FFI_ATTR_CONST)) {
/* allowed redeclaration */
zend_ffi_type_dtor(dcl->type);
return;
} else {
if (sym->kind == ZEND_FFI_SYM_VAR
&& zend_ffi_is_same_type(ZEND_FFI_TYPE(sym->type), type)
- && sym->is_const == (zend_bool)(dcl->attr & ZEND_FFI_ATTR_CONST)) {
+ && sym->is_const == (bool)(dcl->attr & ZEND_FFI_ATTR_CONST)) {
/* allowed redeclaration */
zend_ffi_type_dtor(dcl->type);
return;
sym = pemalloc(sizeof(zend_ffi_symbol), FFI_G(persistent));
sym->kind = ZEND_FFI_SYM_TYPE;
sym->type = dcl->type;
- sym->is_const = (zend_bool)(dcl->attr & ZEND_FFI_ATTR_CONST);
+ sym->is_const = (bool)(dcl->attr & ZEND_FFI_ATTR_CONST);
dcl->type = ZEND_FFI_TYPE(dcl->type); /* reset "owned" flag */
zend_hash_str_add_new_ptr(FFI_G(symbols), name, name_len, sym);
} else {
sym = pemalloc(sizeof(zend_ffi_symbol), FFI_G(persistent));
sym->kind = (type->kind == ZEND_FFI_TYPE_FUNC) ? ZEND_FFI_SYM_FUNC : ZEND_FFI_SYM_VAR;
sym->type = dcl->type;
- sym->is_const = (zend_bool)(dcl->attr & ZEND_FFI_ATTR_CONST);
+ sym->is_const = (bool)(dcl->attr & ZEND_FFI_ATTR_CONST);
dcl->type = type; /* reset "owned" flag */
zend_hash_str_add_new_ptr(FFI_G(symbols), name, name_len, sym);
} else {
}
/* }}} */
-void zend_ffi_declare_tag(const char *name, size_t name_len, zend_ffi_dcl *dcl, zend_bool incomplete) /* {{{ */
+void zend_ffi_declare_tag(const char *name, size_t name_len, zend_ffi_dcl *dcl, bool incomplete) /* {{{ */
{
zend_ffi_tag *tag;
zend_ffi_type *type;
declarator(zend_ffi_dcl *dcl, const char **name, size_t *name_len):
{zend_ffi_dcl nested_dcl = {ZEND_FFI_DCL_CHAR, 0, 0, 0, NULL};}
- {zend_bool nested = 0;}
+ {bool nested = 0;}
pointer(dcl)?
( ID(name, name_len)
| "("
abstract_declarator(zend_ffi_dcl *dcl):
{zend_ffi_dcl nested_dcl = {ZEND_FFI_DCL_CHAR, 0, 0, 0, NULL};}
- {zend_bool nested = 0;}
+ {bool nested = 0;}
pointer(dcl)?
( &nested_declarator_start
"("
parameter_declarator(zend_ffi_dcl *dcl, const char **name, size_t *name_len):
{zend_ffi_dcl nested_dcl = {ZEND_FFI_DCL_CHAR, 0, 0, 0, NULL};}
- {zend_bool nested = 0;}
+ {bool nested = 0;}
pointer(dcl)?
( &nested_declarator_start
"("
parameter_declaration(HashTable **args):
{const char *name = NULL;}
{size_t name_len = 0;}
- {zend_bool old_allow_vla = FFI_G(allow_vla);}
+ {bool old_allow_vla = FFI_G(allow_vla);}
{FFI_G(allow_vla) = 1;}
{zend_ffi_dcl param_dcl = ZEND_FFI_ATTR_INIT;}
specifier_qualifier_list(¶m_dcl)
{size_t name_len;}
{int n;}
{zend_ffi_val val;}
- {zend_bool orig_attribute_parsing;}
+ {bool orig_attribute_parsing;}
( ID(&name, &name_len)
( /* empty */
{zend_ffi_add_attribute(dcl, name, name_len);}
static int parse_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_t *name_len) {
zend_ffi_dcl nested_dcl = {ZEND_FFI_DCL_CHAR, 0, 0, 0, NULL};
- zend_bool nested = 0;
+ bool nested = 0;
if (sym == YY__STAR) {
sym = parse_pointer(sym, dcl);
}
static int parse_abstract_declarator(int sym, zend_ffi_dcl *dcl) {
zend_ffi_dcl nested_dcl = {ZEND_FFI_DCL_CHAR, 0, 0, 0, NULL};
- zend_bool nested = 0;
+ bool nested = 0;
if (sym == YY__STAR) {
sym = parse_pointer(sym, dcl);
}
static int parse_parameter_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_t *name_len) {
zend_ffi_dcl nested_dcl = {ZEND_FFI_DCL_CHAR, 0, 0, 0, NULL};
- zend_bool nested = 0;
+ bool nested = 0;
if (sym == YY__STAR) {
sym = parse_pointer(sym, dcl);
}
static int parse_parameter_declaration(int sym, HashTable **args) {
const char *name = NULL;
size_t name_len = 0;
- zend_bool old_allow_vla = FFI_G(allow_vla);
+ bool old_allow_vla = FFI_G(allow_vla);
FFI_G(allow_vla) = 1;
zend_ffi_dcl param_dcl = ZEND_FFI_ATTR_INIT;
sym = parse_specifier_qualifier_list(sym, ¶m_dcl);
size_t name_len;
int n;
zend_ffi_val val;
- zend_bool orig_attribute_parsing;
+ bool orig_attribute_parsing;
if (sym == YY_ID || sym == YY_CONST || sym == YY___CONST || sym == YY___CONST__) {
if (sym == YY_ID) {
sym = parse_ID(sym, &name, &name_len);
ZEND_BEGIN_MODULE_GLOBALS(ffi)
zend_ffi_api_restriction restriction;
- zend_bool is_cli;
+ bool is_cli;
/* predefined ffi_types */
HashTable types;
int line;
HashTable *symbols;
HashTable *tags;
- zend_bool allow_vla;
- zend_bool attribute_parsing;
- zend_bool persistent;
+ bool allow_vla;
+ bool attribute_parsing;
+ bool persistent;
uint32_t default_type_attr;
ZEND_END_MODULE_GLOBALS(ffi)
int zend_ffi_is_typedef_name(const char *name, size_t name_len);
void zend_ffi_resolve_typedef(const char *name, size_t name_len, zend_ffi_dcl *dcl);
void zend_ffi_resolve_const(const char *name, size_t name_len, zend_ffi_val *val);
-void zend_ffi_declare_tag(const char *name, size_t name_len, zend_ffi_dcl *dcl, zend_bool incomplete);
+void zend_ffi_declare_tag(const char *name, size_t name_len, zend_ffi_dcl *dcl, bool incomplete);
void zend_ffi_make_enum_type(zend_ffi_dcl *dcl);
void zend_ffi_add_enum_val(zend_ffi_dcl *enum_dcl, const char *name, size_t name_len, zend_ffi_val *val, int64_t *min, int64_t *max, int64_t *last);
void zend_ffi_make_struct_type(zend_ffi_dcl *dcl);
return SUCCESS;
}
-static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval *options, char* charset, zend_bool copy) /* {{{ */
+static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval *options, char* charset, bool copy) /* {{{ */
{
filter_list_entry filter_func;
}
/* }}} */
-static void php_zval_filter_recursive(zval *value, zend_long filter, zend_long flags, zval *options, char *charset, zend_bool copy) /* {{{ */
+static void php_zval_filter_recursive(zval *value, zend_long filter, zend_long flags, zval *options, char *charset, bool copy) /* {{{ */
{
if (Z_TYPE_P(value) == IS_ARRAY) {
zval *element;
/* }}} */
static void php_filter_array_handler(zval *input, HashTable *op_ht, zend_long op_long,
- zval *return_value, zend_bool add_empty
+ zval *return_value, bool add_empty
) /* {{{ */ {
zend_string *arg_key;
zval *tmp, *arg_elm;
{
zend_long fetch_from;
zval *array_input = NULL;
- zend_bool add_empty = 1;
+ bool add_empty = 1;
HashTable *op_ht = NULL;
zend_long op_long = FILTER_DEFAULT;
PHP_FUNCTION(filter_var_array)
{
zval *array_input = NULL;
- zend_bool add_empty = 1;
+ bool add_empty = 1;
HashTable *op_ht = NULL;
zend_long op_long = FILTER_DEFAULT;
SSL_CTX *ctx = NULL;
long ssl_ctx_options = SSL_OP_ALL;
int err, res;
- zend_bool retry;
+ bool retry;
#endif
if (ftp == NULL) {
return 0;
int single_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t size) {
#ifdef HAVE_FTP_SSL
int err;
- zend_bool retry = 0;
+ bool retry = 0;
SSL *handle = NULL;
php_socket_t fd;
size_t sent;
int n, nr_bytes;
#ifdef HAVE_FTP_SSL
int err;
- zend_bool retry = 0;
+ bool retry = 0;
SSL *handle = NULL;
php_socket_t fd;
#endif
SSL_CTX *ctx;
SSL_SESSION *session;
int err, res;
- zend_bool retry;
+ bool retry;
#endif
if (data->fd != -1) {
ftpbuf_t *ftp;
char **llist, **ptr, *dir;
size_t dir_len;
- zend_bool recursive = 0;
+ bool recursive = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|b", &z_ftp, php_ftp_ce, &dir, &dir_len, &recursive) == FAILURE) {
RETURN_THROWS();
{
zval *z_ftp;
ftpbuf_t *ftp;
- zend_bool pasv;
+ bool pasv;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ob", &z_ftp, php_ftp_ce, &pasv) == FAILURE) {
RETURN_THROWS();
PHP_FUNCTION(imagetruecolortopalette)
{
zval *IM;
- zend_bool dither;
+ bool dither;
zend_long ncolors;
gdImagePtr im;
PHP_FUNCTION(imagealphablending)
{
zval *IM;
- zend_bool blend;
+ bool blend;
gdImagePtr im;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ob", &IM, gd_image_ce, &blend) == FAILURE) {
PHP_FUNCTION(imagesavealpha)
{
zval *IM;
- zend_bool save;
+ bool save;
gdImagePtr im;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ob", &IM, gd_image_ce, &save) == FAILURE) {
PHP_FUNCTION(imagegrabwindow)
{
HWND window;
- zend_bool client_area = 0;
+ bool client_area = 0;
RECT rc = {0};
int Width, Height;
HDC hdc;
gdImagePtr im_dst, im_src;
double degrees;
zend_long color;
- zend_bool ignoretransparent = 0;
+ bool ignoretransparent = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Odl|b", &SIM, gd_image_ce, °rees, &color, &ignoretransparent) == FAILURE) {
RETURN_THROWS();
char *file = NULL;
size_t file_len = 0;
zend_long foreground_color;
- zend_bool foreground_color_is_null = 1;
+ bool foreground_color_is_null = 1;
gdImagePtr im;
int i;
gdIOCtx *ctx = NULL;
PHP_FUNCTION(imagebmp)
{
zval *imgind;
- zend_bool compressed = 1;
+ bool compressed = 1;
gdImagePtr im;
gdIOCtx *ctx = NULL;
zval *to_zval = NULL;
{
zval *IM;
zend_long COL = 0;
- zend_bool COL_IS_NULL = 1;
+ bool COL_IS_NULL = 1;
gdImagePtr im;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|l!", &IM, gd_image_ce, &COL, &COL_IS_NULL) == FAILURE) {
PHP_FUNCTION(imageinterlace)
{
zval *IM;
- zend_bool INT = 0;
- zend_bool INT_IS_NULL = 1;
+ bool INT = 0;
+ bool INT_IS_NULL = 1;
gdImagePtr im;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b!", &IM, gd_image_ce, &INT, &INT_IS_NULL) == FAILURE) {
{
zval *IM, *POINTS;
zend_long NPOINTS, COL;
- zend_bool COL_IS_NULL = 1;
+ bool COL_IS_NULL = 1;
zval *var = NULL;
gdImagePtr im;
gdPointPtr points;
zval *IM;
gdImagePtr im;
zend_long tmp, blocksize;
- zend_bool mode = 0;
+ bool mode = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Oll|b", &IM, gd_image_ce, &tmp, &blocksize, &mode) == FAILURE) {
RETURN_THROWS();
PHP_FUNCTION(imageantialias)
{
zval *IM;
- zend_bool alias;
+ bool alias;
gdImagePtr im;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ob", &IM, gd_image_ce, &alias) == FAILURE) {
zval *IM;
gdImagePtr im;
zend_long res_x, res_y;
- zend_bool res_x_is_null = 1, res_y_is_null = 1;
+ bool res_x_is_null = 1, res_y_is_null = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|l!l!", &IM, gd_image_ce, &res_x, &res_x_is_null, &res_y, &res_y_is_null) == FAILURE) {
RETURN_THROWS();
typedef struct _gmp_temp {
mpz_t num;
- zend_bool is_used;
+ bool is_used;
} gmp_temp_t;
#define GMP_ROUND_ZERO 0
return SUCCESS;
case IS_STRING: {
char *numstr = Z_STRVAL_P(val);
- zend_bool skip_lead = 0;
+ bool skip_lead = 0;
int ret;
if (Z_STRLEN_P(val) >= 2 && numstr[0] == '0') {
{
mpz_ptr gmpnum_a, gmpnum_b;
gmp_temp_t temp_a, temp_b;
- zend_bool use_si = 0;
+ bool use_si = 0;
zend_long res;
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a, 1);
zval *a_arg, *b_arg;
mpz_ptr gmpnum_a, gmpnum_b;
gmp_temp_t temp_a, temp_b;
- zend_bool use_a_si = 0, use_b_si = 0;
+ bool use_a_si = 0, use_b_si = 0;
int result;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a_arg, &b_arg) == FAILURE){
{
zval *a_arg;
zend_long index;
- zend_bool set = 1;
+ bool set = 1;
mpz_ptr gmpnum_a;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol|b", &a_arg, gmp_ce, &index, &set) == FAILURE) {
ZEND_MODULE_INFO_D(gmp);
ZEND_BEGIN_MODULE_GLOBALS(gmp)
- zend_bool rand_initialized;
+ bool rand_initialized;
gmp_randstate_t rand_state;
ZEND_END_MODULE_GLOBALS(gmp)
/* Userspace */
static void php_hash_do_hash(
- zval *return_value, zend_string *algo, char *data, size_t data_len, zend_bool raw_output, bool isfilename, HashTable *args
+ zval *return_value, zend_string *algo, char *data, size_t data_len, bool raw_output, bool isfilename, HashTable *args
) /* {{{ */ {
zend_string *digest;
const php_hash_ops *ops;
zend_string *algo;
char *data;
size_t data_len;
- zend_bool raw_output = 0;
+ bool raw_output = 0;
HashTable *args = NULL;
ZEND_PARSE_PARAMETERS_START(2, 4)
zend_string *algo;
char *data;
size_t data_len;
- zend_bool raw_output = 0;
+ bool raw_output = 0;
HashTable *args = NULL;
ZEND_PARSE_PARAMETERS_START(2, 3)
}
static void php_hash_do_hash_hmac(
- zval *return_value, zend_string *algo, char *data, size_t data_len, char *key, size_t key_len, zend_bool raw_output, bool isfilename
+ zval *return_value, zend_string *algo, char *data, size_t data_len, char *key, size_t key_len, bool raw_output, bool isfilename
) /* {{{ */ {
zend_string *digest;
unsigned char *K;
zend_string *algo;
char *data, *key;
size_t data_len, key_len;
- zend_bool raw_output = 0;
+ bool raw_output = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sss|b", &algo, &data, &data_len, &key, &key_len, &raw_output) == FAILURE) {
RETURN_THROWS();
zend_string *algo;
char *data, *key;
size_t data_len, key_len;
- zend_bool raw_output = 0;
+ bool raw_output = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sss|b", &algo, &data, &data_len, &key, &key_len, &raw_output) == FAILURE) {
RETURN_THROWS();
{
zval *zhash;
php_hashcontext_object *hash;
- zend_bool raw_output = 0;
+ bool raw_output = 0;
zend_string *digest;
size_t digest_len;
unsigned char *computed_salt, *digest, *temp, *result, *K1, *K2 = NULL;
zend_long loops, i, j, iterations, digest_length = 0, length = 0;
size_t pass_len, salt_len = 0;
- zend_bool raw_output = 0;
+ bool raw_output = 0;
const php_hash_ops *ops;
void *context;
HashTable *args;
size_t charset_len;
zend_string *str;
zend_long offset, length = 0;
- zend_bool len_is_null = 1;
+ bool len_is_null = 1;
php_iconv_err_t err;
zval *imap_conn_obj;
zend_string *criteria = NULL, *charset = NULL;
zend_long sort, flags = 0;
- zend_bool rev;
+ bool rev;
php_imap_object *imap_conn_struct;
unsigned long *slst, *sl;
char *search_criteria;
#endif
/* php_stream for php_mail_gets() */
php_stream *gets_stream;
- zend_bool enable_rsh;
+ bool enable_rsh;
ZEND_END_MODULE_GLOBALS(imap)
#if defined(ZTS) && defined(COMPILE_DL_IMAP)
{
char *rules;
size_t rules_len;
- zend_bool compiled = 0;
+ bool compiled = 0;
UErrorCode status = U_ZERO_ERROR;
BREAKITER_METHOD_INIT_VARS;
object = ZEND_THIS;
*locale;
size_t key_len,
locale_len;
- zend_bool commonly_used;
+ bool commonly_used;
intl_error_reset(NULL);
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssb",
U_CFUNC PHP_FUNCTION(intlcal_clear)
{
zend_long field;
- zend_bool field_is_null = 1;
+ bool field_is_null = 1;
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(),
U_CFUNC PHP_FUNCTION(intlcal_is_weekend)
{
double date;
- zend_bool date_is_null = 1;
+ bool date_is_null = 1;
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
U_CFUNC PHP_FUNCTION(intlcal_set_lenient)
{
- zend_bool is_lenient;
+ bool is_lenient;
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
}
static void _php_intlgregcal_constructor_body(
- INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor)
+ INTERNAL_FUNCTION_PARAMETERS, bool is_constructor)
{
zval *tz_object = NULL;
zval args_a[6] = {0},
/* }}} */
/* {{{ php_converter_check_limits */
-static inline zend_bool php_converter_check_limits(php_converter_object *objval, zend_long available, zend_long needed) {
+static inline bool php_converter_check_limits(php_converter_object *objval, zend_long available, zend_long needed) {
if (available < needed) {
php_converter_throw_failure(objval, U_BUFFER_OVERFLOW_ERROR, "Buffer overrun " ZEND_LONG_FMT " bytes needed, " ZEND_LONG_FMT " available", needed, available);
return 0;
/* }}} */
/* {{{ php_converter_set_callbacks */
-static inline zend_bool php_converter_set_callbacks(php_converter_object *objval, UConverter *cnv) {
- zend_bool ret = 1;
+static inline bool php_converter_set_callbacks(php_converter_object *objval, UConverter *cnv) {
+ bool ret = 1;
UErrorCode error = U_ZERO_ERROR;
if (objval->obj.ce == php_converter_ce) {
/* }}} */
/* {{{ php_converter_set_encoding */
-static zend_bool php_converter_set_encoding(php_converter_object *objval,
+static bool php_converter_set_encoding(php_converter_object *objval,
UConverter **pcnv,
const char *enc, size_t enc_len
) {
char *str;
size_t str_len;
zend_string *ret;
- zend_bool reverse = 0;
+ bool reverse = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b",
&str, &str_len, &reverse) == FAILURE) {
UChar value_buf[64];
uint32_t length = USIZE( value_buf );
UChar* value = value_buf;
- zend_bool is_pattern_localized = false;
+ bool is_pattern_localized = false;
DATE_FORMAT_METHOD_INIT_VARS;
size_t value_len = 0;
int32_t slength = 0;
UChar* svalue = NULL;
- zend_bool is_pattern_localized = false;
+ bool is_pattern_localized = false;
DATE_FORMAT_METHOD_INIT_VARS;
/* {{{ Set formatter lenient. */
PHP_FUNCTION( datefmt_set_lenient )
{
- zend_bool isLenient = false;
+ bool isLenient = false;
DATE_FORMAT_METHOD_INIT_VARS;
{
zend_object *calendar_obj;
zend_long calendar_long;
- zend_bool calendar_is_null;
+ bool calendar_is_null;
DATE_FORMAT_METHOD_INIT_VARS;
object = getThis();
zend_long time_type = 0;
zend_object *calendar_obj = NULL;
zend_long calendar_long = 0;
- zend_bool calendar_is_null = 1;
+ bool calendar_is_null = 1;
Calendar *cal = NULL;
zend_long calendar_type;
bool calendar_owned;
using icu::GregorianCalendar;
int datefmt_process_calendar_arg(
- zend_object *calendar_obj, zend_long calendar_long, zend_bool calendar_is_null, Locale const& locale,
+ zend_object *calendar_obj, zend_long calendar_long, bool calendar_is_null, Locale const& locale,
const char *func_name, intl_error *err, Calendar*& cal, zend_long& cal_int_type, bool& calendar_owned
) {
char *msg;
using icu::DateFormat;
int datefmt_process_calendar_arg(
- zend_object *calendar_obj, zend_long calendar_long, zend_bool calendar_is_null, Locale const& locale,
+ zend_object *calendar_obj, zend_long calendar_long, bool calendar_is_null, Locale const& locale,
const char *func_name, intl_error *err, Calendar*& cal, zend_long& cal_int_type, bool& calendar_owned
);
UBreakIterator* bi = NULL;
int sub_str_start_pos, sub_str_end_pos;
int32_t (*iter_func)(UBreakIterator *);
- zend_bool no_length = 1;
+ bool no_length = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|l!", &str, &str_len, &lstart, &length, &no_length) == FAILURE) {
RETURN_THROWS();
const char *found;
size_t haystack_len, needle_len;
int32_t ret_pos, uchar_pos;
- zend_bool part = 0;
+ bool part = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|b", &haystack, &haystack_len, &needle, &needle_len, &part) == FAILURE) {
RETURN_THROWS();
char* cur_lang_tag = NULL;
char* cur_loc_range = NULL;
- zend_bool boolCanonical = 0;
+ bool boolCanonical = 0;
UErrorCode status = U_ZERO_ERROR;
intl_error_reset( NULL );
zval* arr = NULL;
HashTable* hash_arr = NULL;
- zend_bool boolCanonical = 0;
+ bool boolCanonical = 0;
zend_string* result_str = NULL;
intl_error_reset( NULL );
UBreakIterator* grapheme_iterator;
intl_error g_error;
zend_long error_level;
- zend_bool use_exceptions;
+ bool use_exceptions;
ZEND_END_MODULE_GLOBALS(intl)
#if defined(ZTS) && defined(COMPILE_DL_INTL)
size_t bundlename_len = 0;
const char *locale;
size_t locale_len = 0;
- zend_bool fallback = 1;
+ bool fallback = 1;
zval *object = return_value;
ResourceBundle_object *rb = Z_INTL_RESOURCEBUNDLE_P( object );
{
int32_t meindex = 0;
char * mekey = NULL;
- zend_bool is_numeric = 0;
+ bool is_numeric = 0;
char *pbuf;
ResourceBundle_object *rb;
/* {{{ Get resource identified by numerical index or key name. */
PHP_FUNCTION( resourcebundle_get )
{
- zend_bool fallback = 1;
+ bool fallback = 1;
zval * offset;
zval * object;
typedef struct {
zend_object_iterator intern;
ResourceBundle_object *subject;
- zend_bool is_table;
+ bool is_table;
zend_long length;
zval current;
char *currentkey;
const TimeZone *utimezone;
//whether to delete the timezone on object free
- zend_bool should_delete;
+ bool should_delete;
zend_object zo;
} TimeZone_object;
size_t region_len = 0;
int32_t offset,
*offsetp = NULL;
- zend_bool arg3isnull = 1;
+ bool arg3isnull = 1;
intl_error_reset(NULL);
U_CFUNC PHP_FUNCTION(intltz_get_offset)
{
double date;
- zend_bool local;
+ bool local;
zval *rawOffsetArg,
*dstOffsetArg;
int32_t rawOffset,
U_CFUNC PHP_FUNCTION(intltz_get_display_name)
{
- zend_bool daylight = 0;
+ bool daylight = 0;
zend_long display_type = TimeZone::LONG;
const char *locale_str = NULL;
size_t dummy = 0;
{
char *str;
size_t str_len;
- zend_bool assoc = 0; /* return JS objects as PHP objects by default */
- zend_bool assoc_null = 1;
+ bool assoc = 0; /* return JS objects as PHP objects by default */
+ bool assoc_null = 1;
zend_long depth = PHP_JSON_PARSER_DEFAULT_DEPTH;
zend_long options = 0;
return PHP_JSON_T_FALSE;
}
<JS>INT {
- zend_bool bigint = 0, negative = s->token[0] == '-';
+ bool bigint = 0, negative = s->token[0] == '-';
size_t digits = (size_t) (s->cursor - s->token - negative);
if (digits >= PHP_JSON_INT_MAX_LENGTH) {
if (digits == PHP_JSON_INT_MAX_LENGTH) {
PHP_JSON_API int php_json_encode(smart_str *buf, zval *val, int options);
PHP_JSON_API int php_json_decode_ex(zval *return_value, const char *str, size_t str_len, zend_long options, zend_long depth);
-static inline int php_json_decode(zval *return_value, const char *str, int str_len, zend_bool assoc, zend_long depth)
+static inline int php_json_decode(zval *return_value, const char *str, int str_len, bool assoc, zend_long depth)
{
return php_json_decode_ex(return_value, str, str_len, assoc ? PHP_JSON_OBJECT_AS_ARRAY : 0, depth);
}
int rc, msgid;
char *dn, *newrdn, *newparent;
size_t dn_len, newrdn_len, newparent_len;
- zend_bool deleteoldrdn;
+ bool deleteoldrdn;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsssb|a!", &link, &dn, &dn_len, &newrdn, &newrdn_len, &newparent, &newparent_len, &deleteoldrdn, &serverctrls) != SUCCESS) {
RETURN_THROWS();
/* }}} */
#endif
-static zend_string* php_ldap_do_escape(const zend_bool *map, const char *value, size_t valuelen, zend_long flags)
+static zend_string* php_ldap_do_escape(const bool *map, const char *value, size_t valuelen, zend_long flags)
{
char hex[] = "0123456789abcdef";
size_t i, p = 0;
return ret;
}
-static void php_ldap_escape_map_set_chars(zend_bool *map, const char *chars, const size_t charslen, char escape)
+static void php_ldap_escape_map_set_chars(bool *map, const char *chars, const size_t charslen, char escape)
{
size_t i = 0;
while (i < charslen) {
size_t valuelen = 0, ignoreslen = 0;
int i;
zend_long flags = 0;
- zend_bool map[256] = {0}, havecharlist = 0;
+ bool map[256] = {0}, havecharlist = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|sl", &value, &valuelen, &ignores, &ignoreslen, &flags) != SUCCESS) {
RETURN_THROWS();
PHP_FUNCTION(libxml_use_internal_errors)
{
xmlStructuredErrorFunc current_handler;
- zend_bool use_errors, use_errors_is_null = 1, retval;
+ bool use_errors, use_errors_is_null = 1, retval;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
}
/* }}} */
-PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable) /* {{{ */
+PHP_LIBXML_API bool php_libxml_disable_entity_loader(bool disable) /* {{{ */
{
- zend_bool old = LIBXML(entity_loader_disabled);
+ bool old = LIBXML(entity_loader_disabled);
LIBXML(entity_loader_disabled) = disable;
return old;
/* {{{ Disable/Enable ability to load external entities */
PHP_FUNCTION(libxml_disable_entity_loader)
{
- zend_bool disable = 1;
+ bool disable = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
zend_fcall_info fci;
zend_fcall_info_cache fcc;
} entity_loader;
- zend_bool entity_loader_disabled;
+ bool entity_loader_disabled;
ZEND_END_MODULE_GLOBALS(libxml)
typedef struct _libxml_doc_props {
PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s);
PHP_LIBXML_API void php_libxml_switch_context(zval *context, zval *oldcontext);
PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg);
-PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable);
+PHP_LIBXML_API bool php_libxml_disable_entity_loader(bool disable);
/* Init/shutdown functions*/
PHP_LIBXML_API void php_libxml_initialize(void);
static void php_mb_gpc_set_input_encoding(const zend_encoding *encoding);
-static inline zend_bool php_mb_is_unsupported_no_encoding(enum mbfl_no_encoding no_enc);
+static inline bool php_mb_is_unsupported_no_encoding(enum mbfl_no_encoding no_enc);
-static inline zend_bool php_mb_is_no_encoding_utf8(enum mbfl_no_encoding no_enc);
+static inline bool php_mb_is_no_encoding_utf8(enum mbfl_no_encoding no_enc);
/* }}} */
/* {{{ php_mb_default_identify_list */
*/
static zend_result php_mb_parse_encoding_list(const char *value, size_t value_length,
const mbfl_encoding ***return_list, size_t *return_size, bool persistent, uint32_t arg_num,
- zend_bool allow_pass_encoding)
+ bool allow_pass_encoding)
{
if (value == NULL || value_length == 0) {
*return_list = NULL;
*return_size = 0;
return SUCCESS;
} else {
- zend_bool included_auto;
+ bool included_auto;
size_t n, size;
char *p1, *endp, *tmpstr;
const mbfl_encoding **entry, **list;
size_t size = zend_hash_num_elements(target_hash) + MBSTRG(default_detect_order_list_size);
const mbfl_encoding **list = ecalloc(size, sizeof(mbfl_encoding*));
const mbfl_encoding **entry = list;
- zend_bool included_auto = 0;
+ bool included_auto = 0;
size_t n = 0;
zval *hash_entry;
ZEND_HASH_FOREACH_VAL(target_hash, hash_entry) {
{
zend_string *substitute_character = NULL;
zend_long substitute_codepoint;
- zend_bool substitute_is_null = 1;
+ bool substitute_is_null = 1;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
char *haystack_val, *needle_val;
mbfl_string haystack, needle, result, *ret = NULL;
zend_string *encoding_name = NULL;
- zend_bool part = 0;
+ bool part = 0;
ZEND_PARSE_PARAMETERS_START(2, 4)
Z_PARAM_STRING(haystack_val, haystack.len)
zend_long from, len;
size_t real_from, real_len;
size_t str_len;
- zend_bool len_is_null = 1;
+ bool len_is_null = 1;
mbfl_string string, result, *ret;
ZEND_PARSE_PARAMETERS_START(2, 4)
zend_string *encoding = NULL;
char *string_val;
zend_long from, len;
- zend_bool len_is_null = 1;
+ bool len_is_null = 1;
mbfl_string string, result, *ret;
ZEND_PARSE_PARAMETERS_START(2, 4)
/* See mbfl_no_encoding definition for list of unsupported encodings */
-static inline zend_bool php_mb_is_unsupported_no_encoding(enum mbfl_no_encoding no_enc)
+static inline bool php_mb_is_unsupported_no_encoding(enum mbfl_no_encoding no_enc)
{
return ((no_enc >= mbfl_no_encoding_invalid && no_enc <= mbfl_no_encoding_qprint)
|| (no_enc >= mbfl_no_encoding_utf7 && no_enc <= mbfl_no_encoding_utf7imap)
/* See mbfl_no_encoding definition for list of UTF-8 encodings */
-static inline zend_bool php_mb_is_no_encoding_utf8(enum mbfl_no_encoding no_enc)
+static inline bool php_mb_is_no_encoding_utf8(enum mbfl_no_encoding no_enc)
{
return (no_enc >= mbfl_no_encoding_utf8 && no_enc <= mbfl_no_encoding_utf8_sb);
}
HashTable *input_ht, *from_encodings_ht = NULL;
const mbfl_encoding **from_encodings;
size_t num_from_encodings;
- zend_bool free_from_encodings;
+ bool free_from_encodings;
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_ARRAY_HT_OR_STR(input_ht, input_str)
size_t str_len;
zend_string *encoding_str = NULL;
HashTable *encoding_ht = NULL;
- zend_bool strict = 0;
+ bool strict = 0;
mbfl_string string;
const mbfl_encoding *ret;
const mbfl_encoding **elist;
size_t size;
- zend_bool free_elist;
+ bool free_elist;
ZEND_PARSE_PARAMETERS_START(1, 3)
Z_PARAM_STRING(str, str_len)
zend_string *encoding = NULL;
int mapsize;
HashTable *target_hash;
- zend_bool is_hex = 0;
+ bool is_hex = 0;
mbfl_string string, result, *ret;
ZEND_PARSE_PARAMETERS_START(2, 4)
int current_filter_illegal_mode;
int current_filter_illegal_substchar;
enum mbfl_no_language language;
- zend_bool encoding_translation;
- zend_bool strict_detection;
+ bool encoding_translation;
+ bool strict_detection;
size_t illegalchars;
mbfl_buffer_converter *outconv;
void *http_output_conv_mimetypes;
zend_string *last_used_encoding_name;
const mbfl_encoding *last_used_encoding;
/* Whether an explicit internal_encoding / http_output / http_input encoding was set. */
- zend_bool internal_encoding_set;
- zend_bool http_output_set;
- zend_bool http_input_set;
+ bool internal_encoding_set;
+ bool http_output_set;
+ bool http_input_set;
#ifdef HAVE_MBREGEX
zend_long regex_retry_limit;
#endif
zend_class_entry *mysqli_exception_class_entry;
-typedef int (*mysqli_read_t)(mysqli_object *obj, zval *rv, zend_bool quiet);
+typedef int (*mysqli_read_t)(mysqli_object *obj, zval *rv, bool quiet);
typedef int (*mysqli_write_t)(mysqli_object *obj, zval *newval);
typedef struct _mysqli_prop_handler {
/* }}} */
/* {{{ mysqli_read_na */
-static int mysqli_read_na(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int mysqli_read_na(mysqli_object *obj, zval *retval, bool quiet)
{
if (!quiet) {
zend_throw_error(NULL, "Cannot read property");
{
char * ret = NULL;
if (name) {
- zend_bool warned = FALSE;
+ bool warned = FALSE;
const char * p_orig = name;
char * p_copy;
p_copy = ret = emalloc(strlen(name) + 1 + 2 + 2 + 1); /* space, open, close, NullS */
/* }}} */
/* {{{ mysqli_commit_or_rollback_libmysql */
-static int mysqli_commit_or_rollback_libmysql(MYSQL * conn, zend_bool commit, const uint32_t mode, const char * const name)
+static int mysqli_commit_or_rollback_libmysql(MYSQL * conn, bool commit, const uint32_t mode, const char * const name)
{
int ret;
smart_str tmp_str = {0};
{
MY_MYSQL *mysql;
zval *mysql_link;
- zend_bool automode;
+ bool automode;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ob", &mysql_link, mysqli_link_class_entry, &automode) == FAILURE) {
RETURN_THROWS();
{
MY_STMT *stmt;
zval *mysql_stmt;
- zend_bool fetched_anything;
+ bool fetched_anything;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
RETURN_THROWS();
/* }}} */
/* {{{ php_mysqli_init() */
-void php_mysqli_init(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_method)
+void php_mysqli_init(INTERNAL_FUNCTION_PARAMETERS, bool is_method)
{
MYSQLI_RESOURCE *mysqli_resource;
MY_MYSQL *mysql;
#include "zend_exceptions.h"
#define MAP_PROPERTY_MYG_BOOL_READ(name, value) \
-static int name(mysqli_object *obj, zval *retval, zend_bool quiet) \
+static int name(mysqli_object *obj, zval *retval, bool quiet) \
{ \
ZVAL_BOOL(retval, MyG(value)); \
return SUCCESS; \
} \
#define MAP_PROPERTY_MYG_LONG_READ(name, value) \
-static int name(mysqli_object *obj, zval *retval, zend_bool quiet) \
+static int name(mysqli_object *obj, zval *retval, bool quiet) \
{ \
ZVAL_LONG(retval, MyG(value)); \
return SUCCESS; \
} \
#define MAP_PROPERTY_MYG_STRING_READ(name, value) \
-static int name(mysqli_object *obj, zval *retval, zend_bool quiet) \
+static int name(mysqli_object *obj, zval *retval, bool quiet) \
{ \
ZVAL_STRING(retval, MyG(value)); \
return SUCCESS; \
/* }}} */
/* {{{ property driver_client_version_read */
-static int driver_client_version_read(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int driver_client_version_read(mysqli_object *obj, zval *retval, bool quiet)
{
ZVAL_LONG(retval, mysql_get_client_version());
/* }}} */
/* {{{ property driver_client_info_read */
-static int driver_client_info_read(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int driver_client_info_read(mysqli_object *obj, zval *retval, bool quiet)
{
ZVAL_STRING(retval, (char *)mysql_get_client_info());
/* }}} */
/* {{{ property driver_driver_version_read */
-static int driver_driver_version_read(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int driver_driver_version_read(mysqli_object *obj, zval *retval, bool quiet)
{
ZVAL_LONG(retval, MYSQLI_VERSION_ID);
}
/* }}} */
-void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_connect, zend_bool in_ctor) /* {{{ */
+void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, bool is_real_connect, bool in_ctor) /* {{{ */
{
MY_MYSQL *mysql = NULL;
MYSQLI_RESOURCE *mysqli_resource = NULL;
*ssl_key = NULL, *ssl_cert = NULL, *ssl_ca = NULL, *ssl_capath = NULL,
*ssl_cipher = NULL;
size_t hostname_len = 0, username_len = 0, passwd_len = 0, dbname_len = 0, socket_len = 0;
- zend_bool persistent = FALSE, ssl = FALSE;
+ bool persistent = FALSE, ssl = FALSE;
zend_long port = 0, flags = 0;
- zend_bool port_is_null = 1;
+ bool port_is_null = 1;
zend_string *hash_key = NULL;
- zend_bool new_connection = FALSE;
+ bool new_connection = FALSE;
zend_resource *le;
mysqli_plist_entry *plist = NULL;
- zend_bool self_alloced = 0;
+ bool self_alloced = 0;
#if !defined(MYSQL_USE_MYSQLND)
#ifndef MYSQLI_USE_MYSQLND
/* {{{ */
-static int mysqli_savepoint_libmysql(MYSQL * conn, const char * const name, zend_bool release)
+static int mysqli_savepoint_libmysql(MYSQL * conn, const char * const name, bool release)
{
int ret;
char * query;
php_mysqli_report_error(mysql_stmt_sqlstate(stmt), mysql_stmt_errno(stmt), mysql_stmt_error(stmt)); \
}
-void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_connect, zend_bool in_ctor);
+void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, bool is_real_connect, bool in_ctor);
-void php_mysqli_init(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_method);
+void php_mysqli_init(INTERNAL_FUNCTION_PARAMETERS, bool is_method);
#endif /* MYSQLI_PRIV_H */
}
#define MYSQLI_MAP_PROPERTY_FUNC_LONG( __func, __int_func, __get_type, __ret_type, __ret_type_sprint_mod)\
-static int __func(mysqli_object *obj, zval *retval, zend_bool quiet) \
+static int __func(mysqli_object *obj, zval *retval, bool quiet) \
{\
__ret_type l;\
__get_type;\
}
#define MYSQLI_MAP_PROPERTY_FUNC_STRING(__func, __int_func, __get_type)\
-static int __func(mysqli_object *obj, zval *retval, zend_bool quiet)\
+static int __func(mysqli_object *obj, zval *retval, bool quiet)\
{\
char *c;\
__get_type;\
}
/* {{{ property link_client_version_read */
-static int link_client_version_read(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int link_client_version_read(mysqli_object *obj, zval *retval, bool quiet)
{
ZVAL_LONG(retval, MYSQL_VERSION_ID);
/* }}} */
/* {{{ property link_client_info_read */
-static int link_client_info_read(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int link_client_info_read(mysqli_object *obj, zval *retval, bool quiet)
{
CHECK_STATUS(MYSQLI_STATUS_INITIALIZED, quiet);
ZVAL_STRING(retval, MYSQL_SERVER_VERSION);
/* }}} */
/* {{{ property link_connect_errno_read */
-static int link_connect_errno_read(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int link_connect_errno_read(mysqli_object *obj, zval *retval, bool quiet)
{
ZVAL_LONG(retval, (zend_long)MyG(error_no));
/* }}} */
/* {{{ property link_connect_error_read */
-static int link_connect_error_read(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int link_connect_error_read(mysqli_object *obj, zval *retval, bool quiet)
{
if (MyG(error_msg)) {
ZVAL_STRING(retval, MyG(error_msg));
/* }}} */
/* {{{ property link_affected_rows_read */
-static int link_affected_rows_read(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int link_affected_rows_read(mysqli_object *obj, zval *retval, bool quiet)
{
MY_MYSQL *mysql;
my_ulonglong rc;
/* }}} */
/* {{{ property link_error_list_read */
-static int link_error_list_read(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int link_error_list_read(mysqli_object *obj, zval *retval, bool quiet)
{
MY_MYSQL *mysql;
/* result properties */
/* {{{ property result_type_read */
-static int result_type_read(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int result_type_read(mysqli_object *obj, zval *retval, bool quiet)
{
MYSQL_RES *p;
/* }}} */
/* {{{ property result_lengths_read */
-static int result_lengths_read(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int result_lengths_read(mysqli_object *obj, zval *retval, bool quiet)
{
MYSQL_RES *p;
#ifdef MYSQLI_USE_MYSQLND
/* statement properties */
/* {{{ property stmt_id_read */
-static int stmt_id_read(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int stmt_id_read(mysqli_object *obj, zval *retval, bool quiet)
{
MY_STMT *p;
/* }}} */
/* {{{ property stmt_affected_rows_read */
-static int stmt_affected_rows_read(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int stmt_affected_rows_read(mysqli_object *obj, zval *retval, bool quiet)
{
MY_STMT *p;
my_ulonglong rc;
/* }}} */
/* {{{ property stmt_error_list_read */
-static int stmt_error_list_read(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int stmt_error_list_read(mysqli_object *obj, zval *retval, bool quiet)
{
MY_STMT * stmt;
/* }}} */
/* {{{ property mysqli_warning_message */
-static int mysqli_warning_message(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int mysqli_warning_message(mysqli_object *obj, zval *retval, bool quiet)
{
MYSQLI_WARNING *w;
/* }}} */
/* {{{ property mysqli_warning_sqlstate */
-static int mysqli_warning_sqlstate(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int mysqli_warning_sqlstate(mysqli_object *obj, zval *retval, bool quiet)
{
MYSQLI_WARNING *w;
/* }}} */
/* {{{ property mysqli_warning_error */
-static int mysqli_warning_errno(mysqli_object *obj, zval *retval, zend_bool quiet)
+static int mysqli_warning_errno(mysqli_object *obj, zval *retval, bool quiet)
{
MYSQLI_WARNING *w;
zval li_read;
php_stream *li_stream;
unsigned int multi_query;
- zend_bool persistent;
+ bool persistent;
#ifdef MYSQLI_USE_MYSQLND
int async_result_fetch_type;
#endif
typedef struct _mysqli_property_entry {
const char *pname;
size_t pname_length;
- int (*r_func)(mysqli_object *obj, zval *retval, zend_bool quiet);
+ int (*r_func)(mysqli_object *obj, zval *retval, bool quiet);
int (*w_func)(mysqli_object *obj, zval *value);
} mysqli_property_entry;
zend_long report_mode;
HashTable *report_ht;
zend_ulong multi_query;
- zend_bool rollback_on_cached_plink;
+ bool rollback_on_cached_plink;
ZEND_END_MODULE_GLOBALS(mysqli)
#define MyG(v) ZEND_MODULE_GLOBALS_ACCESSOR(mysqli, v)
#define mysqlnd_connect(conn, host, user, pass, pass_len, db, db_len, port, socket, mysql_flags, client_api_flags) \
mysqlnd_connection_connect((conn), (host), (user), (pass), (pass_len), (db), (db_len), (port), (socket), (mysql_flags), (client_api_flags))
-PHPAPI MYSQLND * mysqlnd_connection_init(const size_t client_flags, const zend_bool persistent, MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *object_factory);
+PHPAPI MYSQLND * mysqlnd_connection_init(const size_t client_flags, const bool persistent, MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *object_factory);
PHPAPI MYSQLND * mysqlnd_connection_connect(MYSQLND * conn,
const char * const host,
const char * const user,
zend_long net_read_timeout;
zend_long mempool_default_size;
char * sha256_server_public_key;
- zend_bool collect_statistics;
- zend_bool collect_memory_statistics;
+ bool collect_statistics;
+ bool collect_memory_statistics;
ZEND_END_MODULE_GLOBALS(mysqlnd)
PHPAPI ZEND_EXTERN_MODULE_GLOBALS(mysqlnd)
static void * _mysqlnd_emalloc(size_t size MYSQLND_MEM_D)
{
void *ret;
- zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
+ bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
TRACE_ALLOC_ENTER(mysqlnd_emalloc_name);
ret = emalloc_rel(REAL_SIZE(size));
/* {{{ _mysqlnd_pemalloc */
-static void * _mysqlnd_pemalloc(size_t size, zend_bool persistent MYSQLND_MEM_D)
+static void * _mysqlnd_pemalloc(size_t size, bool persistent MYSQLND_MEM_D)
{
void *ret;
- zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
+ bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
TRACE_ALLOC_ENTER(mysqlnd_pemalloc_name);
ret = pemalloc_rel(REAL_SIZE(size), persistent);
static void * _mysqlnd_ecalloc(unsigned int nmemb, size_t size MYSQLND_MEM_D)
{
void *ret;
- zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
+ bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
TRACE_ALLOC_ENTER(mysqlnd_ecalloc_name);
TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(FALSE));
ret = ecalloc_rel(nmemb, REAL_SIZE(size));
/* {{{ _mysqlnd_pecalloc */
-static void * _mysqlnd_pecalloc(unsigned int nmemb, size_t size, zend_bool persistent MYSQLND_MEM_D)
+static void * _mysqlnd_pecalloc(unsigned int nmemb, size_t size, bool persistent MYSQLND_MEM_D)
{
void *ret;
- zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
+ bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
TRACE_ALLOC_ENTER(mysqlnd_pecalloc_name);
ret = pecalloc_rel(nmemb, REAL_SIZE(size), persistent);
static void * _mysqlnd_erealloc(void *ptr, size_t new_size MYSQLND_MEM_D)
{
void *ret;
- zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
+ bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
size_t old_size = collect_memory_statistics && ptr? *(size_t *) (((char*)ptr) - sizeof(size_t)) : 0;
TRACE_ALLOC_ENTER(mysqlnd_erealloc_name);
TRACE_ALLOC_INF_FMT("ptr=%p old_size=%lu, new_size=%lu", ptr, old_size, new_size);
/* {{{ _mysqlnd_perealloc */
-static void * _mysqlnd_perealloc(void *ptr, size_t new_size, zend_bool persistent MYSQLND_MEM_D)
+static void * _mysqlnd_perealloc(void *ptr, size_t new_size, bool persistent MYSQLND_MEM_D)
{
void *ret;
- zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
+ bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
size_t old_size = collect_memory_statistics && ptr? *(size_t *) (((char*)ptr) - sizeof(size_t)) : 0;
TRACE_ALLOC_ENTER(mysqlnd_perealloc_name);
TRACE_ALLOC_INF_FMT("ptr=%p old_size=%lu new_size=%lu persistent=%u", ptr, old_size, new_size, persistent);
static void _mysqlnd_efree(void *ptr MYSQLND_MEM_D)
{
size_t free_amount = 0;
- zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
+ bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
TRACE_ALLOC_ENTER(mysqlnd_efree_name);
#if PHP_DEBUG
/* {{{ _mysqlnd_pefree */
-static void _mysqlnd_pefree(void *ptr, zend_bool persistent MYSQLND_MEM_D)
+static void _mysqlnd_pefree(void *ptr, bool persistent MYSQLND_MEM_D)
{
size_t free_amount = 0;
- zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
+ bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
TRACE_ALLOC_ENTER(mysqlnd_pefree_name);
#if PHP_DEBUG
/* {{{ _mysqlnd_pememdup */
-static char * _mysqlnd_pememdup(const char * const ptr, size_t length, zend_bool persistent MYSQLND_MEM_D)
+static char * _mysqlnd_pememdup(const char * const ptr, size_t length, bool persistent MYSQLND_MEM_D)
{
char * ret;
- zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
+ bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
TRACE_ALLOC_ENTER(mysqlnd_pememdup_name);
#if PHP_DEBUG
/* {{{ _mysqlnd_pestrndup */
-static char * _mysqlnd_pestrndup(const char * const ptr, size_t length, zend_bool persistent MYSQLND_MEM_D)
+static char * _mysqlnd_pestrndup(const char * const ptr, size_t length, bool persistent MYSQLND_MEM_D)
{
char * ret;
- zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
+ bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
TRACE_ALLOC_ENTER(mysqlnd_pestrndup_name);
#if PHP_DEBUG
/* {{{ _mysqlnd_pestrdup */
-static char * _mysqlnd_pestrdup(const char * const ptr, zend_bool persistent MYSQLND_MEM_D)
+static char * _mysqlnd_pestrdup(const char * const ptr, bool persistent MYSQLND_MEM_D)
{
char * ret;
smart_str tmp_str = {0, 0};
const char * p = ptr;
- zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
+ bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
TRACE_ALLOC_ENTER(mysqlnd_pestrdup_name);
#if PHP_DEBUG
{
/* {{{ mysqlnd_zend_mm_pemalloc */
-static void * mysqlnd_zend_mm_pemalloc(size_t size, zend_bool persistent MYSQLND_MEM_D)
+static void * mysqlnd_zend_mm_pemalloc(size_t size, bool persistent MYSQLND_MEM_D)
{
return pemalloc_rel(size, persistent);
}
/* {{{ mysqlnd_zend_mm_pecalloc */
-static void * mysqlnd_zend_mm_pecalloc(unsigned int nmemb, size_t size, zend_bool persistent MYSQLND_MEM_D)
+static void * mysqlnd_zend_mm_pecalloc(unsigned int nmemb, size_t size, bool persistent MYSQLND_MEM_D)
{
return pecalloc_rel(nmemb, size, persistent);
}
/* {{{ mysqlnd_zend_mm_perealloc */
-static void * mysqlnd_zend_mm_perealloc(void *ptr, size_t new_size, zend_bool persistent MYSQLND_MEM_D)
+static void * mysqlnd_zend_mm_perealloc(void *ptr, size_t new_size, bool persistent MYSQLND_MEM_D)
{
return perealloc_rel(ptr, new_size, persistent);
}
/* {{{ mysqlnd_zend_mm_pefree */
-static void mysqlnd_zend_mm_pefree(void * ptr, zend_bool persistent MYSQLND_MEM_D)
+static void mysqlnd_zend_mm_pefree(void * ptr, bool persistent MYSQLND_MEM_D)
{
pefree_rel(ptr, persistent);
}
/* {{{ mysqlnd_zend_mm_pememdup */
-static char * mysqlnd_zend_mm_pememdup(const char * const ptr, size_t length, zend_bool persistent MYSQLND_MEM_D)
+static char * mysqlnd_zend_mm_pememdup(const char * const ptr, size_t length, bool persistent MYSQLND_MEM_D)
{
char * dest = pemalloc_rel(length, persistent);
if (dest) {
/* {{{ mysqlnd_zend_mm_pestrndup */
-static char * mysqlnd_zend_mm_pestrndup(const char * const ptr, size_t length, zend_bool persistent MYSQLND_MEM_D)
+static char * mysqlnd_zend_mm_pestrndup(const char * const ptr, size_t length, bool persistent MYSQLND_MEM_D)
{
return persistent? zend_strndup(ptr, length ) : estrndup_rel(ptr, length);
}
/* {{{ mysqlnd_zend_mm_pestrdup */
-static char * mysqlnd_zend_mm_pestrdup(const char * const ptr, zend_bool persistent MYSQLND_MEM_D)
+static char * mysqlnd_zend_mm_pestrdup(const char * const ptr, bool persistent MYSQLND_MEM_D)
{
return pestrdup_rel(ptr, persistent);
}
struct st_mysqlnd_allocator_methods
{
void * (*m_emalloc)(size_t size MYSQLND_MEM_D);
- void * (*m_pemalloc)(size_t size, zend_bool persistent MYSQLND_MEM_D);
+ void * (*m_pemalloc)(size_t size, bool persistent MYSQLND_MEM_D);
void * (*m_ecalloc)(unsigned int nmemb, size_t size MYSQLND_MEM_D);
- void * (*m_pecalloc)(unsigned int nmemb, size_t size, zend_bool persistent MYSQLND_MEM_D);
+ void * (*m_pecalloc)(unsigned int nmemb, size_t size, bool persistent MYSQLND_MEM_D);
void * (*m_erealloc)(void *ptr, size_t new_size MYSQLND_MEM_D);
- void * (*m_perealloc)(void *ptr, size_t new_size, zend_bool persistent MYSQLND_MEM_D);
+ void * (*m_perealloc)(void *ptr, size_t new_size, bool persistent MYSQLND_MEM_D);
void (*m_efree)(void *ptr MYSQLND_MEM_D);
- void (*m_pefree)(void *ptr, zend_bool persistent MYSQLND_MEM_D);
- char * (*m_pememdup)(const char * const ptr, size_t size, zend_bool persistent MYSQLND_MEM_D);
- char * (*m_pestrndup)(const char * const ptr, size_t size, zend_bool persistent MYSQLND_MEM_D);
- char * (*m_pestrdup)(const char * const ptr, zend_bool persistent MYSQLND_MEM_D);
+ void (*m_pefree)(void *ptr, bool persistent MYSQLND_MEM_D);
+ char * (*m_pememdup)(const char * const ptr, size_t size, bool persistent MYSQLND_MEM_D);
+ char * (*m_pestrndup)(const char * const ptr, size_t size, bool persistent MYSQLND_MEM_D);
+ char * (*m_pestrdup)(const char * const ptr, bool persistent MYSQLND_MEM_D);
int (*m_sprintf)(char **pbuf, size_t max_len, const char *format, ...);
int (*m_vsprintf)(char **pbuf, size_t max_len, const char *format, va_list ap);
void (*m_sprintf_free)(char * p);
#define mnd_vsprintf(p, mx_len, fmt,ap) mysqlnd_allocator.m_vsprintf((p), (mx_len), (fmt), (ap))
#define mnd_sprintf_free(p) mysqlnd_allocator.m_sprintf_free((p))
-static inline MYSQLND_STRING mnd_dup_cstring(const MYSQLND_CSTRING str, const zend_bool persistent)
+static inline MYSQLND_STRING mnd_dup_cstring(const MYSQLND_CSTRING str, const bool persistent)
{
const MYSQLND_STRING ret = {(char*) mnd_pemalloc(str.l + 1, persistent), str.l};
if (ret.s) {
const unsigned int charset_no,
const MYSQLND_SESSION_OPTIONS * const session_options,
const zend_ulong mysql_flags,
- const zend_bool silent,
- const zend_bool is_change_user
+ const bool silent,
+ const bool is_change_user
)
{
enum_func_status ret = FAIL;
- zend_bool first_call = TRUE;
+ bool first_call = TRUE;
char * switch_to_auth_protocol = NULL;
size_t switch_to_auth_protocol_len = 0;
const MYSQLND_SESSION_OPTIONS * const session_options,
const zend_ulong mysql_flags,
const unsigned int server_charset_no,
- const zend_bool use_full_blown_auth_packet,
+ const bool use_full_blown_auth_packet,
const char * const auth_protocol,
struct st_mysqlnd_authentication_plugin * auth_plugin,
const zend_uchar * const orig_auth_plugin_data,
const size_t passwd_len,
const char * const db,
const size_t db_len,
- const zend_bool silent,
- const zend_bool use_full_blown_auth_packet,
+ const bool silent,
+ const bool use_full_blown_auth_packet,
const char * const auth_protocol,
struct st_mysqlnd_authentication_plugin * auth_plugin,
const zend_uchar * const orig_auth_plugin_data,
const MYSQLND_SESSION_OPTIONS * const session_options,
const zend_ulong mysql_flags,
const unsigned int server_charset_no,
- const zend_bool use_full_blown_auth_packet,
+ const bool use_full_blown_auth_packet,
const char * const auth_protocol,
struct st_mysqlnd_authentication_plugin * auth_plugin,
const zend_uchar * const orig_auth_plugin_data,
const size_t passwd_len,
const char * const db,
const size_t db_len,
- const zend_bool silent,
- const zend_bool use_full_blown_auth_packet,
+ const bool silent,
+ const bool use_full_blown_auth_packet,
const char * const auth_protocol,
struct st_mysqlnd_authentication_plugin * auth_plugin,
const zend_uchar * const orig_auth_plugin_data,
const unsigned int charset_no,
const MYSQLND_SESSION_OPTIONS * const session_options,
const zend_ulong mysql_flags,
- const zend_bool silent,
- const zend_bool is_change_user
+ const bool silent,
+ const bool is_change_user
);
PHPAPI void php_mysqlnd_scramble(zend_uchar * const buffer, const zend_uchar * const scramble, const zend_uchar * const pass, const size_t pass_len);
const char *newstr_s = newstr;
const char *newstr_e = newstr + 2 * escapestr_len;
const char *end = escapestr + escapestr_len;
- zend_bool escape_overflow = FALSE;
+ bool escape_overflow = FALSE;
DBG_ENTER("mysqlnd_cset_escape_quotes");
const char *newstr_s = newstr;
const char *newstr_e = newstr + 2 * escapestr_len;
const char *end = escapestr + escapestr_len;
- zend_bool escape_overflow = FALSE;
+ bool escape_overflow = FALSE;
DBG_ENTER("mysqlnd_cset_escape_slashes");
DBG_INF_FMT("charset=%s", cset->name);
/* {{{ mysqlnd_command::process_kill */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_command, process_kill)(MYSQLND_CONN_DATA * const conn, const unsigned int process_id, const zend_bool read_response)
+MYSQLND_METHOD(mysqlnd_command, process_kill)(MYSQLND_CONN_DATA * const conn, const unsigned int process_id, const bool read_response)
{
const func_mysqlnd_protocol_payload_decoder_factory__send_command send_command = conn->payload_decoder_factory->m.send_command;
const func_mysqlnd_protocol_payload_decoder_factory__send_command_handle_response send_command_handle_response = conn->payload_decoder_factory->m.send_command_handle_response;
/* {{{ mysqlnd_command::change_user */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_command, change_user)(MYSQLND_CONN_DATA * const conn, const MYSQLND_CSTRING payload, const zend_bool silent)
+MYSQLND_METHOD(mysqlnd_command, change_user)(MYSQLND_CONN_DATA * const conn, const MYSQLND_CSTRING payload, const bool silent)
{
const func_mysqlnd_protocol_payload_decoder_factory__send_command send_command = conn->payload_decoder_factory->m.send_command;
enum_func_status ret = FAIL;
#ifdef MYSQLND_SSL_SUPPORTED
if (client_capabilities & CLIENT_SSL) {
- const zend_bool server_has_ssl = (server_capabilities & CLIENT_SSL)? TRUE:FALSE;
+ const bool server_has_ssl = (server_capabilities & CLIENT_SSL)? TRUE:FALSE;
if (server_has_ssl == FALSE) {
goto close_conn;
} else {
/* {{{ mysqlnd_error_info_init */
PHPAPI void
-mysqlnd_error_info_init(MYSQLND_ERROR_INFO * const info, const zend_bool persistent)
+mysqlnd_error_info_init(MYSQLND_ERROR_INFO * const info, const bool persistent)
{
DBG_ENTER("mysqlnd_error_info_init");
info->m = mysqlnd_error_info_get_methods();
static void
MYSQLND_METHOD(mysqlnd_conn_data, free_options)(MYSQLND_CONN_DATA * conn)
{
- zend_bool pers = conn->persistent;
+ bool pers = conn->persistent;
if (conn->options->charset_name) {
mnd_pefree(conn->options->charset_name, pers);
static void
MYSQLND_METHOD(mysqlnd_conn_data, free_contents)(MYSQLND_CONN_DATA * conn)
{
- zend_bool pers = conn->persistent;
+ bool pers = conn->persistent;
DBG_ENTER("mysqlnd_conn_data::free_contents");
/* {{{ mysqlnd_conn_data::get_scheme */
static MYSQLND_STRING
-MYSQLND_METHOD(mysqlnd_conn_data, get_scheme)(MYSQLND_CONN_DATA * conn, MYSQLND_CSTRING hostname, MYSQLND_CSTRING *socket_or_pipe, unsigned int port, zend_bool * unix_socket, zend_bool * named_pipe)
+MYSQLND_METHOD(mysqlnd_conn_data, get_scheme)(MYSQLND_CONN_DATA * conn, MYSQLND_CSTRING hostname, MYSQLND_CSTRING *socket_or_pipe, unsigned int port, bool * unix_socket, bool * named_pipe)
{
MYSQLND_STRING transport;
DBG_ENTER("mysqlnd_conn_data::get_scheme");
)
{
const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), connect);
- zend_bool unix_socket = FALSE;
- zend_bool named_pipe = FALSE;
- zend_bool reconnect = FALSE;
- zend_bool saved_compression = FALSE;
- zend_bool local_tx_started = FALSE;
+ bool unix_socket = FALSE;
+ bool named_pipe = FALSE;
+ bool reconnect = FALSE;
+ bool saved_compression = FALSE;
+ bool local_tx_started = FALSE;
MYSQLND_PFC * pfc = conn->protocol_frame_codec;
MYSQLND_STRING transport = { NULL, 0 };
/* {{{ mysqlnd_conn_data::more_results */
-static zend_bool
+static bool
MYSQLND_METHOD(mysqlnd_conn_data, more_results)(const MYSQLND_CONN_DATA * const conn)
{
DBG_ENTER("mysqlnd_conn_data::more_results");
const char * user,
const char * passwd,
const char * db,
- zend_bool silent,
+ bool silent,
size_t passwd_len
)
{
char * ret = NULL;
DBG_ENTER("mysqlnd_escape_string_for_tx_name_in_comment");
if (name) {
- zend_bool warned = FALSE;
+ bool warned = FALSE;
const char * p_orig = name;
char * p_copy;
p_copy = ret = mnd_emalloc(strlen(name) + 1 + 2 + 2 + 1); /* space, open, close, NullS */
/* {{{ mysqlnd_conn_data::tx_commit_ex */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const zend_bool commit, const unsigned int flags, const char * const name)
+MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const bool commit, const unsigned int flags, const char * const name)
{
const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), tx_commit_or_rollback);
enum_func_status ret = FAIL;
php_socket_t this_fd;
php_stream *stream = NULL;
unsigned int ret = 0;
- zend_bool disproportion = FALSE;
+ bool disproportion = FALSE;
MYSQLND **fwd = conn_array, **bckwd = conn_array;
DBG_ENTER("mysqlnd_stream_array_from_fd_set");
)
{
enum_func_status ret = FAIL;
- zend_bool self_alloced = FALSE;
+ bool self_alloced = FALSE;
MYSQLND_CSTRING hostname = { host, host? strlen(host) : 0 };
MYSQLND_CSTRING username = { user, user? strlen(user) : 0 };
MYSQLND_CSTRING password = { passwd, passwd_len };
/* {{{ mysqlnd_connection_init */
PHPAPI MYSQLND *
-mysqlnd_connection_init(const size_t client_flags, const zend_bool persistent, MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *object_factory)
+mysqlnd_connection_init(const size_t client_flags, const bool persistent, MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *object_factory)
{
MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *factory = object_factory? object_factory : &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory);
MYSQLND * ret;
}
-PHPAPI void mysqlnd_error_info_init(MYSQLND_ERROR_INFO * const info, const zend_bool persistent);
+PHPAPI void mysqlnd_error_info_init(MYSQLND_ERROR_INFO * const info, const bool persistent);
PHPAPI void mysqlnd_error_info_free_contents(MYSQLND_ERROR_INFO * const info);
#define GET_CONNECTION_STATE(state_struct) (state_struct)->m->get((state_struct))
/* {{{ mysqlnd_debug::open */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_debug, open)(MYSQLND_DEBUG * self, zend_bool reopen)
+MYSQLND_METHOD(mysqlnd_debug, open)(MYSQLND_DEBUG * self, bool reopen)
{
if (!self->file_name) {
return FAIL;
/* FALSE - The DBG_ calls won't be traced, TRUE - will be traced */
/* {{{ mysqlnd_debug::func_enter */
-static zend_bool
+static bool
MYSQLND_METHOD(mysqlnd_debug, func_enter)(MYSQLND_DEBUG * self,
unsigned int line, const char * const file,
const char * const func_name, unsigned int func_name_len)
char **func_name;
uint64_t * parent_non_own_time_ptr = NULL, * mine_non_own_time_ptr = NULL;
uint64_t mine_non_own_time = 0;
- zend_bool profile_calls = self->flags & MYSQLND_DEBUG_PROFILE_CALLS? TRUE:FALSE;
+ bool profile_calls = self->flags & MYSQLND_DEBUG_PROFILE_CALLS? TRUE:FALSE;
if ((self->flags & MYSQLND_DEBUG_DUMP_TRACE) == 0 || self->file_name == NULL) {
return PASS;
struct st_mysqlnd_debug_methods
{
- enum_func_status (*open)(MYSQLND_DEBUG * self, zend_bool reopen);
+ enum_func_status (*open)(MYSQLND_DEBUG * self, bool reopen);
void (*set_mode)(MYSQLND_DEBUG * self, const char * const mode);
enum_func_status (*log)(MYSQLND_DEBUG * self, unsigned int line, const char * const file,
unsigned int level, const char * type, const char *message);
enum_func_status (*log_va)(MYSQLND_DEBUG * self, unsigned int line, const char * const file,
unsigned int level, const char * type, const char *format, ...);
- zend_bool (*func_enter)(MYSQLND_DEBUG * self, unsigned int line, const char * const file,
+ bool (*func_enter)(MYSQLND_DEBUG * self, unsigned int line, const char * const file,
const char * const func_name, unsigned int func_name_len);
enum_func_status (*func_leave)(MYSQLND_DEBUG * self, unsigned int line, const char * const file, uint64_t call_time);
enum_func_status (*close)(MYSQLND_DEBUG * self);
#define DBG_ENTER_EX2(dbg_obj1, dbg_obj2, func_name) \
struct timeval __dbg_prof_tp = {0}; \
uint64_t __dbg_prof_start = 0; /* initialization is needed */ \
- zend_bool dbg_skip_trace = TRUE; \
+ bool dbg_skip_trace = TRUE; \
((void)__dbg_prof_start); \
if ((dbg_obj1)) { \
dbg_skip_trace = !(dbg_obj1)->m->func_enter((dbg_obj1), __LINE__, __FILE__, func_name, strlen(func_name)); \
#include "mysqlnd_reverse_api.h"
#include "mysqlnd_ext_plugin.h"
-static zend_bool mysqlnd_library_initted = FALSE;
+static bool mysqlnd_library_initted = FALSE;
static struct st_mysqlnd_plugin_core mysqlnd_plugin_core =
{
/* {{{ mysqlnd_object_factory::get_connection */
static MYSQLND *
-MYSQLND_METHOD(mysqlnd_object_factory, get_connection)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *factory, const zend_bool persistent)
+MYSQLND_METHOD(mysqlnd_object_factory, get_connection)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *factory, const bool persistent)
{
const size_t alloc_size_ret = sizeof(MYSQLND) + mysqlnd_plugin_count() * sizeof(void *);
const size_t alloc_size_ret_data = sizeof(MYSQLND_CONN_DATA) + mysqlnd_plugin_count() * sizeof(void *);
/* {{{ mysqlnd_object_factory::get_pfc */
static MYSQLND_PFC *
-MYSQLND_METHOD(mysqlnd_object_factory, get_pfc)(const zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info)
+MYSQLND_METHOD(mysqlnd_object_factory, get_pfc)(const bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info)
{
const size_t pfc_alloc_size = ZEND_MM_ALIGNED_SIZE(sizeof(MYSQLND_PFC) + mysqlnd_plugin_count() * sizeof(void *));
const size_t pfc_data_alloc_size = sizeof(MYSQLND_PFC_DATA) + mysqlnd_plugin_count() * sizeof(void *);
/* {{{ mysqlnd_object_factory::get_vio */
static MYSQLND_VIO *
-MYSQLND_METHOD(mysqlnd_object_factory, get_vio)(const zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info)
+MYSQLND_METHOD(mysqlnd_object_factory, get_vio)(const bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info)
{
const size_t vio_alloc_size = ZEND_MM_ALIGNED_SIZE(sizeof(MYSQLND_VIO) + mysqlnd_plugin_count() * sizeof(void *));
const size_t vio_data_alloc_size = sizeof(MYSQLND_VIO_DATA) + mysqlnd_plugin_count() * sizeof(void *);
/* {{{ mysqlnd_object_factory::get_protocol_payload_decoder_factory */
static MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY *
-MYSQLND_METHOD(mysqlnd_object_factory, get_protocol_payload_decoder_factory)(MYSQLND_CONN_DATA * conn, const zend_bool persistent)
+MYSQLND_METHOD(mysqlnd_object_factory, get_protocol_payload_decoder_factory)(MYSQLND_CONN_DATA * conn, const bool persistent)
{
const size_t alloc_size = sizeof(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY *ret = mnd_pecalloc(1, alloc_size, persistent);
#define MYSQL_RES MYSQLND_RES
#define MYSQL_ROW MYSQLND_ROW_C
#define MYSQL MYSQLND
-#define my_bool zend_bool
+#define my_bool bool
#define my_ulonglong uint64_t
#define MYSQL_VERSION_ID MYSQLND_VERSION_ID
/* {{{ mysqlnd_handle_local_infile */
enum_func_status
-mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * const filename, zend_bool * is_warning)
+mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * const filename, bool * is_warning)
{
zend_uchar *buf = NULL;
zend_uchar empty_packet[MYSQLND_HEADER_SIZE];
PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_error_info);
PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_command);
-enum_func_status mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * const filename, zend_bool * is_warning);
+enum_func_status mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * const filename, bool * is_warning);
#endif /* MYSQLND_PRIV_H */
pfc->data->flags |= MYSQLND_PROTOCOL_FLAG_USE_COMPRESSION;
break;
case MYSQL_SERVER_PUBLIC_KEY: {
- const zend_bool pers = pfc->persistent;
+ const bool pers = pfc->persistent;
if (pfc->data->sha256_server_public_key) {
mnd_pefree(pfc->data->sha256_server_public_key, pers);
}
/* {{{ mysqlnd_pfc_init */
PHPAPI MYSQLND_PFC *
-mysqlnd_pfc_init(const zend_bool persistent, MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *object_factory, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info)
+mysqlnd_pfc_init(const bool persistent, MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *object_factory, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info)
{
MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *factory = object_factory? object_factory : &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory);
MYSQLND_PFC * pfc;
#ifndef MYSQLND_PROTOCOL_FRAME_CODEC_H
#define MYSQLND_PROTOCOL_FRAME_CODEC_H
-PHPAPI MYSQLND_PFC * mysqlnd_pfc_init(const zend_bool persistent, MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *object_factory, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info);
+PHPAPI MYSQLND_PFC * mysqlnd_pfc_init(const bool persistent, MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *object_factory, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info);
PHPAPI void mysqlnd_pfc_free(MYSQLND_PFC * const pfc, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info);
#endif /* MYSQLND_PROTOCOL_FRAME_CODEC_H */
const char * const mysqlnd_stmt_not_prepared = "Statement not prepared";
/* Exported by mysqlnd_ps_codec.c */
-enum_func_status mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer);
-enum_func_status mysqlnd_stmt_execute_batch_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer);
+enum_func_status mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, bool * free_buffer);
+enum_func_status mysqlnd_stmt_execute_batch_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, bool * free_buffer);
static void mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const stmt);
return PASS;
}
-static zend_bool mysqlnd_stmt_check_state(const MYSQLND_STMT_DATA *stmt)
+static bool mysqlnd_stmt_check_state(const MYSQLND_STMT_DATA *stmt)
{
const MYSQLND_CONN_DATA *conn = stmt->conn;
if (stmt->state != MYSQLND_STMT_WAITING_USE_OR_STORE) {
/* {{{ mysqlnd_stmt::more_results */
-static zend_bool
+static bool
MYSQLND_METHOD(mysqlnd_stmt, more_results)(const MYSQLND_STMT * s)
{
MYSQLND_STMT_DATA * stmt = s? s->data : NULL;
enum_func_status ret;
zend_uchar *request = NULL;
size_t request_len;
- zend_bool free_request;
+ bool free_request;
DBG_ENTER("mysqlnd_stmt::send_execute");
if (!stmt || !conn) {
/* {{{ mysqlnd_fetch_row_cursor */
enum_func_status
-mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, zval **row_ptr, const unsigned int flags, zend_bool * fetched_anything)
+mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, zval **row_ptr, const unsigned int flags, bool * fetched_anything)
{
enum_func_status ret;
MYSQLND_STMT_DATA * stmt = result->unbuf->stmt;
/* {{{ mysqlnd_stmt::fetch */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, fetch)(MYSQLND_STMT * const s, zend_bool * const fetched_anything)
+MYSQLND_METHOD(mysqlnd_stmt, fetch)(MYSQLND_STMT * const s, bool * const fetched_anything)
{
MYSQLND_STMT_DATA * stmt = s? s->data : NULL;
MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL;
switch (attr_type) {
case STMT_ATTR_UPDATE_MAX_LENGTH:
- *(zend_bool *) value= stmt->update_max_length;
+ *(bool *) value= stmt->update_max_length;
break;
case STMT_ATTR_CURSOR_TYPE:
*(unsigned long *) value= stmt->flags;
/* {{{ mysqlnd_stmt::close_on_server */
static enum_func_status
-MYSQLND_METHOD_PRIVATE(mysqlnd_stmt, close_on_server)(MYSQLND_STMT * const s, zend_bool implicit)
+MYSQLND_METHOD_PRIVATE(mysqlnd_stmt, close_on_server)(MYSQLND_STMT * const s, bool implicit)
{
MYSQLND_STMT_DATA * stmt = s? s->data : NULL;
MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL;
/* {{{ mysqlnd_stmt::dtor */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, dtor)(MYSQLND_STMT * const s, zend_bool implicit)
+MYSQLND_METHOD(mysqlnd_stmt, dtor)(MYSQLND_STMT * const s, bool implicit)
{
MYSQLND_STMT_DATA * stmt = (s != NULL) ? s->data:NULL;
enum_func_status ret = FAIL;
/* should be signed int */
int pack_len;
unsigned int php_type;
- zend_bool is_possibly_blob;
- zend_bool can_ret_as_str_in_uni;
+ bool is_possibly_blob;
+ bool can_ret_as_str_in_uni;
};
extern struct st_mysqlnd_perm_bind mysqlnd_ps_fetch_functions[MYSQL_TYPE_LAST + 1];
-enum_func_status mysqlnd_stmt_fetch_row_buffered(MYSQLND_RES * result, zval **row_data, const unsigned int flags, zend_bool * fetched_anything);
-enum_func_status mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, zval **row_data, const unsigned int flags, zend_bool * fetched_anything);
+enum_func_status mysqlnd_stmt_fetch_row_buffered(MYSQLND_RES * result, zval **row_data, const unsigned int flags, bool * fetched_anything);
+enum_func_status mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, zval **row_data, const unsigned int flags, bool * fetched_anything);
void _mysqlnd_init_ps_subsystem();/* This one is private, mysqlnd_library_init() will call it */
void _mysqlnd_init_ps_fetch_subsystem();
{
unsigned int year, month, day, hour, minute, second;
zend_ulong second_part;
- zend_bool neg;
+ bool neg;
enum mysqlnd_timestamp_type time_type;
};
{
char tmp[22];
size_t tmp_len = 0;
- zend_bool is_bit = field->type == MYSQL_TYPE_BIT;
+ bool is_bit = field->type == MYSQL_TYPE_BIT;
DBG_ENTER("ps_fetch_from_1_to_8_bytes");
DBG_INF_FMT("zv=%p byte_count=%u", zv, byte_count);
if (field->flags & UNSIGNED_FLAG) {
const zend_uchar * to = *row;
t.time_type = MYSQLND_TIMESTAMP_TIME;
- t.neg = (zend_bool) to[0];
+ t.neg = (bool) to[0];
t.day = (zend_ulong) sint4korr(to+1);
t.hour = (unsigned int) to[5];
/* {{{ mysqlnd_stmt_execute_generate_request */
enum_func_status
-mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer)
+mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, bool * free_buffer)
{
MYSQLND_STMT_DATA * stmt = s->data;
zend_uchar *p = stmt->execute_cmd_buffer.buffer,
/* {{{ mysqlnd_read_buffer_is_empty */
-static zend_bool
+static bool
mysqlnd_read_buffer_is_empty(const MYSQLND_READ_BUFFER * const buffer)
{
return buffer->len? FALSE:TRUE;
switch (rset_header.field_count) {
case MYSQLND_NULL_LENGTH: { /* LOAD DATA LOCAL INFILE */
- zend_bool is_warning;
+ bool is_warning;
DBG_INF("LOAD DATA");
conn->last_query_type = QUERY_LOAD_LOCAL;
conn->field_count = 0; /* overwrite previous value, or the last value could be used and lead to bug#53503 */
/* {{{ mysqlnd_result_unbuffered::fetch_row */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, zval **row_ptr, const unsigned int flags, zend_bool * fetched_anything)
+MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, zval **row_ptr, const unsigned int flags, bool * fetched_anything)
{
enum_func_status ret;
MYSQLND_PACKET_ROW *row_packet = result->unbuf->row_packet;
/* {{{ mysqlnd_result_buffered::fetch_row */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_result_buffered, fetch_row)(MYSQLND_RES * result, zval **row_ptr, const unsigned int flags, zend_bool * fetched_anything)
+MYSQLND_METHOD(mysqlnd_result_buffered, fetch_row)(MYSQLND_RES * result, zval **row_ptr, const unsigned int flags, bool * fetched_anything)
{
MYSQLND_RES_BUFFERED *set = result->stored_data;
/* {{{ mysqlnd_res::fetch_row */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_res, fetch_row)(MYSQLND_RES *result, zval **row_ptr, const unsigned int flags, zend_bool *fetched_anything)
+MYSQLND_METHOD(mysqlnd_res, fetch_row)(MYSQLND_RES *result, zval **row_ptr, const unsigned int flags, bool *fetched_anything)
{
const mysqlnd_fetch_row_func f =
result->stored_data ? result->stored_data->m.fetch_row :
MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND_CONN_DATA * const conn, MYSQLND_RES * result,
MYSQLND_RES_METADATA * meta,
MYSQLND_ROW_BUFFER **row_buffers,
- zend_bool binary_protocol)
+ bool binary_protocol)
{
enum_func_status ret;
uint64_t total_allocated_rows = 0;
static enum_func_status
MYSQLND_METHOD(mysqlnd_res, skip_result)(MYSQLND_RES * const result)
{
- zend_bool fetched_anything;
+ bool fetched_anything;
DBG_ENTER("mysqlnd_res::skip_result");
/*
/* {{{ mysqlnd_res::free_result */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_res, free_result)(MYSQLND_RES * result, const zend_bool implicit)
+MYSQLND_METHOD(mysqlnd_res, free_result)(MYSQLND_RES * result, const bool implicit)
{
DBG_ENTER("mysqlnd_res::free_result");
MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES * result, const unsigned int flags,
zval *return_value ZEND_FILE_LINE_DC)
{
- zend_bool fetched_anything;
+ bool fetched_anything;
zval *row_data;
DBG_ENTER("mysqlnd_res::fetch_into");
static MYSQLND_ROW_C
MYSQLND_METHOD(mysqlnd_res, fetch_row_c)(MYSQLND_RES * result)
{
- zend_bool fetched_anything;
+ bool fetched_anything;
zval *row_data;
MYSQLND_ROW_C ret = NULL;
DBG_ENTER("mysqlnd_res::fetch_row_c");
/* {{{ mysqlnd_stats_init */
PHPAPI void
-mysqlnd_stats_init(MYSQLND_STATS ** stats, const size_t statistic_count, const zend_bool persistent)
+mysqlnd_stats_init(MYSQLND_STATS ** stats, const size_t statistic_count, const bool persistent)
{
*stats = pecalloc(1, sizeof(MYSQLND_STATS), persistent);
(*stats)->values = pecalloc(statistic_count, sizeof(uint64_t), persistent);
/* {{{ mysqlnd_stats_end */
PHPAPI void
-mysqlnd_stats_end(MYSQLND_STATS * stats, const zend_bool persistent)
+mysqlnd_stats_end(MYSQLND_STATS * stats, const bool persistent)
{
#ifdef ZTS
tsrm_mutex_free(stats->LOCK_access);
-PHPAPI void mysqlnd_stats_init(MYSQLND_STATS ** stats, const size_t statistic_count, const zend_bool persistent);
-PHPAPI void mysqlnd_stats_end(MYSQLND_STATS * stats, const zend_bool persistent);
+PHPAPI void mysqlnd_stats_init(MYSQLND_STATS ** stats, const size_t statistic_count, const bool persistent);
+PHPAPI void mysqlnd_stats_end(MYSQLND_STATS * stats, const bool persistent);
PHPAPI void mysqlnd_fill_stats_hash(const MYSQLND_STATS * const stats, const MYSQLND_STRING * names, zval *return_value ZEND_FILE_LINE_DC);
typedef struct st_mysqlnd_field
{
zend_string *sname; /* Name of column */
- zend_bool is_numeric;
+ bool is_numeric;
zend_ulong num_key;
const char *name; /* Name of column in C string */
const char *org_name; /* Original column name, if an alias */
unsigned int error_no;
zend_llist error_list;
- zend_bool persistent;
+ bool persistent;
MYSQLND_CLASS_METHODS_TYPE(mysqlnd_error_info) *m;
};
/* maximum allowed packet size for communication */
unsigned int max_allowed_packet;
- zend_bool int_and_float_native;
+ bool int_and_float_native;
} MYSQLND_SESSION_OPTIONS;
typedef enum_func_status (*mysqlnd_fetch_row_func)(MYSQLND_RES *result,
zval **row,
const unsigned int flags,
- zend_bool * fetched_anything
+ bool * fetched_anything
);
uint64_t *values;
mysqlnd_stat_trigger *triggers;
size_t count;
- zend_bool in_trigger;
+ bool in_trigger;
#ifdef ZTS
MUTEX_T LOCK_access;
#endif
typedef enum_func_status (*func_mysqlnd_execute_com_init_db)(MYSQLND_CONN_DATA * const conn, const MYSQLND_CSTRING db);
typedef enum_func_status (*func_mysqlnd_execute_com_ping)(MYSQLND_CONN_DATA * const conn);
typedef enum_func_status (*func_mysqlnd_execute_com_statistics)(MYSQLND_CONN_DATA * const conn, zend_string ** message);
-typedef enum_func_status (*func_mysqlnd_execute_com_process_kill)(MYSQLND_CONN_DATA * const conn, const unsigned int process_id, const zend_bool read_response);
+typedef enum_func_status (*func_mysqlnd_execute_com_process_kill)(MYSQLND_CONN_DATA * const conn, const unsigned int process_id, const bool read_response);
typedef enum_func_status (*func_mysqlnd_execute_com_refresh)(MYSQLND_CONN_DATA * const conn, const uint8_t options);
typedef enum_func_status (*func_mysqlnd_execute_com_shutdown)(MYSQLND_CONN_DATA * const conn, const uint8_t level);
typedef enum_func_status (*func_mysqlnd_execute_com_quit)(MYSQLND_CONN_DATA * const conn);
typedef enum_func_status (*func_mysqlnd_execute_com_query)(MYSQLND_CONN_DATA * const conn, MYSQLND_CSTRING query);
-typedef enum_func_status (*func_mysqlnd_execute_com_change_user)(MYSQLND_CONN_DATA * const conn, const MYSQLND_CSTRING payload, const zend_bool silent);
+typedef enum_func_status (*func_mysqlnd_execute_com_change_user)(MYSQLND_CONN_DATA * const conn, const MYSQLND_CSTRING payload, const bool silent);
typedef enum_func_status (*func_mysqlnd_execute_com_reap_result)(MYSQLND_CONN_DATA * const conn);
typedef enum_func_status (*func_mysqlnd_execute_com_stmt_prepare)(MYSQLND_CONN_DATA * const conn, const MYSQLND_CSTRING query);
typedef enum_func_status (*func_mysqlnd_execute_com_stmt_execute)(MYSQLND_CONN_DATA * conn, const MYSQLND_CSTRING payload);
typedef enum_func_status (*func_mysqlnd_vio__init)(MYSQLND_VIO * const vio, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info);
typedef void (*func_mysqlnd_vio__dtor)(MYSQLND_VIO * const vio, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
-typedef enum_func_status (*func_mysqlnd_vio__connect)(MYSQLND_VIO * const vio, const MYSQLND_CSTRING scheme, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
+typedef enum_func_status (*func_mysqlnd_vio__connect)(MYSQLND_VIO * const vio, const MYSQLND_CSTRING scheme, const bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
typedef void (*func_mysqlnd_vio__close_stream)(MYSQLND_VIO * const vio, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
-typedef php_stream * (*func_mysqlnd_vio__open_stream)(MYSQLND_VIO * const vio, const MYSQLND_CSTRING scheme, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
+typedef php_stream * (*func_mysqlnd_vio__open_stream)(MYSQLND_VIO * const vio, const MYSQLND_CSTRING scheme, const bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
typedef php_stream * (*func_mysqlnd_vio__get_stream)(const MYSQLND_VIO * const vio);
typedef enum_func_status (*func_mysqlnd_vio__set_stream)(MYSQLND_VIO * const vio, php_stream * vio_stream);
-typedef zend_bool (*func_mysqlnd_vio__has_valid_stream)(const MYSQLND_VIO * const vio);
+typedef bool (*func_mysqlnd_vio__has_valid_stream)(const MYSQLND_VIO * const vio);
typedef func_mysqlnd_vio__open_stream (*func_mysqlnd_vio__get_open_stream)(MYSQLND_VIO * const vio, const MYSQLND_CSTRING scheme, MYSQLND_ERROR_INFO * const error_info);
typedef enum_func_status (*func_mysqlnd_vio__set_client_option)(MYSQLND_VIO * const vio, enum_mysqlnd_client_option option, const char * const value);
MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory);
-typedef MYSQLND * (*func_mysqlnd_object_factory__get_connection)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) * factory, const zend_bool persistent);
+typedef MYSQLND * (*func_mysqlnd_object_factory__get_connection)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) * factory, const bool persistent);
typedef MYSQLND * (*func_mysqlnd_object_factory__clone_connection_object)(MYSQLND * conn);
typedef MYSQLND_STMT * (*func_mysqlnd_object_factory__get_prepared_statement)(MYSQLND_CONN_DATA * conn);
-typedef MYSQLND_PFC * (*func_mysqlnd_object_factory__get_pfc)(const zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info);
-typedef MYSQLND_VIO * (*func_mysqlnd_object_factory__get_vio)(const zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info);
-typedef MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * (*func_mysqlnd_object_factory__get_protocol_payload_decoder_factory)(MYSQLND_CONN_DATA * conn, const zend_bool persistent);
+typedef MYSQLND_PFC * (*func_mysqlnd_object_factory__get_pfc)(const bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info);
+typedef MYSQLND_VIO * (*func_mysqlnd_object_factory__get_vio)(const bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info);
+typedef MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * (*func_mysqlnd_object_factory__get_protocol_payload_decoder_factory)(MYSQLND_CONN_DATA * conn, const bool persistent);
MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory)
typedef MYSQLND_RES * (*func_mysqlnd_conn_data__use_result)(MYSQLND_CONN_DATA * const conn);
typedef MYSQLND_RES * (*func_mysqlnd_conn_data__store_result)(MYSQLND_CONN_DATA * const conn);
typedef enum_func_status (*func_mysqlnd_conn_data__next_result)(MYSQLND_CONN_DATA * const conn);
-typedef zend_bool (*func_mysqlnd_conn_data__more_results)(const MYSQLND_CONN_DATA * const conn);
+typedef bool (*func_mysqlnd_conn_data__more_results)(const MYSQLND_CONN_DATA * const conn);
typedef MYSQLND_STMT * (*func_mysqlnd_conn_data__stmt_init)(MYSQLND_CONN_DATA * const conn);
typedef enum_func_status (*func_mysqlnd_conn_data__kill_connection)(MYSQLND_CONN_DATA * conn, unsigned int pid);
typedef enum_func_status (*func_mysqlnd_conn_data__select_db)(MYSQLND_CONN_DATA * const conn, const char * const db, const size_t db_len);
typedef enum_func_status (*func_mysqlnd_conn_data__server_dump_debug_information)(MYSQLND_CONN_DATA * const conn);
-typedef enum_func_status (*func_mysqlnd_conn_data__change_user)(MYSQLND_CONN_DATA * const conn, const char * user, const char * passwd, const char * db, zend_bool silent, size_t passwd_len);
+typedef enum_func_status (*func_mysqlnd_conn_data__change_user)(MYSQLND_CONN_DATA * const conn, const char * user, const char * passwd, const char * db, bool silent, size_t passwd_len);
typedef unsigned int (*func_mysqlnd_conn_data__get_error_no)(const MYSQLND_CONN_DATA * const conn);
typedef const char * (*func_mysqlnd_conn_data__get_error_str)(const MYSQLND_CONN_DATA * const conn);
typedef MYSQLND_CONN_DATA * (*func_mysqlnd_conn_data__get_reference)(MYSQLND_CONN_DATA * const conn);
typedef enum_func_status (*func_mysqlnd_conn_data__free_reference)(MYSQLND_CONN_DATA * const conn);
-typedef enum_func_status (*func_mysqlnd_conn_data__send_command_do_request)(MYSQLND_CONN_DATA * const conn, const enum php_mysqlnd_server_command command, const zend_uchar * const arg, const size_t arg_len, const zend_bool silent, const zend_bool ignore_upsert_status);
-typedef enum_func_status (*func_mysqlnd_conn_data__send_command_handle_response)(MYSQLND_CONN_DATA * const conn, const enum mysqlnd_packet_type ok_packet, const zend_bool silent, const enum php_mysqlnd_server_command command, const zend_bool ignore_upsert_status);
+typedef enum_func_status (*func_mysqlnd_conn_data__send_command_do_request)(MYSQLND_CONN_DATA * const conn, const enum php_mysqlnd_server_command command, const zend_uchar * const arg, const size_t arg_len, const bool silent, const bool ignore_upsert_status);
+typedef enum_func_status (*func_mysqlnd_conn_data__send_command_handle_response)(MYSQLND_CONN_DATA * const conn, const enum mysqlnd_packet_type ok_packet, const bool silent, const enum php_mysqlnd_server_command command, const bool ignore_upsert_status);
typedef enum_func_status (*func_mysqlnd_conn_data__restart_psession)(MYSQLND_CONN_DATA * conn);
typedef enum_func_status (*func_mysqlnd_conn_data__end_psession)(MYSQLND_CONN_DATA * conn);
typedef enum_func_status (*func_mysqlnd_conn_data__tx_commit)(MYSQLND_CONN_DATA * conn);
typedef enum_func_status (*func_mysqlnd_conn_data__tx_rollback)(MYSQLND_CONN_DATA * conn);
typedef enum_func_status (*func_mysqlnd_conn_data__tx_begin)(MYSQLND_CONN_DATA * conn, const unsigned int mode, const char * const name);
-typedef enum_func_status (*func_mysqlnd_conn_data__tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const zend_bool commit, const unsigned int flags, const char * const name);
+typedef enum_func_status (*func_mysqlnd_conn_data__tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const bool commit, const unsigned int flags, const char * const name);
typedef void (*func_mysqlnd_conn_data__tx_cor_options_to_string)(const MYSQLND_CONN_DATA * const conn, smart_str * tmp_str, const unsigned int mode);
typedef enum_func_status (*func_mysqlnd_conn_data__tx_savepoint)(MYSQLND_CONN_DATA * conn, const char * const name);
typedef enum_func_status (*func_mysqlnd_conn_data__tx_savepoint_release)(MYSQLND_CONN_DATA * conn, const char * const name);
typedef size_t (*func_mysqlnd_conn_data__negotiate_client_api_capabilities)(MYSQLND_CONN_DATA * const conn, const size_t flags);
typedef size_t (*func_mysqlnd_conn_data__get_client_api_capabilities)(const MYSQLND_CONN_DATA * const conn);
-typedef MYSQLND_STRING (*func_mysqlnd_conn_data__get_scheme)(MYSQLND_CONN_DATA * conn, MYSQLND_CSTRING hostname, MYSQLND_CSTRING *socket_or_pipe, unsigned int port, zend_bool * unix_socket, zend_bool * named_pipe);
+typedef MYSQLND_STRING (*func_mysqlnd_conn_data__get_scheme)(MYSQLND_CONN_DATA * conn, MYSQLND_CSTRING hostname, MYSQLND_CSTRING *socket_or_pipe, unsigned int port, bool * unix_socket, bool * named_pipe);
/* for decoding - binary or text protocol */
typedef enum_func_status (*func_mysqlnd_res__row_decoder)(MYSQLND_ROW_BUFFER * row_buffer, zval * fields,
const unsigned int field_count, const MYSQLND_FIELD * const fields_metadata,
- const zend_bool as_int_or_float, MYSQLND_STATS * const stats);
+ const bool as_int_or_float, MYSQLND_STATS * const stats);
typedef MYSQLND_RES * (*func_mysqlnd_res__use_result)(MYSQLND_RES * const result, MYSQLND_STMT_DATA *stmt);
typedef enum_func_status (*func_mysqlnd_res__read_result_metadata)(MYSQLND_RES * result, MYSQLND_CONN_DATA * conn);
typedef const size_t * (*func_mysqlnd_res__fetch_lengths)(const MYSQLND_RES * const result);
-typedef enum_func_status (*func_mysqlnd_res__store_result_fetch_data)(MYSQLND_CONN_DATA * const conn, MYSQLND_RES * result, MYSQLND_RES_METADATA * meta, MYSQLND_ROW_BUFFER ** row_buffers, zend_bool binary_protocol);
+typedef enum_func_status (*func_mysqlnd_res__store_result_fetch_data)(MYSQLND_CONN_DATA * const conn, MYSQLND_RES * result, MYSQLND_RES_METADATA * meta, MYSQLND_ROW_BUFFER ** row_buffers, bool binary_protocol);
typedef void (*func_mysqlnd_res__free_result_buffers)(MYSQLND_RES * result); /* private */
-typedef enum_func_status (*func_mysqlnd_res__free_result)(MYSQLND_RES * result, const zend_bool implicit);
+typedef enum_func_status (*func_mysqlnd_res__free_result)(MYSQLND_RES * result, const bool implicit);
typedef void (*func_mysqlnd_res__free_result_contents)(MYSQLND_RES *result);
typedef void (*func_mysqlnd_res__free_buffered_data)(MYSQLND_RES *result);
typedef MYSQLND_RES * (*func_mysqlnd_stmt__use_result)(MYSQLND_STMT * const stmt);
typedef MYSQLND_RES * (*func_mysqlnd_stmt__store_result)(MYSQLND_STMT * const stmt);
typedef MYSQLND_RES * (*func_mysqlnd_stmt__get_result)(MYSQLND_STMT * const stmt);
-typedef zend_bool (*func_mysqlnd_stmt__more_results)(const MYSQLND_STMT * const stmt);
+typedef bool (*func_mysqlnd_stmt__more_results)(const MYSQLND_STMT * const stmt);
typedef enum_func_status (*func_mysqlnd_stmt__next_result)(MYSQLND_STMT * const stmt);
typedef enum_func_status (*func_mysqlnd_stmt__free_result)(MYSQLND_STMT * const stmt);
typedef enum_func_status (*func_mysqlnd_stmt__seek_data)(const MYSQLND_STMT * const stmt, uint64_t row);
typedef enum_func_status (*func_mysqlnd_stmt__reset)(MYSQLND_STMT * const stmt);
-typedef enum_func_status (*func_mysqlnd_stmt__close_on_server)(MYSQLND_STMT * const stmt, zend_bool implicit); /* private */
-typedef enum_func_status (*func_mysqlnd_stmt__dtor)(MYSQLND_STMT * const stmt, zend_bool implicit); /* use this for mysqlnd_stmt_close */
-typedef enum_func_status (*func_mysqlnd_stmt__fetch)(MYSQLND_STMT * const stmt, zend_bool * const fetched_anything);
+typedef enum_func_status (*func_mysqlnd_stmt__close_on_server)(MYSQLND_STMT * const stmt, bool implicit); /* private */
+typedef enum_func_status (*func_mysqlnd_stmt__dtor)(MYSQLND_STMT * const stmt, bool implicit); /* use this for mysqlnd_stmt_close */
+typedef enum_func_status (*func_mysqlnd_stmt__fetch)(MYSQLND_STMT * const stmt, bool * const fetched_anything);
typedef enum_func_status (*func_mysqlnd_stmt__bind_parameters)(MYSQLND_STMT * const stmt, MYSQLND_PARAM_BIND * const param_bind);
typedef enum_func_status (*func_mysqlnd_stmt__bind_one_parameter)(MYSQLND_STMT * const stmt, unsigned int param_no, zval * const zv, zend_uchar type);
typedef enum_func_status (*func_mysqlnd_stmt__refresh_bind_param)(MYSQLND_STMT * const stmt);
typedef void (*func_mysqlnd_stmt__free_parameter_bind)(MYSQLND_STMT * const stmt, MYSQLND_PARAM_BIND *);
typedef void (*func_mysqlnd_stmt__free_result_bind)(MYSQLND_STMT * const stmt, MYSQLND_RESULT_BIND *);
typedef unsigned int (*func_mysqlnd_stmt__server_status)(const MYSQLND_STMT * const stmt);
-typedef enum_func_status (*func_mysqlnd_stmt__generate_execute_request)(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer);
+typedef enum_func_status (*func_mysqlnd_stmt__generate_execute_request)(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, bool * free_buffer);
typedef enum_func_status (*func_mysqlnd_stmt__parse_execute_response)(MYSQLND_STMT * const s, enum_mysqlnd_parse_exec_response_type type);
typedef void (*func_mysqlnd_stmt__free_stmt_content)(MYSQLND_STMT * const s);
typedef enum_func_status (*func_mysqlnd_stmt__flush)(MYSQLND_STMT * const stmt);
struct st_mysqlnd_vio_data
{
php_stream *stream;
- zend_bool ssl;
+ bool ssl;
MYSQLND_VIO_OPTIONS options;
#ifdef MYSQLND_DO_WIRE_CHECK_BEFORE_COMMAND
zend_uchar last_command;
zend_uchar unused_pad1;
#endif
- zend_bool persistent;
+ bool persistent;
MYSQLND_CLASS_METHODS_TYPE(mysqlnd_vio) m;
};
{
struct st_mysqlnd_vio_data * data;
- zend_bool persistent;
+ bool persistent;
};
zval async_read_cb;
zval async_err_cb;
- zend_bool in_async_read_cb;
- zend_bool in_async_err_cb;
+ bool in_async_read_cb;
+ bool in_async_err_cb;
MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) object_factory;
MYSQLND_CLASS_METHODS_TYPE(mysqlnd_command) * command;
MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data) * m;
/* persistent connection */
- zend_bool persistent;
+ bool persistent;
};
struct st_mysqlnd_connection
{
MYSQLND_CONN_DATA * data;
- zend_bool persistent;
+ bool persistent;
MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn) * m;
};
MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * payload_decoder_factory,
const enum php_mysqlnd_server_command command,
const zend_uchar * const arg, const size_t arg_len,
- const zend_bool silent,
+ const bool silent,
MYSQLND_CONNECTION_STATE * connection_state,
MYSQLND_ERROR_INFO * error_info,
MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const payload_decoder_factory,
MYSQLND_ERROR_INFO * const error_info,
MYSQLND_UPSERT_STATUS * const upsert_status,
- const zend_bool ignore_upsert_status, /* actually used only by LOAD DATA. COM_QUERY and COM_EXECUTE handle the responses themselves */
+ const bool ignore_upsert_status, /* actually used only by LOAD DATA. COM_QUERY and COM_EXECUTE handle the responses themselves */
MYSQLND_STRING * const last_message);
typedef enum_func_status (*func_mysqlnd_protocol_payload_decoder_factory__send_command_handle_EOF)(
typedef enum_func_status (*func_mysqlnd_protocol_payload_decoder_factory__send_command_handle_response)(
MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * payload_decoder_factory,
const enum mysqlnd_packet_type ok_packet,
- const zend_bool silent,
+ const bool silent,
const enum php_mysqlnd_server_command command,
- const zend_bool ignore_upsert_status, /* actually used only by LOAD DATA. COM_QUERY and COM_EXECUTE handle the responses themselves */
+ const bool ignore_upsert_status, /* actually used only by LOAD DATA. COM_QUERY and COM_EXECUTE handle the responses themselves */
MYSQLND_ERROR_INFO * error_info,
MYSQLND_UPSERT_STATUS * upsert_status,
struct st_mysqlnd_protocol_payload_decoder_factory
{
MYSQLND_CONN_DATA * conn;
- zend_bool persistent;
+ bool persistent;
MYSQLND_CLASS_METHODS_TYPE(mysqlnd_protocol_payload_decoder_factory) m;
};
size_t offset;
size_t size;
size_t len;
- zend_bool (*is_empty)(const struct st_mysqlnd_read_buffer *);
+ bool (*is_empty)(const struct st_mysqlnd_read_buffer *);
void (*read)(struct st_mysqlnd_read_buffer *, size_t count, zend_uchar * dest);
size_t (*bytes_left)(const struct st_mysqlnd_read_buffer *);
void (*free_buffer)(struct st_mysqlnd_read_buffer **);
struct st_mysqlnd_protocol_frame_codec_data
{
php_stream *stream;
- zend_bool compressed;
- zend_bool ssl;
+ bool compressed;
+ bool ssl;
uint64_t flags;
char * sha256_server_public_key;
zend_uchar packet_no;
zend_uchar compressed_envelope_packet_no;
- zend_bool persistent;
+ bool persistent;
MYSQLND_CLASS_METHODS_TYPE(mysqlnd_protocol_packet_frame_codec) m;
};
struct st_mysqlnd_protocol_frame_codec_data * data;
- zend_bool persistent;
+ bool persistent;
};
unsigned int field_count;
- zend_bool eof_reached;
+ bool eof_reached;
MYSQLND_STMT_DATA *stmt;
};
struct st_mysqlnd_result_bind
{
zval zv;
- zend_bool bound;
+ bool bound;
};
MYSQLND_ERROR_INFO * error_info;
MYSQLND_ERROR_INFO error_info_impl;
- zend_bool update_max_length;
+ bool update_max_length;
zend_ulong prefetch_rows;
- zend_bool cursor_exists;
+ bool cursor_exists;
mysqlnd_stmt_use_or_store_func default_rset_handler;
zval execute_read_cb;
zval execute_err_cb;
- zend_bool in_execute_read_cb;
- zend_bool in_execute_err_cb;
+ bool in_execute_read_cb;
+ bool in_execute_err_cb;
MYSQLND_CMD_BUFFER execute_cmd_buffer;
unsigned int execute_count;/* count how many times the stmt was executed */
/* {{{ mysqlnd_vio::open_pipe */
static php_stream *
-MYSQLND_METHOD(mysqlnd_vio, open_pipe)(MYSQLND_VIO * const vio, const MYSQLND_CSTRING scheme, const zend_bool persistent,
+MYSQLND_METHOD(mysqlnd_vio, open_pipe)(MYSQLND_VIO * const vio, const MYSQLND_CSTRING scheme, const bool persistent,
MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
{
unsigned int streams_options = 0;
/* {{{ mysqlnd_vio::open_tcp_or_unix */
static php_stream *
-MYSQLND_METHOD(mysqlnd_vio, open_tcp_or_unix)(MYSQLND_VIO * const vio, const MYSQLND_CSTRING scheme, const zend_bool persistent,
+MYSQLND_METHOD(mysqlnd_vio, open_tcp_or_unix)(MYSQLND_VIO * const vio, const MYSQLND_CSTRING scheme, const bool persistent,
MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
{
unsigned int streams_options = 0;
/* {{{ mysqlnd_vio::connect */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_vio, connect)(MYSQLND_VIO * const vio, const MYSQLND_CSTRING scheme, const zend_bool persistent,
+MYSQLND_METHOD(mysqlnd_vio, connect)(MYSQLND_VIO * const vio, const MYSQLND_CSTRING scheme, const bool persistent,
MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
{
enum_func_status ret = FAIL;
break;
case MYSQLND_OPT_SSL_KEY:
{
- zend_bool pers = net->persistent;
+ bool pers = net->persistent;
if (net->data->options.ssl_key) {
mnd_pefree(net->data->options.ssl_key, pers);
}
}
case MYSQLND_OPT_SSL_CERT:
{
- zend_bool pers = net->persistent;
+ bool pers = net->persistent;
if (net->data->options.ssl_cert) {
mnd_pefree(net->data->options.ssl_cert, pers);
}
}
case MYSQLND_OPT_SSL_CA:
{
- zend_bool pers = net->persistent;
+ bool pers = net->persistent;
if (net->data->options.ssl_ca) {
mnd_pefree(net->data->options.ssl_ca, pers);
}
}
case MYSQLND_OPT_SSL_CAPATH:
{
- zend_bool pers = net->persistent;
+ bool pers = net->persistent;
if (net->data->options.ssl_capath) {
mnd_pefree(net->data->options.ssl_capath, pers);
}
}
case MYSQLND_OPT_SSL_CIPHER:
{
- zend_bool pers = net->persistent;
+ bool pers = net->persistent;
if (net->data->options.ssl_cipher) {
mnd_pefree(net->data->options.ssl_cipher, pers);
}
}
case MYSQLND_OPT_SSL_PASSPHRASE:
{
- zend_bool pers = net->persistent;
+ bool pers = net->persistent;
if (net->data->options.ssl_passphrase) {
mnd_pefree(net->data->options.ssl_passphrase, pers);
}
#ifdef MYSQLND_SSL_SUPPORTED
php_stream_context * context = php_stream_context_alloc();
php_stream * net_stream = net->data->m.get_stream(net);
- zend_bool any_flag = FALSE;
+ bool any_flag = FALSE;
DBG_ENTER("mysqlnd_vio::enable_ssl");
}
{
zval verify_peer_zval;
- zend_bool verify;
+ bool verify;
if (net->data->options.ssl_verify_peer == MYSQLND_SSL_PEER_DEFAULT) {
net->data->options.ssl_verify_peer = any_flag? MYSQLND_SSL_PEER_DEFAULT_ACTION:MYSQLND_SSL_PEER_DONT_VERIFY;
static void
MYSQLND_METHOD(mysqlnd_vio, free_contents)(MYSQLND_VIO * net)
{
- zend_bool pers = net->persistent;
+ bool pers = net->persistent;
DBG_ENTER("mysqlnd_vio::free_contents");
if (net->data->options.ssl_key) {
php_stream * net_stream;
DBG_ENTER("mysqlnd_vio::close_stream");
if (net && (net_stream = net->data->m.get_stream(net))) {
- zend_bool pers = net->persistent;
+ bool pers = net->persistent;
DBG_INF_FMT("Freeing stream. abstract=%p", net_stream->abstract);
/* We removed the resource from the stream, so pass FREE_RSRC_DTOR now to force
* destruction to occur during shutdown, because it won't happen through the resource. */
/* {{{ mysqlnd_vio::has_valid_stream */
-static zend_bool
+static bool
MYSQLND_METHOD(mysqlnd_vio, has_valid_stream)(const MYSQLND_VIO * const vio)
{
DBG_ENTER("mysqlnd_vio::has_valid_stream");
/* {{{ mysqlnd_vio_init */
PHPAPI MYSQLND_VIO *
-mysqlnd_vio_init(zend_bool persistent, MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *object_factory, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info)
+mysqlnd_vio_init(bool persistent, MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *object_factory, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info)
{
MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *factory = object_factory? object_factory : &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory);
MYSQLND_VIO * vio;
#ifndef MYSQLND_VIO_H
#define MYSQLND_VIO_H
-PHPAPI MYSQLND_VIO * mysqlnd_vio_init(zend_bool persistent, MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *object_factory, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info);
+PHPAPI MYSQLND_VIO * mysqlnd_vio_init(bool persistent, MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *object_factory, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info);
PHPAPI void mysqlnd_vio_free(MYSQLND_VIO * const vio, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info);
#endif /* MYSQLND_VIO_H */
enum_func_status
php_mysqlnd_rowp_read_binary_protocol(MYSQLND_ROW_BUFFER * row_buffer, zval * fields,
const unsigned int field_count, const MYSQLND_FIELD * const fields_metadata,
- const zend_bool as_int_or_float, MYSQLND_STATS * const stats)
+ const bool as_int_or_float, MYSQLND_STATS * const stats)
{
unsigned int i;
const zend_uchar * p = row_buffer->ptr;
enum_func_status
php_mysqlnd_rowp_read_text_protocol(MYSQLND_ROW_BUFFER * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats)
+ bool as_int_or_float, MYSQLND_STATS * stats)
{
unsigned int i;
zval *current_field, *end_field, *start_field;
#else
(uint64_t) _atoi64((char *) p);
#endif
- zend_bool uns = fields_metadata[i].flags & UNSIGNED_FLAG? TRUE:FALSE;
+ bool uns = fields_metadata[i].flags & UNSIGNED_FLAG? TRUE:FALSE;
/* We have to make it ASCIIZ temporarily */
#if SIZEOF_ZEND_LONG==8
if (uns == TRUE && v > 9223372036854775807L)
MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * payload_decoder_factory,
const enum php_mysqlnd_server_command command,
const zend_uchar * const arg, const size_t arg_len,
- const zend_bool silent,
+ const bool silent,
struct st_mysqlnd_connection_state * connection_state,
MYSQLND_ERROR_INFO * error_info,
MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const payload_decoder_factory,
MYSQLND_ERROR_INFO * const error_info,
MYSQLND_UPSERT_STATUS * const upsert_status,
- const zend_bool ignore_upsert_status, /* actually used only by LOAD DATA. COM_QUERY and COM_EXECUTE handle the responses themselves */
+ const bool ignore_upsert_status, /* actually used only by LOAD DATA. COM_QUERY and COM_EXECUTE handle the responses themselves */
MYSQLND_STRING * const last_message)
{
enum_func_status ret = FAIL;
MYSQLND_METHOD(mysqlnd_protocol, send_command_handle_response)(
MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * payload_decoder_factory,
const enum mysqlnd_packet_type ok_packet,
- const zend_bool silent,
+ const bool silent,
const enum php_mysqlnd_server_command command,
- const zend_bool ignore_upsert_status, /* actually used only by LOAD DATA. COM_QUERY and COM_EXECUTE handle the responses themselves */
+ const bool ignore_upsert_status, /* actually used only by LOAD DATA. COM_QUERY and COM_EXECUTE handle the responses themselves */
MYSQLND_ERROR_INFO * error_info,
MYSQLND_UPSERT_STATUS * upsert_status,
/* {{{ mysqlnd_protocol_payload_decoder_factory_init */
PHPAPI MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY *
-mysqlnd_protocol_payload_decoder_factory_init(MYSQLND_CONN_DATA * conn, const zend_bool persistent)
+mysqlnd_protocol_payload_decoder_factory_init(MYSQLND_CONN_DATA * conn, const bool persistent)
{
MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * ret;
DBG_ENTER("mysqlnd_protocol_payload_decoder_factory_init");
DBG_ENTER("mysqlnd_protocol_payload_decoder_factory_free");
if (factory) {
- zend_bool pers = factory->persistent;
+ bool pers = factory->persistent;
mnd_pefree(factory, pers);
}
DBG_VOID_RETURN;
uint8_t charset_no;
uint16_t server_status;
/* 13 byte pad, in 5.5 first 2 bytes are more capabilities followed by 1 byte scramble_length */
- zend_bool pre41;
+ bool pre41;
/* If error packet, we use these */
char error[MYSQLND_ERRMSG_SIZE+1];
char sqlstate[MYSQLND_SQLSTATE_LENGTH + 1];
uint32_t max_packet_size;
uint8_t charset_no;
/* Here the packet ends. This is user supplied data */
- zend_bool send_auth_data;
- zend_bool is_change_user_packet;
- zend_bool silent;
+ bool send_auth_data;
+ bool is_change_user_packet;
+ bool silent;
HashTable *connect_attr;
size_t db_len;
} MYSQLND_PACKET_AUTH;
MYSQLND_MEMORY_POOL *memory_pool;
MYSQLND_FIELD *metadata;
/* For table definitions, empty for result sets */
- zend_bool skip_parsing;
+ bool skip_parsing;
MYSQLND_ERROR_INFO error_info;
} MYSQLND_PACKET_RES_FIELD;
typedef struct st_mysqlnd_packet_row {
MYSQLND_PACKET_HEADER header;
uint32_t field_count;
- zend_bool eof;
+ bool eof;
/*
These are, of course, only for SELECT in the EOF packet,
which is detected by this packet
MYSQLND_ROW_BUFFER row_buffer;
MYSQLND_MEMORY_POOL * result_set_memory_pool;
- zend_bool binary_protocol;
+ bool binary_protocol;
MYSQLND_FIELD *fields_metadata;
/* If error packet, we use these */
uint16_t server_capabilities;
/* If error packet, we use these */
MYSQLND_ERROR_INFO error_info;
- zend_bool server_asked_323_auth;
+ bool server_asked_323_auth;
char *new_auth_protocol;
size_t new_auth_protocol_len;
enum_func_status php_mysqlnd_rowp_read_binary_protocol(MYSQLND_ROW_BUFFER * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats);
+ bool as_int_or_float, MYSQLND_STATS * stats);
enum_func_status php_mysqlnd_rowp_read_text_protocol(MYSQLND_ROW_BUFFER * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats);
+ bool as_int_or_float, MYSQLND_STATS * stats);
-PHPAPI MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * mysqlnd_protocol_payload_decoder_factory_init(MYSQLND_CONN_DATA * conn, const zend_bool persistent);
+PHPAPI MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * mysqlnd_protocol_payload_decoder_factory_init(MYSQLND_CONN_DATA * conn, const bool persistent);
PHPAPI void mysqlnd_protocol_payload_decoder_factory_free(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const payload_decoder_factory);
#endif /* MYSQLND_WIREPROTOCOL_H */
smart_str hashed_details = {0};
time_t timestamp;
php_oci_spool *session_pool = NULL;
- zend_bool use_spool = 1; /* Default is to use client-side session pool */
- zend_bool ping_done = 0;
+ bool use_spool = 1; /* Default is to use client-side session pool */
+ bool ping_done = 0;
ub2 charsetid = 0;
ub2 charsetid_nls_lang = 0;
php_strtolower(ZSTR_VAL(hashed_details.s), ZSTR_LEN(hashed_details.s));
if (!exclusive && !new_password) {
- zend_bool found = 0;
+ bool found = 0;
if (persistent && ((zvp = zend_hash_find(&EG(persistent_list), hashed_details.s))) != NULL) {
zend_resource *le = Z_RES_P(zvp);
* a last resort, return a non-persistent connection.
*/
if (persistent) {
- zend_bool alloc_non_persistent = 0;
+ bool alloc_non_persistent = 0;
if (OCI_G(max_persistent) != -1 && OCI_G(num_persistent) >= OCI_G(max_persistent)) {
/* try to find an idle connection and kill it */
static int php_oci_connection_close(php_oci_connection *connection)
{
int result = 0;
- zend_bool in_call_save = OCI_G(in_call);
+ bool in_call_save = OCI_G(in_call);
#ifdef HAVE_OCI8_DTRACE
if (DTRACE_OCI8_CONNECTION_CLOSE_ENABLED()) {
int php_oci_connection_release(php_oci_connection *connection)
{
int result = 0;
- zend_bool in_call_save = OCI_G(in_call);
+ bool in_call_save = OCI_G(in_call);
time_t timestamp = time(NULL);
if (connection->is_stub) {
static php_oci_spool *php_oci_create_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, zend_string *hash_key, int charsetid)
{
php_oci_spool *session_pool = NULL;
- zend_bool iserror = 0;
+ bool iserror = 0;
ub4 poolmode = OCI_DEFAULT; /* Mode to be passed to OCISessionPoolCreate */
OCIAuthInfo *spoolAuth = NULL;
sword errstatus;
smart_str spool_hashed_details = {0};
php_oci_spool *session_pool = NULL;
zend_resource *spool_out_le = NULL;
- zend_bool iserror = 0;
+ bool iserror = 0;
zval *spool_out_zv = NULL;
/* {{{ Create the spool hash key */
php_oci_descriptor *descriptor;
size_t data_len;
zend_long write_len;
- zend_bool write_len_is_null = 1;
+ bool write_len_is_null = 1;
ub4 bytes_written;
char *data;
php_oci_descriptor *descriptor;
ub4 bytes_erased;
zend_long offset, length;
- zend_bool offset_is_null = 1, length_is_null = 1;
+ bool offset_is_null = 1, length_is_null = 1;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l!l!", &z_descriptor, oci_lob_class_entry_ptr, &offset, &offset_is_null, &length, &length_is_null) == FAILURE) {
RETURN_THROWS();
{
zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
- zend_bool flag;
+ bool flag;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ob", &z_descriptor, oci_lob_class_entry_ptr, &flag) == FAILURE) {
RETURN_THROWS();
zval *tmp_dest, *tmp_from, *z_descriptor_dest, *z_descriptor_from;
php_oci_descriptor *descriptor_dest, *descriptor_from;
zend_long length;
- zend_bool length_is_null = 1;
+ bool length_is_null = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO|l!", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr, &length, &length_is_null) == FAILURE) {
RETURN_THROWS();
char *buffer;
size_t filename_len;
zend_long start, length, block_length;
- zend_bool start_is_null = 1, length_is_null = 1;
+ bool start_is_null = 1, length_is_null = 1;
php_stream *stream;
ub4 lob_length;
void *handlepp;
ub4 typep, iterp, idxp;
ub1 in_outp, piecep;
- zend_bool piecewisecols = 0;
+ bool piecewisecols = 0;
php_oci_out_column *column;
sword errstatus;
zend_long persistent_timeout; /* time period after which idle persistent connection is considered expired */
zend_long statement_cache_size; /* statement cache size. used with 9i+ clients only*/
zend_long default_prefetch; /* default prefetch setting */
- zend_bool privileged_connect; /* privileged connect flag (On/Off) */
- zend_bool old_oci_close_semantics; /* old_oci_close_semantics flag (to determine the way oci_close() should behave) */
+ bool privileged_connect; /* privileged connect flag (On/Off) */
+ bool old_oci_close_semantics; /* old_oci_close_semantics flag (to determine the way oci_close() should behave) */
int shutdown; /* in shutdown flag */
OCIEnv *env; /* global environment handle */
- zend_bool in_call;
+ bool in_call;
char *connection_class;
- zend_bool events;
+ bool events;
char *edition;
ZEND_END_MODULE_GLOBALS(oci) /* }}} */
RETCODE rc;
zval *pv_res;
zend_long pv_row;
- zend_bool pv_row_is_null = 1;
+ bool pv_row_is_null = 1;
#ifdef HAVE_SQL_EXTENDED_FETCH
SQLULEN crow;
SQLUSMALLINT RowStatus[1];
odbc_connection *conn;
RETCODE rc;
zval *pv_conn;
- zend_bool pv_onoff = 0;
+ bool pv_onoff = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|b", &pv_conn, &pv_onoff) == FAILURE) {
RETURN_THROWS();
src = VAR_SOURCE(opline->op1);
if (src && src->opcode == ZEND_QM_ASSIGN) {
zend_op *op = src + 1;
- zend_bool optimize = 1;
+ bool optimize = 1;
while (op < opline) {
if ((op->op1_type == opline->op1_type
unsigned reorder_dtor_effects : 1;
} context;
-static inline zend_bool is_bad_mod(const zend_ssa *ssa, int use, int def) {
+static inline bool is_bad_mod(const zend_ssa *ssa, int use, int def) {
if (def < 0) {
/* This modification is not tracked by SSA, assume the worst */
return 1;
return 0;
}
-static inline zend_bool may_have_side_effects(
+static inline bool may_have_side_effects(
zend_op_array *op_array, zend_ssa *ssa,
const zend_op *opline, const zend_ssa_op *ssa_op,
- zend_bool reorder_dtor_effects) {
+ bool reorder_dtor_effects) {
switch (opline->opcode) {
case ZEND_NOP:
case ZEND_IS_IDENTICAL:
} FOREACH_PHI_SOURCE_END();
}
-static inline zend_bool is_var_dead(context *ctx, int var_num) {
+static inline bool is_var_dead(context *ctx, int var_num) {
zend_ssa_var *var = &ctx->ssa->vars[var_num];
if (var->definition_phi) {
return zend_bitset_in(ctx->phi_dead, var_num);
}
// Sometimes we can mark the var as EXT_UNUSED
-static zend_bool try_remove_var_def(context *ctx, int free_var, int use_chain, zend_op *opline) {
+static bool try_remove_var_def(context *ctx, int free_var, int use_chain, zend_op *opline) {
if (use_chain >= 0) {
return 0;
}
return 0;
}
-static inline zend_bool is_free_of_live_var(context *ctx, zend_op *opline, zend_ssa_op *ssa_op) {
+static inline bool is_free_of_live_var(context *ctx, zend_op *opline, zend_ssa_op *ssa_op) {
switch (opline->opcode) {
case ZEND_FREE:
/* It is always safe to remove FREEs of non-refcounted values, even if they are live. */
}
/* Returns whether the instruction has been DCEd */
-static zend_bool dce_instr(context *ctx, zend_op *opline, zend_ssa_op *ssa_op) {
+static bool dce_instr(context *ctx, zend_op *opline, zend_ssa_op *ssa_op) {
zend_ssa *ssa = ctx->ssa;
int free_var = -1;
zend_uchar free_var_type;
}
}
-static inline zend_bool may_break_varargs(const zend_op_array *op_array, const zend_ssa *ssa, const zend_ssa_op *ssa_op) {
+static inline bool may_break_varargs(const zend_op_array *op_array, const zend_ssa *ssa, const zend_ssa_op *ssa_op) {
if (ssa_op->op1_def >= 0
&& ssa->vars[ssa_op->op1_def].var < op_array->num_args) {
return 1;
return 0;
}
-int dce_optimize_op_array(zend_op_array *op_array, zend_ssa *ssa, zend_bool reorder_dtor_effects) {
+int dce_optimize_op_array(zend_op_array *op_array, zend_ssa *ssa, bool reorder_dtor_effects) {
int i;
zend_ssa_phi *phi;
int removed_ops = 0;
/* DCE of CV operations that changes arguments may affect vararg functions. */
- zend_bool has_varargs = (ssa->cfg.flags & ZEND_FUNC_VARARG) != 0;
+ bool has_varargs = (ssa->cfg.flags & ZEND_FUNC_VARARG) != 0;
context ctx;
ctx.ssa = ssa;
free_alloca(shiftlist, use_heap);
}
-static zend_bool safe_instanceof(zend_class_entry *ce1, zend_class_entry *ce2) {
+static bool safe_instanceof(zend_class_entry *ce1, zend_class_entry *ce2) {
if (ce1 == ce2) {
return 1;
}
return instanceof_function(ce1, ce2);
}
-static inline zend_bool can_elide_return_type_check(
+static inline bool can_elide_return_type_check(
zend_op_array *op_array, zend_ssa *ssa, zend_ssa_op *ssa_op) {
zend_arg_info *info = &op_array->arg_info[-1];
zend_ssa_var_info *use_info = &ssa->var_info[ssa_op->op1_use];
return 1;
}
-static zend_bool opline_supports_assign_contraction(
+static bool opline_supports_assign_contraction(
zend_ssa *ssa, zend_op *opline, int src_var, uint32_t cv_var) {
if (opline->opcode == ZEND_NEW) {
/* see Zend/tests/generators/aborted_yield_during_new.phpt */
zend_op *send_array;
zend_op *send_needly;
- zend_bool strict = 0;
+ bool strict = 0;
if (call_info->caller_init_opline->extended_value == 2) {
send_array = call_info->caller_call_opline - 1;
if (opline->op1_type == IS_CONST) {
zval *zv = CT_CONSTANT_EX(op_array, opline->op1.constant);
zend_uchar type = Z_TYPE_P(zv);
- zend_bool correct_type =
+ bool correct_type =
(opline->opcode == ZEND_SWITCH_LONG && type == IS_LONG)
|| (opline->opcode == ZEND_SWITCH_STRING && type == IS_STRING)
|| (opline->opcode == ZEND_MATCH && (type == IS_LONG || type == IS_STRING));
int ssa_vars_count = ssa->vars_count;
int i, root, use;
int *ees;
- zend_bool has_allocations;
+ bool has_allocations;
int num_non_escaped;
ALLOCA_FLAG(use_heap)
/* 4. Process referential dependencies */
if (num_non_escaped) {
- zend_bool changed;
+ bool changed;
do {
changed = 0;
typedef struct _optimizer_call_info {
zend_function *func;
zend_op *opline;
- zend_bool is_prototype;
- zend_bool try_inline;
+ bool is_prototype;
+ bool try_inline;
uint32_t func_arg_num;
} optimizer_call_info;
{
zend_op *opline = op_array->opcodes;
zend_op *end = opline + op_array->last;
- zend_bool collect_constants = (ZEND_OPTIMIZER_PASS_15 & ctx->optimization_level)?
+ bool collect_constants = (ZEND_OPTIMIZER_PASS_15 & ctx->optimization_level)?
(op_array == &ctx->script->main_op_array) : 0;
while (opline < end) {
Z_ARR_P(dst) = zend_array_dup(Z_ARR_P(src));
}
-static inline zend_bool value_known(zval *zv) {
+static inline bool value_known(zval *zv) {
return !IS_TOP(zv) && !IS_BOT(zv);
}
}
}
-static zend_bool can_replace_op1(
+static bool can_replace_op1(
const zend_op_array *op_array, zend_op *opline, zend_ssa_op *ssa_op) {
switch (opline->opcode) {
case ZEND_PRE_INC:
return 1;
}
-static zend_bool can_replace_op2(
+static bool can_replace_op2(
const zend_op_array *op_array, zend_op *opline, zend_ssa_op *ssa_op) {
switch (opline->opcode) {
/* Do not accept CONST */
return 1;
}
-static zend_bool try_replace_op1(
+static bool try_replace_op1(
sccp_ctx *ctx, zend_op *opline, zend_ssa_op *ssa_op, int var, zval *value) {
if (ssa_op->op1_use == var && can_replace_op1(ctx->scdf.op_array, opline, ssa_op)) {
zval zv;
return 0;
}
-static zend_bool try_replace_op2(
+static bool try_replace_op2(
sccp_ctx *ctx, zend_op *opline, zend_ssa_op *ssa_op, int var, zval *value) {
if (ssa_op->op2_use == var && can_replace_op2(ctx->scdf.op_array, opline, ssa_op)) {
zval zv;
static inline int ct_eval_in_array(zval *result, uint32_t extended_value, zval *op1, zval *op2) {
HashTable *ht;
- zend_bool res;
+ bool res;
if (Z_TYPE_P(op2) != IS_ARRAY) {
return FAILURE;
return SUCCESS;
}
-static zend_bool can_ct_eval_func_call(zend_string *name, uint32_t num_args, zval **args) {
+static bool can_ct_eval_func_call(zend_string *name, uint32_t num_args, zval **args) {
/* Functions that can be evaluated independently of what the arguments are.
* It's okay if these functions throw on invalid arguments, but they should not warn. */
if (false
case ZEND_SWITCH_STRING:
case ZEND_MATCH:
{
- zend_bool strict_comparison = opline->opcode == ZEND_MATCH;
+ bool strict_comparison = opline->opcode == ZEND_MATCH;
zend_uchar type = Z_TYPE_P(op1);
- zend_bool correct_type =
+ bool correct_type =
(opline->opcode == ZEND_SWITCH_LONG && type == IS_LONG)
|| (opline->opcode == ZEND_SWITCH_STRING && type == IS_STRING)
|| (opline->opcode == ZEND_MATCH && (type == IS_LONG || type == IS_STRING));
return SUCCESS;
}
-static void join_phi_values(zval *a, zval *b, zend_bool escape) {
+static void join_phi_values(zval *a, zval *b, bool escape) {
if (IS_BOT(a) || IS_TOP(b)) {
return;
}
/* If a live range starts in a reachable block and ends in an unreachable block, we should
* not eliminate the latter. While it cannot be reached, the FREE opcode of the loop var
* is necessary for the correctness of temporary compaction. */
-static zend_bool kept_alive_by_loop_var_free(scdf_ctx *scdf, uint32_t block_idx) {
+static bool kept_alive_by_loop_var_free(scdf_ctx *scdf, uint32_t block_idx) {
uint32_t i;
const zend_op_array *op_array = scdf->op_array;
const zend_cfg *cfg = &scdf->ssa->cfg;
ZEND_UNREACHABLE();
}
-static inline zend_bool scdf_is_edge_feasible(scdf_ctx *scdf, int from, int to) {
+static inline bool scdf_is_edge_feasible(scdf_ctx *scdf, int from, int to) {
uint32_t edge = scdf_edge(&scdf->ssa->cfg, from, to);
return zend_bitset_in(scdf->feasible_edges, edge);
}
/* The ssa_verify_integrity() function ensures that that certain invariants of the SSA form and
* CFG are upheld and prints messages to stderr if this is not the case. */
-static inline zend_bool is_in_use_chain(zend_ssa *ssa, int var, int check) {
+static inline bool is_in_use_chain(zend_ssa *ssa, int var, int check) {
int use;
FOREACH_USE(&ssa->vars[var], use) {
if (use == check) {
return 0;
}
-static inline zend_bool is_in_phi_use_chain(zend_ssa *ssa, int var, zend_ssa_phi *check) {
+static inline bool is_in_phi_use_chain(zend_ssa *ssa, int var, zend_ssa_phi *check) {
zend_ssa_phi *phi;
FOREACH_PHI_USE(&ssa->vars[var], phi) {
if (phi == check) {
return 0;
}
-static inline zend_bool is_used_by_op(zend_ssa *ssa, int op, int check) {
+static inline bool is_used_by_op(zend_ssa *ssa, int op, int check) {
zend_ssa_op *ssa_op = &ssa->ops[op];
return (ssa_op->op1_use == check)
|| (ssa_op->op2_use == check)
|| (ssa_op->result_use == check);
}
-static inline zend_bool is_defined_by_op(zend_ssa *ssa, int op, int check) {
+static inline bool is_defined_by_op(zend_ssa *ssa, int op, int check) {
zend_ssa_op *ssa_op = &ssa->ops[op];
return (ssa_op->op1_def == check)
|| (ssa_op->op2_def == check)
|| (ssa_op->result_def == check);
}
-static inline zend_bool is_in_phi_sources(zend_ssa *ssa, zend_ssa_phi *phi, int check) {
+static inline bool is_in_phi_sources(zend_ssa *ssa, zend_ssa_phi *phi, int check) {
int source;
FOREACH_PHI_SOURCE(phi, source) {
if (source == check) {
return 0;
}
-static inline zend_bool is_in_predecessors(zend_cfg *cfg, zend_basic_block *block, int check) {
+static inline bool is_in_predecessors(zend_cfg *cfg, zend_basic_block *block, int check) {
int i, *predecessors = &cfg->predecessors[block->predecessor_offset];
for (i = 0; i < block->predecessors_count; i++) {
if (predecessors[i] == check) {
return 0;
}
-static inline zend_bool is_in_successors(zend_basic_block *block, int check) {
+static inline bool is_in_successors(zend_basic_block *block, int check) {
int s;
for (s = 0; s < block->successors_count; s++) {
if (block->successors[s] == check) {
return 0;
}
-static inline zend_bool is_var_type(zend_uchar type) {
+static inline bool is_var_type(zend_uchar type) {
return (type & (IS_CV|IS_VAR|IS_TMP_VAR)) != 0;
}
int call = 0;
zend_call_info **call_stack;
ALLOCA_FLAG(use_heap);
- zend_bool is_prototype;
+ bool is_prototype;
call_stack = do_alloca((op_array->last / 2) * sizeof(zend_call_info*), use_heap);
call_info = NULL;
zend_function *callee_func;
zend_call_info *next_caller;
zend_call_info *next_callee;
- zend_bool recursive;
- zend_bool send_unpack; /* Parameters passed by SEND_UNPACK or SEND_ARRAY */
- zend_bool named_args; /* Function has named arguments */
+ bool recursive;
+ bool send_unpack; /* Parameters passed by SEND_UNPACK or SEND_ARRAY */
+ bool named_args; /* Function has named arguments */
int num_args;
zend_send_arg_info arg_info[1];
};
int blocks_count = 0;
zend_basic_block *blocks;
zval *zv;
- zend_bool extra_entry_block = 0;
+ bool extra_entry_block = 0;
cfg->flags = build_flags & (ZEND_CFG_STACKLESS|ZEND_CFG_RECV_ENTRY);
uint32_t zend_get_func_info(
const zend_call_info *call_info, const zend_ssa *ssa,
- zend_class_entry **ce, zend_bool *ce_is_instanceof)
+ zend_class_entry **ce, bool *ce_is_instanceof)
{
uint32_t ret = 0;
const zend_function *callee_func = call_info->callee_func;
uint32_t zend_get_func_info(
const zend_call_info *call_info, const zend_ssa *ssa,
- zend_class_entry **ce, zend_bool *ce_is_instanceof);
+ zend_class_entry **ce, bool *ce_is_instanceof);
int zend_func_info_startup(void);
int zend_func_info_shutdown(void);
/* Pop elements in unspecified order from worklist until it is empty */
#define WHILE_WORKLIST(worklist, len, i) do { \
- zend_bool _done = 0; \
+ bool _done = 0; \
while (!_done) { \
_done = 1; \
ZEND_BITSET_FOREACH(worklist, len, i) { \
} \
} while (0)
-static inline zend_bool add_will_overflow(zend_long a, zend_long b) {
+static inline bool add_will_overflow(zend_long a, zend_long b) {
return (b > 0 && a > ZEND_LONG_MAX - b)
|| (b < 0 && a < ZEND_LONG_MIN - b);
}
#if 0
-static inline zend_bool sub_will_overflow(zend_long a, zend_long b) {
+static inline bool sub_will_overflow(zend_long a, zend_long b) {
return (b > 0 && a < ZEND_LONG_MIN + b)
|| (b < 0 && a > ZEND_LONG_MAX + b);
}
}
}
-static inline zend_bool zend_abs_range(
+static inline bool zend_abs_range(
zend_long min, zend_long max, zend_long *abs_min, zend_long *abs_max) {
if (min == ZEND_LONG_MIN) {
/* Cannot take absolute value of LONG_MIN */
return (zend_long) ((zend_ulong) n << (zend_ulong) s);
}
-static inline zend_bool shift_left_overflows(zend_long n, zend_long s) {
+static inline bool shift_left_overflows(zend_long n, zend_long s) {
/* This considers shifts that shift in the sign bit to be overflowing as well */
if (n >= 0) {
return s >= SIZEOF_ZEND_LONG * 8 - 1 || safe_shift_left(n, s) < n;
return 0;
}
-void zend_inference_init_range(const zend_op_array *op_array, zend_ssa *ssa, int var, zend_bool underflow, zend_long min, zend_long max, zend_bool overflow)
+void zend_inference_init_range(const zend_op_array *op_array, zend_ssa *ssa, int var, bool underflow, zend_long min, zend_long max, bool overflow)
{
if (underflow) {
min = ZEND_LONG_MIN;
zend_ssa_op *ssa_op,
const zend_op **ssa_opcodes,
zend_long optimization_level,
- zend_bool update_worklist)
+ bool update_worklist)
{
uint32_t t1, t2;
uint32_t tmp, orig;
}
zend_class_entry *ce;
- zend_bool ce_is_instanceof;
+ bool ce_is_instanceof;
tmp = zend_get_func_info(call_info, ssa, &ce, &ce_is_instanceof);
UPDATE_SSA_TYPE(tmp, ssa_op->result_def);
if (ce) {
int ssa_vars_count = ssa->vars_count;
int i, j;
uint32_t tmp, worklist_len = zend_bitset_len(ssa_vars_count);
- zend_bool update_worklist = 1;
+ bool update_worklist = 1;
while (!zend_bitset_empty(worklist, worklist_len)) {
j = zend_bitset_first(worklist, worklist_len);
return SUCCESS;
}
-static zend_bool is_narrowable_instr(zend_op *opline) {
+static bool is_narrowable_instr(zend_op *opline) {
return opline->opcode == ZEND_ADD || opline->opcode == ZEND_SUB
|| opline->opcode == ZEND_MUL || opline->opcode == ZEND_DIV;
}
-static zend_bool is_effective_op1_double_cast(zend_op *opline, zval *op2) {
+static bool is_effective_op1_double_cast(zend_op *opline, zval *op2) {
return (opline->opcode == ZEND_ADD && Z_LVAL_P(op2) == 0)
|| (opline->opcode == ZEND_SUB && Z_LVAL_P(op2) == 0)
|| (opline->opcode == ZEND_MUL && Z_LVAL_P(op2) == 1)
|| (opline->opcode == ZEND_DIV && Z_LVAL_P(op2) == 1);
}
-static zend_bool is_effective_op2_double_cast(zend_op *opline, zval *op1) {
+static bool is_effective_op2_double_cast(zend_op *opline, zval *op1) {
/* In PHP it holds that (double)(0-$int) is bitwise identical to 0.0-(double)$int,
* so allowing SUB here is fine. */
return (opline->opcode == ZEND_ADD && Z_LVAL_P(op1) == 0)
* avoid infinite loops. An iterative, worklist driven approach would be possible, but the state
* management more cumbersome to implement, so we don't bother for now.
*/
-static zend_bool can_convert_to_double(
+static bool can_convert_to_double(
const zend_op_array *op_array, zend_ssa *ssa, int var_num,
zval *value, zend_bitset visited) {
zend_ssa_var *var = &ssa->vars[var_num];
zend_bitset visited, worklist;
int i, v;
zend_op *opline;
- zend_bool narrowed = 0;
+ bool narrowed = 0;
ALLOCA_FLAG(use_heap)
visited = ZEND_BITSET_ALLOCA(2 * bitset_len, use_heap);
|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_ARRAY_OF_RESOURCE)
#define DEFINE_SSA_OP_HAS_RANGE(opN) \
- static zend_always_inline zend_bool _ssa_##opN##_has_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \
+ static zend_always_inline bool _ssa_##opN##_has_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op) \
{ \
if (opline->opN##_type == IS_CONST) { \
zval *zv = CRT_CONSTANT(opline->opN); \
#define OP2_DATA_DEF_INFO() (_ssa_op2_def_info(op_array, ssa, (opline+1), (ssa_op+1)))
#define RES_INFO() (_ssa_result_def_info(op_array, ssa, opline, ssa_op))
-static zend_always_inline zend_bool zend_add_will_overflow(zend_long a, zend_long b) {
+static zend_always_inline bool zend_add_will_overflow(zend_long a, zend_long b) {
return (b > 0 && a > ZEND_LONG_MAX - b)
|| (b < 0 && a < ZEND_LONG_MIN - b);
}
-static zend_always_inline zend_bool zend_sub_will_overflow(zend_long a, zend_long b) {
+static zend_always_inline bool zend_sub_will_overflow(zend_long a, zend_long b) {
return (b > 0 && a < ZEND_LONG_MIN + b)
|| (b < 0 && a > ZEND_LONG_MAX + b);
}
int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int var, int widening, int narrowing, zend_ssa_range *tmp);
int zend_inference_propagate_range(const zend_op_array *op_array, zend_ssa *ssa, zend_op *opline, zend_ssa_op* ssa_op, int var, zend_ssa_range *tmp);
-void zend_inference_init_range(const zend_op_array *op_array, zend_ssa *ssa, int var, zend_bool underflow, zend_long min, zend_long max, zend_bool overflow);
+void zend_inference_init_range(const zend_op_array *op_array, zend_ssa *ssa, int var, bool underflow, zend_long min, zend_long max, bool overflow);
int zend_inference_narrowing_meet(zend_ssa_var_info *var_info, zend_ssa_range *r);
int zend_inference_widening_meet(zend_ssa_var_info *var_info, zend_ssa_range *r);
void zend_inference_check_recursive_dependencies(zend_op_array *op_array);
}
zend_function *zend_optimizer_get_called_func(
- zend_script *script, zend_op_array *op_array, zend_op *opline, zend_bool *is_prototype)
+ zend_script *script, zend_op_array *op_array, zend_op *opline, bool *is_prototype)
{
*is_prototype = 0;
switch (opline->opcode) {
zend_string *func_name = Z_STR_P(CRT_CONSTANT(opline->op2) + 1);
zend_function *fbc = zend_hash_find_ptr(&ce->function_table, func_name);
if (fbc) {
- zend_bool is_public = (fbc->common.fn_flags & ZEND_ACC_PUBLIC) != 0;
- zend_bool same_scope = fbc->common.scope == op_array->scope;
+ bool is_public = (fbc->common.fn_flags & ZEND_ACC_PUBLIC) != 0;
+ bool same_scope = fbc->common.scope == op_array->scope;
if (is_public || same_scope) {
return fbc;
}
zend_function *fbc = zend_hash_find_ptr(
&op_array->scope->function_table, method_name);
if (fbc) {
- zend_bool is_private = (fbc->common.fn_flags & ZEND_ACC_PRIVATE) != 0;
- zend_bool is_final = (fbc->common.fn_flags & ZEND_ACC_FINAL) != 0;
- zend_bool same_scope = fbc->common.scope == op_array->scope;
+ bool is_private = (fbc->common.fn_flags & ZEND_ACC_PRIVATE) != 0;
+ bool is_final = (fbc->common.fn_flags & ZEND_ACC_FINAL) != 0;
+ bool same_scope = fbc->common.scope == op_array->scope;
if (is_private) {
/* Only use private method if in the same scope. We can't even use it
* as a prototype, as it may be overridden with changed signature. */
}
}
-static zend_bool needs_live_range(zend_op_array *op_array, zend_op *def_opline) {
+static bool needs_live_range(zend_op_array *op_array, zend_op *def_opline) {
zend_func_info *func_info = ZEND_FUNC_INFO(op_array);
zend_ssa_op *ssa_op = &func_info->ssa.ops[def_opline - op_array->opcodes];
int ssa_var = ssa_op->result_def;
target = src; \
} while (0)
-static inline zend_bool zend_optimizer_is_loop_var_free(const zend_op *opline) {
+static inline bool zend_optimizer_is_loop_var_free(const zend_op *opline) {
return (opline->opcode == ZEND_FE_FREE && opline->extended_value != ZEND_FREE_ON_RETURN)
|| (opline->opcode == ZEND_FREE && opline->extended_value == ZEND_FREE_SWITCH);
}
void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx *ctx);
void zend_optimizer_compact_vars(zend_op_array *op_array);
zend_function *zend_optimizer_get_called_func(
- zend_script *script, zend_op_array *op_array, zend_op *opline, zend_bool *is_prototype);
+ zend_script *script, zend_op_array *op_array, zend_op *opline, bool *is_prototype);
uint32_t zend_optimizer_classify_function(zend_string *name, uint32_t num_args);
void zend_optimizer_migrate_jump(zend_op_array *op_array, zend_op *new_opline, zend_op *opline);
void zend_optimizer_shift_jump(zend_op_array *op_array, zend_op *opline, uint32_t *shiftlist);
int sccp_optimize_op_array(zend_optimizer_ctx *ctx, zend_op_array *op_arrya, zend_ssa *ssa, zend_call_info **call_map);
-int dce_optimize_op_array(zend_op_array *op_array, zend_ssa *ssa, zend_bool reorder_dtor_effects);
+int dce_optimize_op_array(zend_op_array *op_array, zend_ssa *ssa, bool reorder_dtor_effects);
int zend_ssa_escape_analysis(const zend_script *script, zend_op_array *op_array, zend_ssa *ssa);
typedef void (*zend_op_array_func_t)(zend_op_array *, void *context);
#include "zend_inference.h"
#include "Optimizer/zend_optimizer_internal.h"
-static zend_bool dominates(const zend_basic_block *blocks, int a, int b) {
+static bool dominates(const zend_basic_block *blocks, int a, int b) {
while (blocks[b].level > blocks[a].level) {
b = blocks[b].idom;
}
return a == b;
}
-static zend_bool will_rejoin(
+static bool will_rejoin(
const zend_cfg *cfg, const zend_dfg *dfg, const zend_basic_block *block,
int other_successor, int exclude, int var) {
int i;
return 0;
}
-static zend_bool needs_pi(const zend_op_array *op_array, zend_dfg *dfg, zend_ssa *ssa, int from, int to, int var) /* {{{ */
+static bool needs_pi(const zend_op_array *op_array, zend_dfg *dfg, zend_ssa *ssa, int from, int to, int var) /* {{{ */
{
zend_basic_block *from_block, *to_block;
int other_successor;
}
/* }}} */
-void zend_ssa_rename_var_uses(zend_ssa *ssa, int old, int new, zend_bool update_types) /* {{{ */
+void zend_ssa_rename_var_uses(zend_ssa *ssa, int old, int new, bool update_types) /* {{{ */
{
zend_ssa_var *old_var = &ssa->vars[old];
zend_ssa_var *new_var = &ssa->vars[new];
/* If the op already uses the new var, don't add the op to the use
* list again. Instead move the use_chain to the correct operand. */
- zend_bool add_to_use_chain = 1;
+ bool add_to_use_chain = 1;
if (ssa_op->result_use == new) {
add_to_use_chain = 0;
} else if (ssa_op->op1_use == new) {
/* Update phi use chains */
FOREACH_PHI_USE(old_var, phi) {
int j;
- zend_bool after_first_new_source = 0;
+ bool after_first_new_source = 0;
/* If the phi already uses the new var, find its use chain, as we may
* need to move it to a different source operand. */
typedef struct _zend_ssa_range {
zend_long min;
zend_long max;
- zend_bool underflow;
- zend_bool overflow;
+ bool underflow;
+ bool overflow;
} zend_ssa_range;
typedef enum _zend_ssa_negative_lat {
void zend_ssa_remove_phi(zend_ssa *ssa, zend_ssa_phi *phi);
void zend_ssa_remove_uses_of_var(zend_ssa *ssa, int var_num);
void zend_ssa_remove_block(zend_op_array *op_array, zend_ssa *ssa, int b);
-void zend_ssa_rename_var_uses(zend_ssa *ssa, int old_var, int new_var, zend_bool update_types);
+void zend_ssa_rename_var_uses(zend_ssa *ssa, int old_var, int new_var, bool update_types);
static zend_always_inline void _zend_ssa_remove_def(zend_ssa_var *var)
{
return NULL;
}
-static zend_always_inline zend_bool zend_ssa_is_no_val_use(const zend_op *opline, const zend_ssa_op *ssa_op, int var)
+static zend_always_inline bool zend_ssa_is_no_val_use(const zend_op *opline, const zend_ssa_op *ssa_op, int var)
{
if (opline->opcode == ZEND_ASSIGN
|| opline->opcode == ZEND_UNSET_CV
#ifdef ZEND_WIN32
char accel_uname_id[32];
#endif
-zend_bool accel_startup_ok = 0;
+bool accel_startup_ok = 0;
static char *zps_failure_reason = NULL;
char *zps_api_failure_reason = NULL;
-zend_bool file_cache_only = 0; /* process uses file cache only */
+bool file_cache_only = 0; /* process uses file cache only */
#if ENABLE_FILE_CACHE_FALLBACK
-zend_bool fallback_process = 0; /* process uses file cache fallback */
+bool fallback_process = 0; /* process uses file cache fallback */
#endif
static zend_op_array *(*accelerator_orig_compile_file)(zend_file_handle *file_handle, int type);
return (char*)path;
}
-int zend_accel_invalidate(const char *filename, size_t filename_len, zend_bool force)
+int zend_accel_invalidate(const char *filename, size_t filename_len, bool force)
{
zend_string *realpath;
zend_persistent_script *persistent_script;
}
}
-static zend_always_inline zend_bool is_phar_file(zend_string *filename)
+static zend_always_inline bool is_phar_file(zend_string *filename)
{
return filename && ZSTR_LEN(filename) >= sizeof(".phar") &&
!memcmp(ZSTR_VAL(filename) + ZSTR_LEN(filename) - (sizeof(".phar")-1), ".phar", sizeof(".phar")-1) &&
size_t shm_size = ZCG(accel_directives).memory_consumption;
#ifdef HAVE_JIT
size_t jit_size = 0;
- zend_bool reattached = 0;
+ bool reattached = 0;
if (JIT_G(enabled) && JIT_G(buffer_size)
&& zend_jit_check_support() == SUCCESS) {
void accel_shutdown(void)
{
zend_ini_entry *ini_entry;
- zend_bool _file_cache_only = 0;
+ bool _file_cache_only = 0;
#ifdef HAVE_JIT
zend_jit_shutdown();
} ZEND_HASH_FOREACH_END();
}
-static zend_bool preload_needed_types_known(zend_class_entry *ce);
+static bool preload_needed_types_known(zend_class_entry *ce);
static void get_unlinked_dependency(zend_class_entry *ce, const char **kind, const char **name) {
zend_class_entry *p;
*kind = "Unknown reason";
}
}
-static zend_bool preload_try_resolve_constants(zend_class_entry *ce)
+static bool preload_try_resolve_constants(zend_class_entry *ce)
{
- zend_bool ok, changed;
+ bool ok, changed;
zend_class_constant *c;
zval *val;
return ce;
}
-static zend_bool preload_try_resolve_property_types(zend_class_entry *ce)
+static bool preload_try_resolve_property_types(zend_class_entry *ce)
{
- zend_bool ok = 1;
+ bool ok = 1;
if (ce->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) {
zend_property_info *prop;
ZEND_HASH_FOREACH_PTR(&ce->properties_info, prop) {
return ok;
}
-static zend_bool preload_is_class_type_known(zend_class_entry *ce, zend_string *name) {
+static bool preload_is_class_type_known(zend_class_entry *ce, zend_string *name) {
if (zend_string_equals_literal_ci(name, "self") ||
zend_string_equals_literal_ci(name, "parent") ||
zend_string_equals_ci(name, ce->name)) {
}
zend_string *lcname = zend_string_tolower(name);
- zend_bool known = zend_hash_exists(EG(class_table), lcname);
+ bool known = zend_hash_exists(EG(class_table), lcname);
zend_string_release(lcname);
return known;
}
-static zend_bool preload_is_type_known(zend_class_entry *ce, zend_type *type) {
+static bool preload_is_type_known(zend_class_entry *ce, zend_type *type) {
zend_type *single_type;
ZEND_TYPE_FOREACH(*type, single_type) {
if (ZEND_TYPE_HAS_NAME(*single_type)) {
return 1;
}
-static zend_bool preload_is_method_maybe_override(zend_class_entry *ce, zend_string *lcname) {
+static bool preload_is_method_maybe_override(zend_class_entry *ce, zend_string *lcname) {
zend_class_entry *p;
if (ce->trait_aliases || ce->trait_precedences) {
return 1;
return 0;
}
-static zend_bool preload_needed_types_known(zend_class_entry *ce) {
+static bool preload_needed_types_known(zend_class_entry *ce) {
zend_function *fptr;
zend_string *lcname;
ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->function_table, lcname, fptr) {
zend_persistent_script *script;
zend_class_entry *ce, *parent, *p;
zend_string *key;
- zend_bool found, changed;
+ bool found, changed;
uint32_t i;
dtor_func_t orig_dtor;
zend_function *function;
static void preload_remove_empty_includes(void)
{
zend_persistent_script *script;
- zend_bool changed;
+ bool changed;
/* mark all as empty */
ZEND_HASH_FOREACH_PTR(preload_scripts, script) {
zend_op_array *op_array;
zend_execute_data *old_execute_data;
zend_class_entry *old_fake_scope;
- zend_bool do_bailout = 0;
+ bool do_bailout = 0;
int ret = SUCCESS;
if (zend_hash_exists(&EG(included_files), filename)) {
return ret;
}
-static int accel_preload(const char *config, zend_bool in_child)
+static int accel_preload(const char *config, bool in_child)
{
zend_file_handle file_handle;
int ret;
size_t (*orig_ub_write)(const char *str, size_t str_length) = sapi_module.ub_write;
void (*orig_flush)(void *server_context) = sapi_module.flush;
#ifdef ZEND_SIGNALS
- zend_bool old_reset_signals = SIGG(reset);
+ bool old_reset_signals = SIGG(reset);
#endif
if (UNEXPECTED(file_cache_only)) {
EG(error_reporting) = orig_error_reporting;
if (rc == SUCCESS) {
- zend_bool orig_report_memleaks;
+ bool orig_report_memleaks;
/* don't send headers */
SG(headers_sent) = 1;
zend_long compiler_halt_offset; /* position of __HALT_COMPILER or -1 */
int ping_auto_globals_mask; /* which autoglobals are used by the script */
accel_time_t timestamp; /* the script modification time */
- zend_bool corrupted;
- zend_bool is_phar;
- zend_bool empty;
+ bool corrupted;
+ bool is_phar;
+ bool empty;
uint32_t num_warnings;
zend_recorded_warning **warnings;
char *user_blacklist_filename;
zend_long consistency_checks;
zend_long force_restart_timeout;
- zend_bool use_cwd;
- zend_bool ignore_dups;
- zend_bool validate_timestamps;
- zend_bool revalidate_path;
- zend_bool save_comments;
- zend_bool record_warnings;
- zend_bool protect_memory;
- zend_bool file_override_enabled;
- zend_bool enable_cli;
- zend_bool validate_permission;
+ bool use_cwd;
+ bool ignore_dups;
+ bool validate_timestamps;
+ bool revalidate_path;
+ bool save_comments;
+ bool record_warnings;
+ bool protect_memory;
+ bool file_override_enabled;
+ bool enable_cli;
+ bool validate_permission;
#ifndef ZEND_WIN32
- zend_bool validate_root;
+ bool validate_root;
#endif
zend_ulong revalidate_freq;
zend_ulong file_update_protection;
char *lockfile_path;
#endif
char *file_cache;
- zend_bool file_cache_only;
- zend_bool file_cache_consistency_checks;
+ bool file_cache_only;
+ bool file_cache_consistency_checks;
#if ENABLE_FILE_CACHE_FALLBACK
- zend_bool file_cache_fallback;
+ bool file_cache_fallback;
#endif
#ifdef HAVE_HUGE_CODE_PAGES
- zend_bool huge_code_pages;
+ bool huge_code_pages;
#endif
char *preload;
#ifndef ZEND_WIN32
typedef struct _zend_accel_globals {
int counted; /* the process uses shared memory */
- zend_bool enabled;
- zend_bool locked; /* thread obtained exclusive lock */
- zend_bool accelerator_enabled; /* accelerator enabled for current request */
- zend_bool pcre_reseted;
+ bool enabled;
+ bool locked; /* thread obtained exclusive lock */
+ bool accelerator_enabled; /* accelerator enabled for current request */
+ bool pcre_reseted;
zend_accel_directives accel_directives;
zend_string *cwd; /* current working directory or NULL */
zend_string *include_path; /* current value of "include_path" directive */
void *mem;
void *arena_mem;
zend_persistent_script *current_persistent_script;
- zend_bool is_immutable_class;
+ bool is_immutable_class;
/* Temporary storage for warnings before they are moved into persistent_script. */
- zend_bool record_warnings;
+ bool record_warnings;
uint32_t num_warnings;
zend_recorded_warning **warnings;
/* cache to save hash lookup on the same INCLUDE opcode */
time_t start_time;
time_t last_restart_time;
time_t force_restart_time;
- zend_bool accelerator_enabled;
- zend_bool restart_pending;
+ bool accelerator_enabled;
+ bool restart_pending;
zend_accel_restart_reason restart_reason;
- zend_bool cache_status_before_restart;
+ bool cache_status_before_restart;
#ifdef ZEND_WIN32
LONGLONG mem_usage;
LONGLONG restart_in;
#endif
- zend_bool restart_in_progress;
+ bool restart_in_progress;
/* Preloading */
zend_persistent_script *preload_script;
#ifdef ZEND_WIN32
extern char accel_uname_id[32];
#endif
-extern zend_bool accel_startup_ok;
-extern zend_bool file_cache_only;
+extern bool accel_startup_ok;
+extern bool file_cache_only;
#if ENABLE_FILE_CACHE_FALLBACK
-extern zend_bool fallback_process;
+extern bool fallback_process;
#endif
extern zend_accel_shared_globals *accel_shared_globals;
accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle, size_t *size);
int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle);
int validate_timestamp_and_record_ex(zend_persistent_script *persistent_script, zend_file_handle *file_handle);
-int zend_accel_invalidate(const char *filename, size_t filename_len, zend_bool force);
+int zend_accel_invalidate(const char *filename, size_t filename_len, bool force);
int accelerator_shm_read_lock(void);
void accelerator_shm_read_unlock(void);
static const void *zend_jit_trace_get_exit_addr(uint32_t n);
static void zend_jit_trace_add_code(const void *start, uint32_t size);
-static zend_bool dominates(const zend_basic_block *blocks, int a, int b) {
+static bool dominates(const zend_basic_block *blocks, int a, int b) {
while (blocks[b].level > blocks[a].level) {
b = blocks[b].idom;
}
return a == b;
}
-static zend_bool zend_ssa_is_last_use(const zend_op_array *op_array, const zend_ssa *ssa, int var, int use)
+static bool zend_ssa_is_last_use(const zend_op_array *op_array, const zend_ssa *ssa, int var, int use)
{
int next_use;
return 0;
}
-static zend_bool zend_ival_is_last_use(const zend_lifetime_interval *ival, int use)
+static bool zend_ival_is_last_use(const zend_lifetime_interval *ival, int use)
{
if (ival->flags & ZREG_LAST_USE) {
const zend_life_range *range = &ival->range;
return 0;
}
-static zend_bool zend_is_commutative(zend_uchar opcode)
+static bool zend_is_commutative(zend_uchar opcode)
{
return
opcode == ZEND_ADD ||
opcode == ZEND_BW_XOR;
}
-static zend_bool zend_long_is_power_of_two(zend_long x)
+static bool zend_long_is_power_of_two(zend_long x)
{
return (x > 0) && !(x & (x - 1));
}
return end - block_order;
}
-static zend_bool zend_jit_in_loop(zend_ssa *ssa, int header, zend_basic_block *b)
+static bool zend_jit_in_loop(zend_ssa *ssa, int header, zend_basic_block *b)
{
while (b->loop_header >= 0) {
if (b->loop_header == header) {
return range->end;
}
-static zend_bool zend_interval_covers(zend_lifetime_interval *ival, uint32_t position)
+static bool zend_interval_covers(zend_lifetime_interval *ival, uint32_t position)
{
zend_life_range *range = &ival->range;
((intervals[i]->flags & ZREG_LOAD) ||
((intervals[i]->flags & ZREG_STORE) && ssa->vars[i].definition >= 0)) &&
ssa->vars[i].use_chain < 0) {
- zend_bool may_remove = 1;
+ bool may_remove = 1;
zend_ssa_phi *phi = ssa->vars[i].phi_use_chain;
while (phi) {
(intervals[i]->flags & ZREG_STORE) &&
(ssa->vars[i].use_chain < 0 ||
zend_ssa_next_use(ssa->ops, i, ssa->vars[i].use_chain) < 0)) {
- zend_bool may_remove = 1;
+ bool may_remove = 1;
zend_ssa_phi *phi = ssa->vars[i].phi_use_chain;
while (phi) {
int call_level = 0;
void *checkpoint = NULL;
zend_lifetime_interval **ra = NULL;
- zend_bool is_terminated = 1; /* previous basic block is terminated by jump */
- zend_bool recv_emitted = 0; /* emitted at least one RECV opcode */
+ bool is_terminated = 1; /* previous basic block is terminated by jump */
+ bool recv_emitted = 0; /* emitted at least one RECV opcode */
zend_uchar smart_branch_opcode;
uint32_t target_label, target_label2;
uint32_t op1_info, op1_def_info, op2_info, res_info, res_use_info;
zend_jit_addr op1_addr, op1_def_addr, op2_addr, op2_def_addr, res_addr;
zend_class_entry *ce;
- zend_bool ce_is_instanceof;
+ bool ce_is_instanceof;
if (JIT_G(bisect_limit)) {
jit_bisect_pos++;
}
} else {
int j;
- zend_bool left_frame = 0;
+ bool left_frame = 0;
if (!zend_jit_return(&dasm_state, opline, op_array,
op1_info, OP1_REG_ADDR())) {
/* JIT-ed code is going to be called by VM */
}
-void zend_jit_check_funcs(HashTable *function_table, zend_bool is_method) {
+void zend_jit_check_funcs(HashTable *function_table, bool is_method) {
zend_op *opline;
zend_function *func;
zend_op_array *op_array;
return SUCCESS;
}
-ZEND_EXT_API int zend_jit_startup(void *buf, size_t size, zend_bool reattached)
+ZEND_EXT_API int zend_jit_startup(void *buf, size_t size, bool reattached)
{
int ret;
typedef struct _sym_node zend_sym_node;
typedef struct _zend_jit_globals {
- zend_bool enabled;
- zend_bool on;
+ bool enabled;
+ bool on;
uint8_t trigger;
uint8_t opt_level;
uint32_t opt_flags;
zend_sym_node *symbols; /* symbols for disassembler */
- zend_bool tracing;
+ bool tracing;
zend_jit_trace_rec *current_trace;
zend_jit_trace_stack_frame *current_frame;
ZEND_EXT_API int zend_jit_config(zend_string *jit_options, int stage);
ZEND_EXT_API int zend_jit_debug_config(zend_long old_val, zend_long new_val, int stage);
ZEND_EXT_API int zend_jit_check_support(void);
-ZEND_EXT_API int zend_jit_startup(void *jit_buffer, size_t size, zend_bool reattached);
+ZEND_EXT_API int zend_jit_startup(void *jit_buffer, size_t size, bool reattached);
ZEND_EXT_API void zend_jit_shutdown(void);
ZEND_EXT_API void zend_jit_activate(void);
ZEND_EXT_API void zend_jit_deactivate(void);
return ref;
}
-static zend_always_inline zend_bool zend_jit_verify_type_common(zval *arg, zend_arg_info *arg_info, void **cache_slot)
+static zend_always_inline bool zend_jit_verify_type_common(zval *arg, zend_arg_info *arg_info, void **cache_slot)
{
uint32_t type_mask;
return 0;
}
-static zend_bool ZEND_FASTCALL zend_jit_verify_arg_slow(zval *arg, zend_arg_info *arg_info)
+static bool ZEND_FASTCALL zend_jit_verify_arg_slow(zval *arg, zend_arg_info *arg_info)
{
zend_execute_data *execute_data = EG(current_execute_data);
const zend_op *opline = EX(opline);
void **cache_slot = CACHE_ADDR(opline->extended_value);
- zend_bool ret;
+ bool ret;
ret = zend_jit_verify_type_common(arg, arg_info, cache_slot);
if (UNEXPECTED(!ret)) {
zend_jit_fetch_obj_is_slow(zobj);
}
-static zend_always_inline zend_bool promotes_to_array(zval *val) {
+static zend_always_inline bool promotes_to_array(zval *val) {
return Z_TYPE_P(val) <= IS_FALSE
|| (Z_ISREF_P(val) && Z_TYPE_P(Z_REFVAL_P(val)) <= IS_FALSE);
}
-static zend_always_inline zend_bool check_type_array_assignable(zend_type type) {
+static zend_always_inline bool check_type_array_assignable(zend_type type) {
if (!ZEND_TYPE_IS_SET(type)) {
return 1;
}
zend_get_unmangled_property_name(prop->name));
}
-static zend_never_inline zend_bool zend_handle_fetch_obj_flags(
+static zend_never_inline bool zend_handle_fetch_obj_flags(
zval *result, zval *ptr, zend_object *obj, zend_property_info *prop_info, uint32_t flags)
{
switch (flags) {
return NULL;
}
-static ZEND_COLD void zend_jit_throw_incdec_ref_error(zend_reference *ref, zend_bool inc)
+static ZEND_COLD void zend_jit_throw_incdec_ref_error(zend_reference *ref, bool inc)
{
zend_property_info *error_prop = zend_jit_get_prop_not_accepting_double(ref);
/* Currently there should be no way for a typed reference to accept both int and double.
ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_jit_loop_counter_helper(ZEND_OPCODE_HANDLER_ARGS);
void ZEND_FASTCALL zend_jit_copy_extra_args_helper(EXECUTE_DATA_D);
-zend_bool ZEND_FASTCALL zend_jit_deprecated_helper(OPLINE_D);
+bool ZEND_FASTCALL zend_jit_deprecated_helper(OPLINE_D);
zend_constant* ZEND_FASTCALL zend_jit_get_constant(const zval *key, uint32_t flags);
zend_constant* ZEND_FASTCALL zend_jit_check_constant(const zval *key);
int ZEND_FASTCALL zend_jit_trace_exit(uint32_t exit_num, zend_jit_registers_buf *regs);
zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *execute_data, const zend_op *opline, zend_jit_trace_rec *trace_buffer, uint8_t start, uint32_t is_megamorphc);
-static zend_always_inline const zend_op* zend_jit_trace_get_exit_opline(zend_jit_trace_rec *trace, const zend_op *opline, zend_bool *exit_if_true)
+static zend_always_inline const zend_op* zend_jit_trace_get_exit_opline(zend_jit_trace_rec *trace, const zend_op *opline, bool *exit_if_true)
{
if (trace->op == ZEND_JIT_TRACE_VM || trace->op == ZEND_JIT_TRACE_END) {
if (trace->opline == opline + 1) {
return NULL;
}
-static zend_always_inline zend_bool zend_jit_may_be_polymorphic_call(const zend_op *opline)
+static zend_always_inline bool zend_jit_may_be_polymorphic_call(const zend_op *opline)
{
if (opline->opcode == ZEND_INIT_FCALL
|| opline->opcode == ZEND_INIT_FCALL_BY_NAME
if (p->op == ZEND_JIT_TRACE_VM) {
const zend_op *opline = p->opline;
int len;
- zend_bool support_opline;
+ bool support_opline;
support_opline =
zend_jit_opline_supports_reg(op_array, ssa, opline, ssa_op, p);
}
}
-static zend_bool zend_jit_may_delay_fetch_this(zend_ssa *ssa, const zend_op **ssa_opcodes, int var)
+static bool zend_jit_may_delay_fetch_this(zend_ssa *ssa, const zend_op **ssa_opcodes, int var)
{
int i;
int use = ssa->vars[var].use_chain;
zend_ssa *ssa,
zend_jit_trace_stack *stack,
zend_lifetime_interval **ra,
- zend_bool polymorphic_side_trace)
+ bool polymorphic_side_trace)
{
int i;
- zend_bool has_constants = 0;
- zend_bool has_unsaved_vars = 0;
+ bool has_constants = 0;
+ bool has_unsaved_vars = 0;
// TODO: Merge this loop with the following register LOAD loop to implement parallel move ???
for (i = 0; i < parent_vars_count; i++) {
info->range.overflow = 0;
}
-static void zend_jit_trace_update_condition_ranges(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_op_array *op_array, zend_ssa *ssa, zend_bool exit_if_true)
+static void zend_jit_trace_update_condition_ranges(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_op_array *op_array, zend_ssa *ssa, bool exit_if_true)
{
zend_long op1_min, op1_max, op2_min, op2_max;
}
}
-static zend_bool zend_jit_may_skip_comparison(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_ssa *ssa, const zend_op **ssa_opcodes)
+static bool zend_jit_may_skip_comparison(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_ssa *ssa, const zend_op **ssa_opcodes)
{
zend_uchar prev_opcode;
zend_uchar smart_branch_opcode;
const void *exit_addr;
uint32_t op1_info, op1_def_info, op2_info, res_info, res_use_info, op1_data_info;
- zend_bool send_result = 0;
- zend_bool skip_comparison;
+ bool send_result = 0;
+ bool skip_comparison;
zend_jit_addr op1_addr, op1_def_addr, op2_addr, op2_def_addr, res_addr;
zend_class_entry *ce;
- zend_bool ce_is_instanceof;
- zend_bool delayed_fetch_this = 0;
- zend_bool avoid_refcounting = 0;
- zend_bool polymorphic_side_trace =
+ bool ce_is_instanceof;
+ bool delayed_fetch_this = 0;
+ bool avoid_refcounting = 0;
+ bool polymorphic_side_trace =
parent_trace &&
(zend_jit_traces[parent_trace].exit_info[exit_num].flags & ZEND_JIT_EXIT_METHOD_CALL);
uint32_t i;
uint8_t op3_type = p->op3_type;
uint8_t orig_op1_type = op1_type;
uint8_t orig_op2_type = op2_type;
- zend_bool op1_indirect;
+ bool op1_indirect;
zend_class_entry *op1_ce = NULL;
zend_class_entry *op2_ce = NULL;
CHECK_OP1_TRACE_TYPE();
CHECK_OP2_TRACE_TYPE();
if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0) {
- zend_bool exit_if_true = 0;
+ bool exit_if_true = 0;
const zend_op *exit_opline = zend_jit_trace_get_exit_opline(p + 1, opline + 1, &exit_if_true);
uint32_t exit_point;
CHECK_OP1_TRACE_TYPE();
CHECK_OP2_TRACE_TYPE();
if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0) {
- zend_bool exit_if_true = 0;
+ bool exit_if_true = 0;
const zend_op *exit_opline = zend_jit_trace_get_exit_opline(p + 1, opline + 1, &exit_if_true);
uint32_t exit_point;
goto done;
case ZEND_DEFINED:
if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0) {
- zend_bool exit_if_true = 0;
+ bool exit_if_true = 0;
const zend_op *exit_opline = zend_jit_trace_get_exit_opline(p + 1, opline + 1, &exit_if_true);
uint32_t exit_point = zend_jit_trace_get_exit_point(exit_opline, 0);
}
op1_info = OP1_INFO();
if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0) {
- zend_bool exit_if_true = 0;
+ bool exit_if_true = 0;
const zend_op *exit_opline = zend_jit_trace_get_exit_opline(p + 1, opline + 1, &exit_if_true);
uint32_t exit_point;
} else {
int j;
int may_throw = 0;
- zend_bool left_frame = 0;
+ bool left_frame = 0;
if (!zend_jit_return(&dasm_state, opline, op_array,
op1_info, OP1_REG_ADDR())) {
CHECK_OP1_TRACE_TYPE();
}
if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0) {
- zend_bool exit_if_true = 0;
+ bool exit_if_true = 0;
const zend_op *exit_opline = zend_jit_trace_get_exit_opline(p + 1, opline + 1, &exit_if_true);
uint32_t exit_point = zend_jit_trace_get_exit_point(exit_opline, 0);
break;
}
if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0) {
- zend_bool exit_if_true = 0;
+ bool exit_if_true = 0;
const zend_op *exit_opline = zend_jit_trace_get_exit_opline(p + 1, opline + 1, &exit_if_true);
uint32_t exit_point = zend_jit_trace_get_exit_point(exit_opline, 0);
op2_info = OP2_INFO();
CHECK_OP2_TRACE_TYPE();
if ((opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0) {
- zend_bool exit_if_true = 0;
+ bool exit_if_true = 0;
const zend_op *exit_opline = zend_jit_trace_get_exit_opline(p + 1, opline + 1, &exit_if_true);
uint32_t exit_point;
const zend_op *opline;
uint32_t stack_size;
zend_jit_trace_stack *stack;
- zend_bool original_handler = 0;
+ bool original_handler = 0;
if (!zend_jit_trace_exit_needs_deoptimization(trace_num, exit_num)) {
return dasm_labels[zend_lbtrace_escape];
zend_shared_alloc_unlock();
}
-static zend_bool zend_jit_trace_is_bad_root(const zend_op *opline, zend_jit_trace_stop stop, size_t offset)
+static bool zend_jit_trace_is_bad_root(const zend_op *opline, zend_jit_trace_stop stop, size_t offset)
{
const zend_op **cache_opline = JIT_G(bad_root_cache_opline);
uint8_t *cache_count = JIT_G(bad_root_cache_count);
zend_shared_alloc_unlock();
}
-static zend_bool zend_jit_trace_exit_is_bad(uint32_t trace_num, uint32_t exit_num)
+static bool zend_jit_trace_exit_is_bad(uint32_t trace_num, uint32_t exit_num)
{
uint8_t *counter = JIT_G(exit_counters) +
zend_jit_traces[trace_num].exit_counters + exit_num;
return 0;
}
-static zend_bool zend_jit_trace_exit_is_hot(uint32_t trace_num, uint32_t exit_num)
+static bool zend_jit_trace_exit_is_hot(uint32_t trace_num, uint32_t exit_num)
{
uint8_t *counter = JIT_G(exit_counters) +
zend_jit_traces[trace_num].exit_counters + exit_num;
}
}
-zend_bool ZEND_FASTCALL zend_jit_deprecated_helper(OPLINE_D)
+bool ZEND_FASTCALL zend_jit_deprecated_helper(OPLINE_D)
{
zend_execute_data *call = (zend_execute_data *) opline;
zend_function *fbc = call->func;
|| }
|.endmacro
-static zend_bool reuse_ip = 0;
-static zend_bool delayed_call_chain = 0;
+static bool reuse_ip = 0;
+static bool delayed_call_chain = 0;
static uint32_t delayed_call_level = 0;
static const zend_op *last_valid_opline = NULL;
-static zend_bool use_last_vald_opline = 0;
-static zend_bool track_last_valid_opline = 0;
+static bool use_last_vald_opline = 0;
+static bool track_last_valid_opline = 0;
static int jit_return_label = -1;
static uint32_t current_trace_num = 0;
static uint32_t allowed_opt_flags = 0;
}
}
-static zend_bool zend_jit_trace_uses_initial_ip(void)
+static bool zend_jit_trace_uses_initial_ip(void)
{
return use_last_vald_opline;
}
return ones32(x) - 1;
}
-static zend_bool is_power_of_two(uint32_t x)
+static bool is_power_of_two(uint32_t x)
{
return !(x & (x - 1)) && x != 0;
}
-static zend_bool has_concrete_type(uint32_t value_type)
+static bool has_concrete_type(uint32_t value_type)
{
return is_power_of_two (value_type & (MAY_BE_ANY|MAY_BE_UNDEF));
}
return floor_log2(value_type & (MAY_BE_ANY|MAY_BE_UNDEF));
}
-static inline zend_bool is_signed(double d)
+static inline bool is_signed(double d)
{
return (((unsigned char*)&d)[sizeof(double)-1] & 0x80) != 0;
}
zend_jit_addr val_addr,
uint32_t val_info,
zend_jit_addr res_addr,
- zend_bool check_exception);
+ bool check_exception);
static int zend_jit_assign_const_stub(dasm_State **Dst)
{
return 1;
}
-static int zend_jit_trace_return(dasm_State **Dst, zend_bool original_handler)
+static int zend_jit_trace_return(dasm_State **Dst, bool original_handler)
{
#if 0
| jmp ->trace_escape
zend_jit_trace_stack *stack = JIT_G(current_frame)->stack;
if (zend_is_smart_branch(opline)) {
- zend_bool exit_if_true = 0;
+ bool exit_if_true = 0;
exit_opline = zend_jit_trace_get_exit_opline(trace, opline + 1, &exit_if_true);
} else {
switch (opline->opcode) {
#endif
}
-static int zend_jit_spill_store(dasm_State **Dst, zend_jit_addr src, zend_jit_addr dst, uint32_t info, zend_bool set_type)
+static int zend_jit_spill_store(dasm_State **Dst, zend_jit_addr src, zend_jit_addr dst, uint32_t info, bool set_type)
{
ZEND_ASSERT(Z_MODE(src) == IS_REG);
ZEND_ASSERT(Z_MODE(dst) == IS_MEM_ZVAL);
return 1;
}
-static int zend_jit_store_var(dasm_State **Dst, uint32_t info, int var, zend_reg reg, zend_bool set_type)
+static int zend_jit_store_var(dasm_State **Dst, uint32_t info, int var, zend_reg reg, bool set_type)
{
zend_jit_addr src = ZEND_ADDR_REG(reg);
zend_jit_addr dst = ZEND_ADDR_MEM_ZVAL(ZREG_FP, EX_NUM_TO_VAR(var));
{
if (Z_MODE(src) == IS_REG && Z_STORE(src)) {
zend_jit_addr dst = ZEND_ADDR_MEM_ZVAL(ZREG_FP, var);
- zend_bool set_type = 1;
+ bool set_type = 1;
if ((info & (MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)) ==
(old_info & (MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF))) {
uint32_t res_use_info,
int may_overflow)
{
- zend_bool same_ops = zend_jit_same_addr(op1_addr, op2_addr);
+ bool same_ops = zend_jit_same_addr(op1_addr, op2_addr);
zend_reg result_reg;
zend_reg tmp_reg = ZREG_R0;
zend_jit_addr res_addr,
uint32_t res_use_info)
{
- zend_bool same_ops = zend_jit_same_addr(op1_addr, op2_addr);
+ bool same_ops = zend_jit_same_addr(op1_addr, op2_addr);
zend_reg result_reg;
if (Z_MODE(res_addr) == IS_REG) {
int may_throw)
/* Labels: 1,2,3,4,5,6 */
{
- zend_bool same_ops = zend_jit_same_addr(op1_addr, op2_addr);
+ bool same_ops = zend_jit_same_addr(op1_addr, op2_addr);
if ((op1_info & MAY_BE_LONG) && (op2_info & MAY_BE_LONG)) {
if (op1_info & (MAY_BE_ANY-MAY_BE_LONG)) {
int may_throw)
/* Labels: 6 */
{
- zend_bool same_ops = zend_jit_same_addr(op1_addr, op2_addr);
+ bool same_ops = zend_jit_same_addr(op1_addr, op2_addr);
zend_reg result_reg;
zval tmp;
}
if (op2_info & MAY_BE_LONG) {
- zend_bool op2_loaded = 0;
- zend_bool packed_loaded = 0;
+ bool op2_loaded = 0;
+ bool packed_loaded = 0;
if (op2_info & ((MAY_BE_ANY|MAY_BE_UNDEF) - MAY_BE_LONG)) {
| // if (EXPECTED(Z_TYPE_P(dim) == IS_LONG))
const zend_op *opline,
zend_uchar val_type,
zend_jit_addr val_addr,
- zend_bool check_exception)
+ bool check_exception)
{
| // if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(variable_ptr)))) {
| cmp aword [FCARG1a + offsetof(zend_reference, sources.ptr)], 0
zend_jit_addr val_addr,
uint32_t val_info,
zend_jit_addr __res_addr,
- zend_bool __check_exception)
+ bool __check_exception)
{
if (Z_MODE(var_addr) != IS_MEM_ZVAL || Z_REG(var_addr) != ZREG_FCARG1a || Z_OFFSET(var_addr) != 0) {
| LOAD_ZVAL_ADDR FCARG1a, var_addr
zend_jit_addr val_addr,
uint32_t val_info,
zend_jit_addr res_addr,
- zend_bool check_exception)
+ bool check_exception)
/* Labels: 1,2,3,4,5,8 */
{
int done = 0;
in_cold = 1;
}
if (Z_REG(var_use_addr) == ZREG_FCARG1a || Z_REG(var_use_addr) == ZREG_R0) {
- zend_bool keep_gc = 0;
+ bool keep_gc = 0;
| GET_ZVAL_PTR Ra(tmp_reg), var_use_addr
if (tmp_reg == ZREG_FCARG1a) {
zend_jit_addr op1_addr,
zend_ssa_range *op2_range,
zend_jit_addr op2_addr,
- zend_bool *result)
+ bool *result)
{
zend_long op1_min;
zend_long op1_max;
uint32_t target_label,
uint32_t target_label2,
const void *exit_addr,
- zend_bool skip_comparison)
+ bool skip_comparison)
{
- zend_bool swap = 0;
- zend_bool result;
+ bool swap = 0;
+ bool result;
if (zend_jit_is_constant_cmp_long_long(opline, op1_range, op1_addr, op2_range, op2_addr, &result)) {
if (!smart_branch_opcode ||
return 1;
}
-static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, zend_jit_addr res_addr, zend_bool swap, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
+static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, zend_jit_addr res_addr, bool swap, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
{
if (smart_branch_opcode) {
if (smart_branch_opcode == ZEND_JMPZ) {
static int zend_jit_cmp_double_double(dasm_State **Dst, const zend_op *opline, zend_jit_addr op1_addr, zend_jit_addr op2_addr, zend_jit_addr res_addr, zend_uchar smart_branch_opcode, uint32_t target_label, uint32_t target_label2, const void *exit_addr)
{
- zend_bool swap = 0;
+ bool swap = 0;
if (Z_MODE(op1_addr) == IS_REG) {
| SSE_AVX_OP ucomisd, vucomisd, Z_REG(op1_addr), op2_addr
uint32_t target_label,
uint32_t target_label2,
const void *exit_addr,
- zend_bool skip_comparison)
+ bool skip_comparison)
{
- zend_bool same_ops = (opline->op1_type == opline->op2_type) && (opline->op1.var == opline->op2.var);
- zend_bool has_slow;
+ bool same_ops = (opline->op1_type == opline->op2_type) && (opline->op1.var == opline->op2.var);
+ bool has_slow;
has_slow =
(op1_info & (MAY_BE_LONG|MAY_BE_DOUBLE)) &&
uint32_t target_label,
uint32_t target_label2,
const void *exit_addr,
- zend_bool skip_comparison)
+ bool skip_comparison)
{
uint32_t identical_label = (uint32_t)-1;
uint32_t not_identical_label = (uint32_t)-1;
{
uint32_t true_label = -1;
uint32_t false_label = -1;
- zend_bool set_bool = 0;
- zend_bool set_bool_not = 0;
- zend_bool set_delayed = 0;
- zend_bool jmp_done = 0;
+ bool set_bool = 0;
+ bool set_bool_not = 0;
+ bool set_delayed = 0;
+ bool jmp_done = 0;
if (branch_opcode == ZEND_BOOL) {
set_bool = 1;
return 1;
}
-static int zend_jit_push_call_frame(dasm_State **Dst, const zend_op *opline, const zend_op_array *op_array, zend_function *func, zend_bool is_closure, zend_bool use_this, zend_bool stack_check)
+static int zend_jit_push_call_frame(dasm_State **Dst, const zend_op *opline, const zend_op_array *op_array, zend_function *func, bool is_closure, bool use_this, bool stack_check)
{
uint32_t used_stack;
return 1;
}
-static int zend_jit_init_fcall(dasm_State **Dst, const zend_op *opline, uint32_t b, const zend_op_array *op_array, zend_ssa *ssa, const zend_ssa_op *ssa_op, int call_level, zend_jit_trace_rec *trace, zend_bool stack_check)
+static int zend_jit_init_fcall(dasm_State **Dst, const zend_op *opline, uint32_t b, const zend_op_array *op_array, zend_ssa *ssa, const zend_ssa_op *ssa_op, int call_level, zend_jit_trace_rec *trace, bool stack_check)
{
zend_func_info *info = ZEND_FUNC_INFO(op_array);
zend_call_info *call_info = NULL;
uint32_t op1_info,
zend_jit_addr op1_addr,
zend_class_entry *ce,
- zend_bool ce_is_instanceof,
- zend_bool use_this,
+ bool ce_is_instanceof,
+ bool use_this,
zend_class_entry *trace_ce,
zend_jit_trace_rec *trace,
- zend_bool stack_check,
- zend_bool polymorphic_side_trace)
+ bool stack_check,
+ bool polymorphic_side_trace)
{
zend_func_info *info = ZEND_FUNC_INFO(op_array);
zend_call_info *call_info = NULL;
const zend_ssa_op *ssa_op,
int call_level,
zend_jit_trace_rec *trace,
- zend_bool stack_check)
+ bool stack_check)
{
zend_function *func = NULL;
zend_jit_addr op2_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->op2.var);
uint32_t i;
zend_jit_addr res_addr;
uint32_t call_num_args = 0;
- zend_bool unknown_num_args = 0;
+ bool unknown_num_args = 0;
const void *exit_addr = NULL;
const zend_op *prev_opline;
if (!RETURN_VALUE_USED(opline)) {
zend_class_entry *ce;
- zend_bool ce_is_instanceof;
+ bool ce_is_instanceof;
uint32_t func_info = call_info ?
zend_get_func_info(call_info, ssa, &ce, &ce_is_instanceof) :
(MAY_BE_ANY|MAY_BE_REF|MAY_BE_RC1|MAY_BE_RCN);
const zend_op_array *op_array,
const zend_op *opline,
uint32_t op1_info,
- zend_bool left_frame,
+ bool left_frame,
zend_jit_trace_rec *trace,
zend_jit_trace_info *trace_info,
int indirect_var_access,
int may_throw)
{
- zend_bool may_be_top_frame =
+ bool may_be_top_frame =
JIT_G(trigger) != ZEND_JIT_ON_HOT_TRACE ||
!JIT_G(current_frame) ||
!TRACE_FRAME_IS_NESTED(JIT_G(current_frame));
- zend_bool may_need_call_helper =
+ bool may_need_call_helper =
indirect_var_access || /* may have symbol table */
!op_array->function_name || /* may have symbol table */
may_be_top_frame ||
!JIT_G(current_frame) ||
TRACE_FRAME_NUM_ARGS(JIT_G(current_frame)) == -1 || /* unknown number of args */
(uint32_t)TRACE_FRAME_NUM_ARGS(JIT_G(current_frame)) > op_array->num_args; /* extra args */
- zend_bool may_need_release_this =
+ bool may_need_release_this =
!(op_array->fn_flags & ZEND_ACC_CLOSURE) &&
op_array->scope &&
!(op_array->fn_flags & ZEND_ACC_STATIC) &&
return 1;
}
-static zend_bool zend_jit_may_avoid_refcounting(const zend_op *opline)
+static bool zend_jit_may_avoid_refcounting(const zend_op *opline)
{
switch (opline->opcode) {
case ZEND_FETCH_OBJ_FUNC_ARG:
const zend_ssa_op *ssa_op,
uint32_t op1_info,
zend_jit_addr op1_addr,
- zend_bool op1_avoid_refcounting,
+ bool op1_avoid_refcounting,
uint32_t op2_info,
uint32_t res_info,
zend_jit_addr res_addr,
const void *exit_addr = NULL;
const void *not_found_exit_addr = NULL;
const void *res_exit_addr = NULL;
- zend_bool result_avoid_refcounting = 0;
+ bool result_avoid_refcounting = 0;
uint32_t may_be_string = (opline->opcode != ZEND_FETCH_LIST_R) ? MAY_BE_STRING : 0;
orig_op1_addr = OP1_ADDR();
const zend_op *opline,
uint32_t op1_info,
zend_jit_addr op1_addr,
- zend_bool op1_avoid_refcounting,
+ bool op1_avoid_refcounting,
uint32_t op2_info,
int may_throw,
zend_uchar smart_branch_opcode,
return 1;
}
-static int zend_jit_verify_arg_type(dasm_State **Dst, const zend_op *opline, zend_arg_info *arg_info, zend_bool check_exception)
+static int zend_jit_verify_arg_type(dasm_State **Dst, const zend_op *opline, zend_arg_info *arg_info, bool check_exception)
{
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
- zend_bool in_cold = 0;
+ bool in_cold = 0;
uint32_t type_mask = ZEND_TYPE_PURE_MASK(arg_info->type) & MAY_BE_ANY;
zend_reg tmp_reg = (type_mask == 0 || is_power_of_two(type_mask)) ? ZREG_FCARG1a : ZREG_R0;
return 1;
}
-static int zend_jit_recv_init(dasm_State **Dst, const zend_op *opline, const zend_op_array *op_array, zend_bool is_last, int may_throw)
+static int zend_jit_recv_init(dasm_State **Dst, const zend_op *opline, const zend_op_array *op_array, bool is_last, int may_throw)
{
uint32_t arg_num = opline->op1.num;
zval *zv = RT_CONSTANT(opline, opline->op2);
return 1;
}
-static zend_property_info* zend_get_known_property_info(zend_class_entry *ce, zend_string *member, zend_bool on_this, zend_string *filename)
+static zend_property_info* zend_get_known_property_info(zend_class_entry *ce, zend_string *member, bool on_this, zend_string *filename)
{
zend_property_info *info = NULL;
return info;
}
-static zend_bool zend_may_be_dynamic_property(zend_class_entry *ce, zend_string *member, zend_bool on_this, zend_string *filename)
+static bool zend_may_be_dynamic_property(zend_class_entry *ce, zend_string *member, bool on_this, zend_string *filename)
{
zend_property_info *info;
const zend_ssa_op *ssa_op,
uint32_t op1_info,
zend_jit_addr op1_addr,
- zend_bool op1_indirect,
+ bool op1_indirect,
zend_class_entry *ce,
- zend_bool ce_is_instanceof,
- zend_bool use_this,
- zend_bool op1_avoid_refcounting,
+ bool ce_is_instanceof,
+ bool use_this,
+ bool op1_avoid_refcounting,
zend_class_entry *trace_ce,
int may_throw)
{
zval *member;
zend_property_info *prop_info;
- zend_bool may_be_dynamic = 1;
+ bool may_be_dynamic = 1;
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
zend_jit_addr this_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, offsetof(zend_execute_data, This));
zend_jit_addr prop_addr;
ssa->var_info[ssa_op->result_def].indirect_reference = 1;
}
} else {
- zend_bool result_avoid_refcounting = 0;
+ bool result_avoid_refcounting = 0;
if ((res_info & MAY_BE_GUARD) && JIT_G(current_frame) && prop_info) {
uint32_t flags = 0;
const zend_ssa_op *ssa_op,
uint32_t op1_info,
zend_jit_addr op1_addr,
- zend_bool op1_indirect,
+ bool op1_indirect,
zend_class_entry *ce,
- zend_bool ce_is_instanceof,
- zend_bool use_this,
+ bool ce_is_instanceof,
+ bool use_this,
zend_class_entry *trace_ce,
int may_throw)
{
zend_jit_addr this_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, offsetof(zend_execute_data, This));
zend_jit_addr res_addr = 0;
zend_jit_addr prop_addr;
- zend_bool needs_slow_path = 0;
+ bool needs_slow_path = 0;
ZEND_ASSERT(opline->op2_type == IS_CONST);
ZEND_ASSERT(op1_info & MAY_BE_OBJECT);
zend_jit_addr op1_addr,
uint32_t val_info,
zend_ssa_range *val_range,
- zend_bool op1_indirect,
+ bool op1_indirect,
zend_class_entry *ce,
- zend_bool ce_is_instanceof,
- zend_bool use_this,
+ bool ce_is_instanceof,
+ bool use_this,
zend_class_entry *trace_ce,
int may_throw)
{
zend_jit_addr val_addr = OP1_DATA_ADDR();
zend_jit_addr this_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, offsetof(zend_execute_data, This));
zend_jit_addr prop_addr;
- zend_bool needs_slow_path = 0;
+ bool needs_slow_path = 0;
binary_op_type binary_op = get_binary_op(opline->extended_value);
ZEND_ASSERT(opline->op2_type == IS_CONST);
uint32_t op1_info,
zend_jit_addr op1_addr,
uint32_t val_info,
- zend_bool op1_indirect,
+ bool op1_indirect,
zend_class_entry *ce,
- zend_bool ce_is_instanceof,
- zend_bool use_this,
+ bool ce_is_instanceof,
+ bool use_this,
zend_class_entry *trace_ce,
int may_throw)
{
zend_jit_addr res_addr = 0;
zend_jit_addr this_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, offsetof(zend_execute_data, This));
zend_jit_addr prop_addr;
- zend_bool needs_slow_path = 0;
+ bool needs_slow_path = 0;
if (RETURN_VALUE_USED(opline)) {
res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
return 1;
}
-static int zend_jit_fetch_this(dasm_State **Dst, const zend_op *opline, const zend_op_array *op_array, zend_bool check_only)
+static int zend_jit_fetch_this(dasm_State **Dst, const zend_op *opline, const zend_op_array *op_array, bool check_only)
{
if (!op_array->scope || (op_array->fn_flags & ZEND_ACC_STATIC)) {
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) {
return 1;
}
-static zend_bool zend_jit_verify_return_type(dasm_State **Dst, const zend_op *opline, const zend_op_array *op_array, uint32_t op1_info)
+static bool zend_jit_verify_return_type(dasm_State **Dst, const zend_op *opline, const zend_op_array *op_array, uint32_t op1_info)
{
zend_arg_info *arg_info = &op_array->arg_info[-1];
ZEND_ASSERT(ZEND_TYPE_IS_SET(arg_info->type));
zend_jit_addr op1_addr = OP1_ADDR();
- zend_bool needs_slow_check = 1;
- zend_bool slow_check_in_cold = 1;
+ bool needs_slow_check = 1;
+ bool slow_check_in_cold = 1;
uint32_t type_mask = ZEND_TYPE_PURE_MASK(arg_info->type) & MAY_BE_ANY;
if (type_mask == 0) {
return 1;
}
-static zend_bool zend_jit_noref_guard(dasm_State **Dst, const zend_op *opline, zend_jit_addr var_addr)
+static bool zend_jit_noref_guard(dasm_State **Dst, const zend_op *opline, zend_jit_addr var_addr)
{
int32_t exit_point = zend_jit_trace_get_exit_point(opline, 0);
const void *exit_addr = zend_jit_trace_get_exit_addr(exit_point);
return 1;
}
-static zend_bool zend_jit_fetch_reference(dasm_State **Dst, const zend_op *opline, uint8_t var_type, uint32_t *var_info_ptr, zend_jit_addr *var_addr_ptr, zend_bool add_ref_guard, zend_bool add_type_guard)
+static bool zend_jit_fetch_reference(dasm_State **Dst, const zend_op *opline, uint8_t var_type, uint32_t *var_info_ptr, zend_jit_addr *var_addr_ptr, bool add_ref_guard, bool add_type_guard)
{
zend_jit_addr var_addr = *var_addr_ptr;
uint32_t var_info = *var_info_ptr;
return 1;
}
-static zend_bool zend_jit_fetch_indirect_var(dasm_State **Dst, const zend_op *opline, uint8_t var_type, uint32_t *var_info_ptr, zend_jit_addr *var_addr_ptr, zend_bool add_indirect_guard)
+static bool zend_jit_fetch_indirect_var(dasm_State **Dst, const zend_op *opline, uint8_t var_type, uint32_t *var_info_ptr, zend_jit_addr *var_addr_ptr, bool add_indirect_guard)
{
zend_jit_addr var_addr = *var_addr_ptr;
uint32_t var_info = *var_info_ptr;
return 1;
}
-static zend_bool zend_jit_may_reuse_reg(const zend_op *opline, const zend_ssa_op *ssa_op, zend_ssa *ssa, int def_var, int use_var)
+static bool zend_jit_may_reuse_reg(const zend_op *opline, const zend_ssa_op *ssa_op, zend_ssa *ssa, int def_var, int use_var)
{
if ((ssa->var_info[def_var].type & ~MAY_BE_GUARD) != (ssa->var_info[use_var].type & ~MAY_BE_GUARD)) {
return 0;
return 0;
}
-static zend_bool zend_jit_opline_supports_reg(const zend_op_array *op_array, zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op, zend_jit_trace_rec *trace)
+static bool zend_jit_opline_supports_reg(const zend_op_array *op_array, zend_ssa *ssa, const zend_op *opline, const zend_ssa_op *ssa_op, zend_jit_trace_rec *trace)
{
uint32_t op1_info, op2_info;
return 0;
}
-static zend_bool zend_jit_var_supports_reg(zend_ssa *ssa, int var)
+static bool zend_jit_var_supports_reg(zend_ssa *ssa, int var)
{
if (ssa->vars[var].no_val) {
/* we don't need the value */
return 1;
}
-static zend_bool zend_jit_may_be_in_reg(const zend_op_array *op_array, zend_ssa *ssa, int var)
+static bool zend_jit_may_be_in_reg(const zend_op_array *op_array, zend_ssa *ssa, int var)
{
if (!zend_jit_var_supports_reg(ssa, var)) {
return 0;
return 1;
}
-static zend_bool zend_needs_extra_reg_for_const(const zend_op *opline, zend_uchar op_type, znode_op op)
+static bool zend_needs_extra_reg_for_const(const zend_op *opline, zend_uchar op_type, znode_op op)
{
|.if X64
|| if (op_type == IS_CONST) {
return 0;
}
-static zend_regset zend_jit_get_def_scratch_regset(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_op_array *op_array, zend_ssa *ssa, int current_var, zend_bool last_use)
+static zend_regset zend_jit_get_def_scratch_regset(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_op_array *op_array, zend_ssa *ssa, int current_var, bool last_use)
{
uint32_t op1_info, op2_info;
return ZEND_REGSET_EMPTY;
}
-static zend_regset zend_jit_get_scratch_regset(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_op_array *op_array, zend_ssa *ssa, int current_var, zend_bool last_use)
+static zend_regset zend_jit_get_scratch_regset(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_op_array *op_array, zend_ssa *ssa, int current_var, bool last_use)
{
uint32_t op1_info, op2_info, res_info;
zend_regset regset = ZEND_REGSET_SCRATCH;
#define OP1_DATA_DEF_REG_ADDR() \
OP_REG_ADDR(opline + 1, op1_type, op1, op1_def)
-static zend_always_inline zend_bool zend_jit_same_addr(zend_jit_addr addr1, zend_jit_addr addr2)
+static zend_always_inline bool zend_jit_same_addr(zend_jit_addr addr1, zend_jit_addr addr2)
{
if (addr1 == addr2) {
return 1;
zend_accel_blacklist_update_regexp(blacklist);
}
-zend_bool zend_accel_blacklist_is_blacklisted(zend_blacklist *blacklist, char *verify_path, size_t verify_path_len)
+bool zend_accel_blacklist_is_blacklisted(zend_blacklist *blacklist, char *verify_path, size_t verify_path_len)
{
int ret = 0;
zend_regexp_list *regexp_list_it = blacklist->regexp_list;
void zend_accel_blacklist_shutdown(zend_blacklist *blacklist);
void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename);
-zend_bool zend_accel_blacklist_is_blacklisted(zend_blacklist *blacklist, char *verify_path, size_t verify_path_len);
+bool zend_accel_blacklist_is_blacklisted(zend_blacklist *blacklist, char *verify_path, size_t verify_path_len);
void zend_accel_blacklist_apply(zend_blacklist *blacklist, blacklist_apply_func_arg_t func, void *argument);
#endif /* ZEND_ACCELERATOR_BLACKLIST_H */
* Returns pointer the actual hash entry on success
* key needs to be already allocated as it is not copied
*/
-zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, const char *key, uint32_t key_length, zend_bool indirect, void *data)
+zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, const char *key, uint32_t key_length, bool indirect, void *data)
{
zend_ulong hash_value;
zend_ulong index;
zend_accel_hash_entry *next;
void *data;
uint32_t key_length;
- zend_bool indirect;
+ bool indirect;
};
typedef struct _zend_accel_hash {
zend_accel_hash *accel_hash,
const char *key,
uint32_t key_length,
- zend_bool indirect,
+ bool indirect,
void *data);
void* zend_accel_hash_find(
const char *key,
uint32_t key_length);
-static inline zend_bool zend_accel_hash_is_full(zend_accel_hash *accel_hash)
+static inline bool zend_accel_hash_is_full(zend_accel_hash *accel_hash)
{
if (accel_hash->num_entries == accel_hash->max_num_entries) {
return 1;
return OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
} else {
/* It may be only temporary disabled */
- zend_bool *p = (zend_bool *) ZEND_INI_GET_ADDR();
+ bool *p = (bool *) ZEND_INI_GET_ADDR();
if ((ZSTR_LEN(new_value) == 2 && strcasecmp("on", ZSTR_VAL(new_value)) == 0) ||
(ZSTR_LEN(new_value) == 3 && strcasecmp("yes", ZSTR_VAL(new_value)) == 0) ||
(ZSTR_LEN(new_value) == 4 && strcasecmp("true", ZSTR_VAL(new_value)) == 0) ||
{
zend_long reqs;
zval memory_usage, statistics, scripts;
- zend_bool fetch_scripts = 1;
+ bool fetch_scripts = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &fetch_scripts) == FAILURE) {
RETURN_THROWS();
{
char *script_name;
size_t script_name_len;
- zend_bool force = 0;
+ bool force = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &script_name, &script_name_len, &force) == FAILURE) {
RETURN_THROWS();
return ptr;
}
-static void zend_persist_type(zend_type *type, zend_bool use_arena) {
+static void zend_persist_type(zend_type *type, bool use_arena) {
if (ZEND_TYPE_HAS_LIST(*type)) {
zend_type_list *list = ZEND_TYPE_LIST(*type);
if (ZEND_TYPE_USES_ARENA(*type)) {
}
}
-static void zend_persist_type_calc(zend_type *type, zend_bool use_arena)
+static void zend_persist_type_calc(zend_type *type, bool use_arena)
{
if (ZEND_TYPE_HAS_LIST(*type)) {
if (ZEND_TYPE_USES_ARENA(*type) && !ZCG(is_immutable_class) && use_arena) {
return ZEND_ALIGNED_SIZE(size);
}
-static zend_always_inline void *_zend_shared_memdup(void *source, size_t size, zend_bool arena, zend_bool get_xlat, zend_bool set_xlat, zend_bool free_source)
+static zend_always_inline void *_zend_shared_memdup(void *source, size_t size, bool arena, bool get_xlat, bool set_xlat, bool free_source)
{
void *old_p, *retval;
zend_ulong key;
/* Amount of shared memory allocated by garbage */
size_t wasted_shared_memory;
/* No more shared memory flag */
- zend_bool memory_exhausted;
+ bool memory_exhausted;
/* Saved Shared Allocator State */
zend_shared_memory_state shared_memory_state;
/* Pointer to the application's shared data structures */
zend_object *cert_obj;
zend_string *cert_str;
- zend_bool notext = 1;
+ bool notext = 1;
BIO * bio_out;
char * filename;
size_t filename_len;
zend_object *cert_obj;
zend_string *cert_str;
zval *zout;
- zend_bool notext = 1;
+ bool notext = 1;
BIO * bio_out;
ZEND_PARSE_PARAMETERS_START(2, 3)
}
/* }}} */
-zend_string* php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_bool raw)
+zend_string* php_openssl_x509_fingerprint(X509 *peer, const char *method, bool raw)
{
unsigned char md[EVP_MAX_MD_SIZE];
const EVP_MD *mdtype;
X509 *cert;
zend_object *cert_obj;
zend_string *cert_str;
- zend_bool raw_output = 0;
+ bool raw_output = 0;
char *method = "sha1";
size_t method_len;
zend_string *fingerprint;
zend_object *cert_obj;
zend_string *cert_str;
int i, sig_nid;
- zend_bool useshortnames = 1;
+ bool useshortnames = 1;
char * tmpstr;
zval subitem;
X509_EXTENSION *extension;
X509_REQ *csr;
zend_object *csr_obj;
zend_string *csr_str;
- zend_bool notext = 1;
+ bool notext = 1;
char * filename = NULL;
size_t filename_len;
BIO * bio_out;
zend_object *csr_obj;
zend_string *csr_str;
zval *zout;
- zend_bool notext = 1;
+ bool notext = 1;
BIO * bio_out;
ZEND_PARSE_PARAMETERS_START(2, 3)
X509_REQ *csr;
zend_object *csr_obj;
zend_string *csr_str;
- zend_bool use_shortnames = 1;
+ bool use_shortnames = 1;
X509_NAME *subject;
ZEND_PARSE_PARAMETERS_START(1, 2)
X509_REQ *orig_csr, *csr;
zend_object *csr_obj;
zend_string *csr_str;
- zend_bool use_shortnames = 1;
+ bool use_shortnames = 1;
php_openssl_pkey_object *key_object;
EVP_PKEY *tpubkey;
} while (0);
/* {{{ php_openssl_pkey_init_rsa */
-static zend_bool php_openssl_pkey_init_and_assign_rsa(EVP_PKEY *pkey, RSA *rsa, zval *data)
+static bool php_openssl_pkey_init_and_assign_rsa(EVP_PKEY *pkey, RSA *rsa, zval *data)
{
BIGNUM *n, *e, *d, *p, *q, *dmp1, *dmq1, *iqmp;
}
/* {{{ php_openssl_pkey_init_dsa */
-static zend_bool php_openssl_pkey_init_dsa(DSA *dsa, zval *data)
+static bool php_openssl_pkey_init_dsa(DSA *dsa, zval *data)
{
BIGNUM *p, *q, *g, *priv_key, *pub_key;
const BIGNUM *priv_key_const, *pub_key_const;
/* }}} */
/* {{{ php_openssl_pkey_init_dh */
-static zend_bool php_openssl_pkey_init_dh(DH *dh, zval *data)
+static bool php_openssl_pkey_init_dh(DH *dh, zval *data)
{
BIGNUM *p, *q, *g, *priv_key, *pub_key;
/* {{{ Return array of available digest algorithms */
PHP_FUNCTION(openssl_get_md_methods)
{
- zend_bool aliases = 0;
+ bool aliases = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &aliases) == FAILURE) {
RETURN_THROWS();
/* {{{ Return array of available cipher algorithms */
PHP_FUNCTION(openssl_get_cipher_methods)
{
- zend_bool aliases = 0;
+ bool aliases = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &aliases) == FAILURE) {
RETURN_THROWS();
/* {{{ Computes digest hash value for given data using given method, returns raw or binhex encoded string */
PHP_FUNCTION(openssl_digest)
{
- zend_bool raw_output = 0;
+ bool raw_output = 0;
char *data, *method;
size_t data_len, method_len;
const EVP_MD *mdtype;
/* Cipher mode info */
struct php_openssl_cipher_mode {
- zend_bool is_aead;
- zend_bool is_single_run_aead;
- zend_bool set_tag_length_always;
- zend_bool set_tag_length_when_encrypting;
+ bool is_aead;
+ bool is_single_run_aead;
+ bool set_tag_length_always;
+ bool set_tag_length_when_encrypting;
int aead_get_tag_flag;
int aead_set_tag_flag;
int aead_ivlen_flag;
/* }}} */
static int php_openssl_validate_iv(const char **piv, size_t *piv_len, size_t iv_required_len,
- zend_bool *free_iv, EVP_CIPHER_CTX *cipher_ctx, struct php_openssl_cipher_mode *mode) /* {{{ */
+ bool *free_iv, EVP_CIPHER_CTX *cipher_ctx, struct php_openssl_cipher_mode *mode) /* {{{ */
{
char *iv_new;
static int php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
EVP_CIPHER_CTX *cipher_ctx, struct php_openssl_cipher_mode *mode,
- const char **ppassword, size_t *ppassword_len, zend_bool *free_password,
- const char **piv, size_t *piv_len, zend_bool *free_iv,
+ const char **ppassword, size_t *ppassword_len, bool *free_password,
+ const char **piv, size_t *piv_len, bool *free_iv,
const char *tag, int tag_len, zend_long options, int enc) /* {{{ */
{
unsigned char *key;
EVP_CIPHER_CTX *cipher_ctx;
struct php_openssl_cipher_mode mode;
int i = 0, outlen;
- zend_bool free_iv = 0, free_password = 0;
+ bool free_iv = 0, free_password = 0;
zend_string *outbuf = NULL;
PHP_OPENSSL_CHECK_SIZE_T_TO_INT_NULL_RETURN(data_len, data);
struct php_openssl_cipher_mode mode;
int i = 0, outlen;
zend_string *base64_str = NULL;
- zend_bool free_iv = 0, free_password = 0;
+ bool free_iv = 0, free_password = 0;
zend_string *outbuf = NULL;
PHP_OPENSSL_CHECK_SIZE_T_TO_INT_NULL_RETURN(data_len, data);
#endif
extern php_stream* php_openssl_get_stream_from_ssl_handle(const SSL *ssl);
-extern zend_string* php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_bool raw);
+extern zend_string* php_openssl_x509_fingerprint(X509 *peer, const char *method, bool raw);
extern int php_openssl_get_ssl_stream_data_index();
static struct timeval php_openssl_subtract_timeval(struct timeval a, struct timeval b);
static int php_openssl_compare_timeval(struct timeval a, struct timeval b);
}
/* }}} */
-static int php_openssl_handle_ssl_error(php_stream *stream, int nr_bytes, zend_bool is_init) /* {{{ */
+static int php_openssl_handle_ssl_error(php_stream *stream, int nr_bytes, bool is_init) /* {{{ */
{
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
int err = SSL_get_error(sslsock->ssl_handle, nr_bytes);
return result;
}
-static zend_bool php_openssl_x509_fingerprint_match(X509 *peer, zval *val)
+static bool php_openssl_x509_fingerprint_match(X509 *peer, zval *val)
{
if (Z_TYPE_P(val) == IS_STRING) {
const char *method = NULL;
return 0;
}
-static zend_bool php_openssl_matches_wildcard_name(const char *subjectname, const char *certname) /* {{{ */
+static bool php_openssl_matches_wildcard_name(const char *subjectname, const char *certname) /* {{{ */
{
char *wildcard = NULL;
ptrdiff_t prefix_len;
}
/* }}} */
-static zend_bool php_openssl_matches_san_list(X509 *peer, const char *subject_name) /* {{{ */
+static bool php_openssl_matches_san_list(X509 *peer, const char *subject_name) /* {{{ */
{
int i, len;
unsigned char *cert_name = NULL;
}
/* }}} */
-static zend_bool php_openssl_matches_common_name(X509 *peer, const char *subject_name) /* {{{ */
+static bool php_openssl_matches_common_name(X509 *peer, const char *subject_name) /* {{{ */
{
char buf[1024];
X509_NAME *cert_name;
- zend_bool is_match = 0;
+ bool is_match = 0;
int cert_name_len;
cert_name = X509_get_subject_name(peer);
php_stream *stream;
php_openssl_netstream_data_t *sslsock;
zval *val;
- zend_bool is_self_signed = 0;
+ bool is_self_signed = 0;
stream = (php_stream*)arg;
php_stream_xport_param *xparam STREAMS_DC) /* {{{ */
{
int clisock;
- zend_bool nodelay = 0;
+ bool nodelay = 0;
zval *tmpzval = NULL;
xparam->outputs.client = NULL;
{
zval *handle;
zend_long signo;
- zend_bool restart_syscalls = 1;
- zend_bool restart_syscalls_is_null = 1;
+ bool restart_syscalls = 1;
+ bool restart_syscalls_is_null = 1;
char *error = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "lz|b!", &signo, &handle, &restart_syscalls, &restart_syscalls_is_null) == FAILURE) {
{
zend_long who = PRIO_PROCESS;
zend_long pid;
- zend_bool pid_is_null = 1;
+ bool pid_is_null = 1;
int pri;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!l", &pid, &pid_is_null, &who) == FAILURE) {
{
zend_long who = PRIO_PROCESS;
zend_long pid;
- zend_bool pid_is_null = 1;
+ bool pid_is_null = 1;
zend_long pri;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l!l", &pri, &pid, &pid_is_null, &who) == FAILURE) {
/* {{{ Enable/disable asynchronous signal handling and return the old setting. */
PHP_FUNCTION(pcntl_async_signals)
{
- zend_bool on, on_is_null = 1;
+ bool on, on_is_null = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b!", &on, &on_is_null) == FAILURE) {
RETURN_THROWS();
struct php_pcntl_pending_signal *head, *tail, *spares;
int last_error;
volatile char pending_signals;
- zend_bool async_signals;
+ bool async_signals;
ZEND_END_MODULE_GLOBALS(pcntl)
#if defined(ZTS) && defined(COMPILE_DL_PCNTL)
ZEND_TLS pcre2_compile_context *cctx = NULL;
ZEND_TLS pcre2_match_context *mctx = NULL;
ZEND_TLS pcre2_match_data *mdata = NULL;
-ZEND_TLS zend_bool mdata_used = 0;
+ZEND_TLS bool mdata_used = 0;
ZEND_TLS uint8_t pcre2_init_ok = 0;
#if defined(ZTS) && defined(HAVE_PCRE_JIT_SUPPORT)
static MUTEX_T pcre_mt = NULL;
}
static inline void add_named(
- zval *subpats, zend_string *name, zval *val, zend_bool unmatched) {
+ zval *subpats, zend_string *name, zval *val, bool unmatched) {
/* If the DUPNAMES option is used, multiple subpatterns might have the same name.
* In this case we want to preserve the one that actually has a value. */
if (!unmatched) {
static void populate_subpat_array(
zval *subpats, const char *subject, PCRE2_SIZE *offsets, zend_string **subpat_names,
uint32_t num_subpats, int count, const PCRE2_SPTR mark, zend_long flags) {
- zend_bool offset_capture = (flags & PREG_OFFSET_CAPTURE) != 0;
- zend_bool unmatched_as_null = (flags & PREG_UNMATCHED_AS_NULL) != 0;
+ bool offset_capture = (flags & PREG_OFFSET_CAPTURE) != 0;
+ bool unmatched_as_null = (flags & PREG_UNMATCHED_AS_NULL) != 0;
zval val;
int i;
if (subpat_names) {
}
/* }}} */
-static zend_always_inline zend_bool is_known_valid_utf8(
+static zend_always_inline bool is_known_valid_utf8(
zend_string *subject_str, PCRE2_SIZE start_offset) {
if (!(GC_FLAGS(subject_str) & IS_STR_VALID_UTF8)) {
/* We don't know whether the string is valid UTF-8 or not. */
piece = subject + last_end_offset;
if (count >= 0 && limit > 0) {
- zend_bool simple_string;
+ bool simple_string;
/* Check for too many substrings condition. */
if (UNEXPECTED(count == 0)) {
zend_string *result; /* Result of replacement */
zend_string *eval_result; /* Result of custom function */
pcre2_match_data *match_data;
- zend_bool old_mdata_used;
+ bool old_mdata_used;
/* Calculate the size of the offsets array, and allocate memory for it. */
num_subpats = pce->capture_count + 1;
uint32_t options; /* Execution options */
zend_string *string_key;
zend_ulong num_key;
- zend_bool invert; /* Whether to return non-matching
+ bool invert; /* Whether to return non-matching
entries */
pcre2_match_data *match_data;
invert = flags & PREG_GREP_INVERT ? 1 : 0;
zend_long backtrack_limit;
zend_long recursion_limit;
#ifdef HAVE_PCRE_JIT_SUPPORT
- zend_bool jit;
+ bool jit;
#endif
- zend_bool per_request_cache;
+ bool per_request_cache;
php_pcre_error_code error_code;
/* Used for unmatched subpatterns in OFFSET_CAPTURE mode */
zval unmatched_null_pair;
{
zval *object = ZEND_THIS;
pdo_dbh_t *dbh = NULL;
- zend_bool is_persistent = 0;
+ bool is_persistent = 0;
char *data_source;
size_t data_source_len;
char *colon;
pdo_stmt_t *stmt;
zend_string *statement;
zend_long fetch_mode;
- zend_bool fetch_mode_is_null = 1;
+ bool fetch_mode_is_null = 1;
zval *args = NULL;
uint32_t num_args = 0;
pdo_dbh_object_t *dbh_obj = Z_PDO_OBJECT_P(ZEND_THIS);
REGISTER_PDO_CLASS_CONST_LONG("CURSOR_SCROLL", (zend_long)PDO_CURSOR_SCROLL);
}
-static void dbh_free(pdo_dbh_t *dbh, zend_bool free_persistent)
+static void dbh_free(pdo_dbh_t *dbh, bool free_persistent)
{
int i;
static zend_string* dblib_handle_quoter(pdo_dbh_t *dbh, const zend_string *unquoted, enum pdo_param_type paramtype)
{
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
- zend_bool use_national_character_set = 0;
+ bool use_national_character_set = 0;
size_t i;
char *q;
size_t quotedlen = 0;
int preprocess(const char* sql, int sql_len, char* sql_out, HashTable* named_params)
{
- zend_bool passAsIs = 1, execBlock = 0;
+ bool passAsIs = 1, execBlock = 0;
zend_long pindex = -1;
char pname[254], ident[253], ident2[253];
unsigned int l;
switch (attr) {
case PDO_ATTR_AUTOCOMMIT:
{
- zend_bool bval = zval_get_long(val)? 1 : 0;
+ bool bval = zval_get_long(val)? 1 : 0;
/* ignore if the new value equals the old one */
if (dbh->auto_commit ^ bval) {
static zend_string* mysql_handle_quoter(pdo_dbh_t *dbh, const zend_string *unquoted, enum pdo_param_type paramtype )
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
- zend_bool use_national_character_set = 0;
+ bool use_national_character_set = 0;
char *quoted;
size_t quotedlen;
zend_string *quoted_str;
static bool pdo_mysql_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val)
{
zend_long lval = zval_get_long(val);
- zend_bool bval = lval ? 1 : 0;
+ bool bval = lval ? 1 : 0;
PDO_DBG_ENTER("pdo_mysql_set_attribute");
PDO_DBG_INF_FMT("dbh=%p", dbh);
PDO_DBG_INF_FMT("attr=%l", attr);
}
#ifdef PDO_USE_MYSQLND
- zend_bool fetched_anything;
+ bool fetched_anything;
PDO_DBG_ENTER("pdo_mysql_stmt_fetch");
PDO_DBG_INF_FMT("stmt=%p", S->stmt);
#define PDO_DBG_INF_FMT(...) do { if (dbg_skip_trace == FALSE) PDO_MYSQL_G(dbg)->m->log_va(PDO_MYSQL_G(dbg), __LINE__, __FILE__, -1, "info : ", __VA_ARGS__); } while (0)
#define PDO_DBG_ERR_FMT(...) do { if (dbg_skip_trace == FALSE) PDO_MYSQL_G(dbg)->m->log_va(PDO_MYSQL_G(dbg), __LINE__, __FILE__, -1, "error: ", __VA_ARGS__); } while (0)
#define PDO_DBG_ENTER(func_name) \
- zend_bool dbg_skip_trace = TRUE; \
+ bool dbg_skip_trace = TRUE; \
((void) dbg_skip_trace); \
if (PDO_MYSQL_G(dbg)) \
dbg_skip_trace = !PDO_MYSQL_G(dbg)->m->func_enter(PDO_MYSQL_G(dbg), __LINE__, __FILE__, func_name, strlen(func_name));
ub2 dtype, data_size, precis;
ub4 namelen;
struct pdo_column_data *col = &stmt->columns[colno];
- zend_bool dyn = FALSE;
+ bool dyn = FALSE;
/* describe the column */
STMT_CALL(OCIParamGet, (S->stmt, OCI_HTYPE_STMT, S->err, (dvoid*)¶m, colno+1));
static bool pdo_pgsql_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val)
{
- zend_bool bval = zval_get_long(val)? 1 : 0;
+ bool bval = zval_get_long(val)? 1 : 0;
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
switch (attr) {
static int pgsql_stmt_dtor(pdo_stmt_t *stmt)
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
- zend_bool server_obj_usable = !Z_ISUNDEF(stmt->database_object_handle)
+ bool server_obj_usable = !Z_ISUNDEF(stmt->database_object_handle)
&& IS_OBJ_VALID(EG(objects_store).object_buckets[Z_OBJ_HANDLE(stmt->database_object_handle)])
&& !(OBJ_FLAGS(Z_OBJ(stmt->database_object_handle)) & IS_OBJ_FREE_CALLED);
unsigned int stmt_counter;
/* The following two variables have the same purpose. Unfortunately we need
to keep track of two different attributes having the same effect. */
- zend_bool emulate_prepares;
- zend_bool disable_native_prepares; /* deprecated since 5.6 */
- zend_bool disable_prepares;
+ bool emulate_prepares;
+ bool disable_native_prepares; /* deprecated since 5.6 */
+ bool disable_prepares;
} pdo_pgsql_db_handle;
typedef struct {
int *param_formats;
Oid *param_types;
int current_row;
- zend_bool is_prepared;
+ bool is_prepared;
} pdo_pgsql_stmt;
typedef struct {
zval *result;
pgsql_result_handle *pg_result;
zend_long fnum = -1;
- zend_bool return_oid = 0;
+ bool return_oid = 0;
Oid oid;
smart_str hash_key = {0};
char *table_name;
zval *pgsql_id;
char *str;
zend_long z_len;
- zend_bool z_len_is_null = 1;
+ bool z_len_is_null = 1;
size_t str_len, nbytes;
size_t len;
pgLofp *pgsql;
* table_name must not be empty
* TODO: Add meta_data cache for better performance
*/
-PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta, zend_bool extended)
+PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta, bool extended)
{
PGresult *pg_result;
char *src, *tmp_name, *tmp_name2 = NULL;
zval *pgsql_link;
char *table_name;
size_t table_name_len;
- zend_bool extended=0;
+ bool extended=0;
PGconn *pgsql;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|b",
/* {{{ php_pgsql_add_quote
* add quotes around string.
*/
-static int php_pgsql_add_quotes(zval *src, zend_bool should_free)
+static int php_pgsql_add_quotes(zval *src, bool should_free)
{
smart_str str = {0};
#define PGSQL_DML_ESCAPE (1<<12) /* No convert, but escape only */
/* exported functions */
-PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta, zend_bool extended);
+PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta, bool extended);
PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval *values, zval *result, zend_ulong opt);
PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *values, zend_ulong opt, zend_string **sql);
PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *values, zval *ids, zend_ulong opt , zend_string **sql);
#include "dirstream.h"
BEGIN_EXTERN_C()
-void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_statbuf *ssb, zend_bool is_dir);
+void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_statbuf *ssb, bool is_dir);
END_EXTERN_C()
const php_stream_ops phar_dir_ops = {
char *filename;
size_t filename_len;
zend_string *contents;
- zend_bool use_include_path = 0;
+ bool use_include_path = 0;
php_stream *stream;
zend_long offset = -1;
zend_long maxlen;
- zend_bool maxlen_is_null = 1;
+ bool maxlen_is_null = 1;
zval *zcontext = NULL;
if (!PHAR_G(intercepted)) {
char *filename;
size_t filename_len;
int size = 0;
- zend_bool use_include_path = 0;
+ bool use_include_path = 0;
zval *zcontext = NULL;
php_stream *stream;
{
char *filename, *mode;
size_t filename_len, mode_len;
- zend_bool use_include_path = 0;
+ bool use_include_path = 0;
zval *zcontext = NULL;
php_stream *stream;
*/
static int phar_set_writeable_bit(zval *zv, void *argument) /* {{{ */
{
- zend_bool keep = *(zend_bool *)argument;
+ bool keep = *(bool *)argument;
phar_archive_data *phar = (phar_archive_data *)Z_PTR_P(zv);
if (!phar->is_data) {
/* if the original value is 0 (disabled), then allow setting/unsetting at will. Otherwise only allow 1 (enabled), and error on disabling */
ZEND_INI_MH(phar_ini_modify_handler) /* {{{ */
{
- zend_bool old, ini;
+ bool old, ini;
if (ZSTR_LEN(entry->name) == sizeof("phar.readonly")-1) {
old = PHAR_G(readonly_orig);
}
if (ZSTR_LEN(new_value) == 2 && !strcasecmp("on", ZSTR_VAL(new_value))) {
- ini = (zend_bool) 1;
+ ini = (bool) 1;
}
else if (ZSTR_LEN(new_value) == 3 && !strcasecmp("yes", ZSTR_VAL(new_value))) {
- ini = (zend_bool) 1;
+ ini = (bool) 1;
}
else if (ZSTR_LEN(new_value) == 4 && !strcasecmp("true", ZSTR_VAL(new_value))) {
- ini = (zend_bool) 1;
+ ini = (bool) 1;
}
else {
- ini = (zend_bool) atoi(ZSTR_VAL(new_value));
+ ini = (bool) atoi(ZSTR_VAL(new_value));
}
/* do not allow unsetting in runtime */
/**
* Open an already loaded phar
*/
-int phar_open_parsed_phar(char *fname, size_t fname_len, char *alias, size_t alias_len, zend_bool is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */
+int phar_open_parsed_phar(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */
{
phar_archive_data *phar;
#ifdef PHP_WIN32
*/
int phar_metadata_tracker_unserialize_or_copy(phar_metadata_tracker *tracker, zval *metadata, int persistent, HashTable *unserialize_options, const char* method_name) /* {{{ */
{
- const zend_bool has_unserialize_options = unserialize_options != NULL && zend_hash_num_elements(unserialize_options) > 0;
+ const bool has_unserialize_options = unserialize_options != NULL && zend_hash_num_elements(unserialize_options) > 0;
/* It should be impossible to create a zval in a persistent phar/entry. */
ZEND_ASSERT(!persistent || Z_ISUNDEF(tracker->val));
/**
* Check if this has any data, serialized or as a raw value.
*/
-zend_bool phar_metadata_tracker_has_data(const phar_metadata_tracker *tracker, int persistent) /* {{{ */
+bool phar_metadata_tracker_has_data(const phar_metadata_tracker *tracker, int persistent) /* {{{ */
{
ZEND_ASSERT(!persistent || Z_ISUNDEF(tracker->val));
return !Z_ISUNDEF(tracker->val) || tracker->str != NULL;
/* set up our manifest */
zend_hash_init(&mydata->manifest, manifest_count,
- zend_get_hash_value, destroy_phar_manifest_entry, (zend_bool)mydata->is_persistent);
+ zend_get_hash_value, destroy_phar_manifest_entry, (bool)mydata->is_persistent);
zend_hash_init(&mydata->mounted_dirs, 5,
- zend_get_hash_value, NULL, (zend_bool)mydata->is_persistent);
+ zend_get_hash_value, NULL, (bool)mydata->is_persistent);
zend_hash_init(&mydata->virtual_dirs, manifest_count * 2,
- zend_get_hash_value, NULL, (zend_bool)mydata->is_persistent);
+ zend_get_hash_value, NULL, (bool)mydata->is_persistent);
mydata->fname = pestrndup(fname, fname_len, mydata->is_persistent);
#ifdef PHP_WIN32
phar_unixify_path_separators(mydata->fname, fname_len);
/**
* Create or open a phar for writing
*/
-int phar_open_or_create_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, zend_bool is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */
+int phar_open_or_create_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */
{
const char *ext_str, *z;
char *my_error;
}
/* }}} */
-int phar_create_or_parse_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, zend_bool is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */
+int phar_create_or_parse_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error) /* {{{ */
{
phar_archive_data *mydata;
php_stream *fp;
zend_hash_init(&mydata->mounted_dirs, sizeof(char *),
zend_get_hash_value, NULL, 0);
zend_hash_init(&mydata->virtual_dirs, sizeof(char *),
- zend_get_hash_value, NULL, (zend_bool)mydata->is_persistent);
+ zend_get_hash_value, NULL, (bool)mydata->is_persistent);
mydata->fname_len = fname_len;
snprintf(mydata->version, sizeof(mydata->version), "%s", PHP_PHAR_API_VERSION);
mydata->is_temporary_alias = alias ? 0 : 1;
int persist;
int has_zlib;
int has_bz2;
- zend_bool readonly_orig;
- zend_bool require_hash_orig;
- zend_bool intercepted;
+ bool readonly_orig;
+ bool require_hash_orig;
+ bool intercepted;
int request_init;
int require_hash;
int request_done;
int phar_open_entry_file(phar_archive_data *phar, phar_entry_info *entry, char **error);
int phar_postprocess_file(phar_entry_data *idata, uint32_t crc32, char **error, int process_zip);
int phar_open_from_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, uint32_t options, phar_archive_data** pphar, char **error);
-int phar_open_or_create_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, zend_bool is_data, uint32_t options, phar_archive_data** pphar, char **error);
-int phar_create_or_parse_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, zend_bool is_data, uint32_t options, phar_archive_data** pphar, char **error);
+int phar_open_or_create_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error);
+int phar_create_or_parse_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error);
int phar_open_executed_filename(char *alias, size_t alias_len, char **error);
int phar_free_alias(phar_archive_data *phar, char *alias, size_t alias_len);
int phar_get_archive(phar_archive_data **archive, char *fname, size_t fname_len, char *alias, size_t alias_len, char **error);
-int phar_open_parsed_phar(char *fname, size_t fname_len, char *alias, size_t alias_len, zend_bool is_data, uint32_t options, phar_archive_data** pphar, char **error);
+int phar_open_parsed_phar(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error);
int phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t sig_type, char *sig, size_t sig_len, char *fname, char **signature, size_t *signature_len, char **error);
int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, size_t *signature_length, char **error);
char *phar_fix_filepath(char *path, size_t *new_len, int use_cwd);
phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error);
void phar_parse_metadata_lazy(const char *buffer, phar_metadata_tracker *tracker, uint32_t zip_metadata_len, int persistent);
-zend_bool phar_metadata_tracker_has_data(const phar_metadata_tracker* tracker, int persistent);
+bool phar_metadata_tracker_has_data(const phar_metadata_tracker* tracker, int persistent);
/* If this has data, free it and set all values to undefined. */
void phar_metadata_tracker_free(phar_metadata_tracker* val, int persistent);
void phar_metadata_tracker_copy(phar_metadata_tracker* dest, const phar_metadata_tracker *source, int persistent);
{
char *fname, *arch, *entry;
size_t fname_len, arch_len, entry_len;
- zend_bool retphar = 1;
+ bool retphar = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &retphar) == FAILURE) {
RETURN_THROWS();
size_t fname_len;
size_t ext_len;
int is_executable;
- zend_bool executable = 1;
+ bool executable = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &fname, &fname_len, &executable) == FAILURE) {
RETURN_THROWS();
char *fname, *alias = NULL, *error, *arch = NULL, *entry = NULL, *save_fname;
size_t fname_len, alias_len = 0;
size_t arch_len, entry_len;
- zend_bool is_data;
+ bool is_data;
zend_long flags = SPL_FILE_DIR_SKIPDOTS|SPL_FILE_DIR_UNIXPATHS;
zend_long format = 0;
phar_archive_object *phar_obj;
static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */
{
zval *value;
- zend_bool close_fp = 1;
+ bool close_fp = 1;
struct _phar_t *p_obj = (struct _phar_t*) puser;
size_t str_key_len, base_len = p_obj->l;
phar_entry_data *data;
{
char *dir, *error, *regex = NULL;
size_t dir_len, regex_len = 0;
- zend_bool apply_reg = 0;
+ bool apply_reg = 0;
zval arg, arg2, iter, iteriter, regexiter;
struct _phar_t pass;
uint32_t flags;
zend_object *ret;
zend_long format, method;
- zend_bool format_is_null = 1, method_is_null = 1;
+ bool format_is_null = 1, method_is_null = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!l!s!", &format, &format_is_null, &method, &method_is_null, &ext, &ext_len) == FAILURE) {
RETURN_THROWS();
uint32_t flags;
zend_object *ret;
zend_long format, method;
- zend_bool format_is_null = 1, method_is_null = 1;
+ bool format_is_null = 1, method_is_null = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!l!s!", &format, &format_is_null, &method, &method_is_null, &ext, &ext_len) == FAILURE) {
RETURN_THROWS();
}
/* }}} */
-static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *dest, size_t dest_len, char **error) /* {{{ */
+static int phar_extract_file(bool overwrite, phar_entry_info *entry, char *dest, size_t dest_len, char **error) /* {{{ */
{
php_stream_statbuf ssb;
size_t len;
}
/* }}} */
-static int extract_helper(phar_archive_data *archive, zend_string *search, char *pathto, size_t pathto_len, zend_bool overwrite, char **error) { /* {{{ */
+static int extract_helper(phar_archive_data *archive, zend_string *search, char *pathto, size_t pathto_len, bool overwrite, char **error) { /* {{{ */
int extracted = 0;
phar_entry_info *entry;
int ret;
zval *zval_file;
HashTable *files_ht = NULL;
- zend_bool overwrite = 0;
+ bool overwrite = 0;
char *error = NULL;
ZEND_PARSE_PARAMETERS_START(1, 3)
PHP_METHOD(PharFileInfo, isCompressed)
{
zend_long method;
- zend_bool method_is_null = 1;
+ bool method_is_null = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &method, &method_is_null) == FAILURE) {
RETURN_THROWS();
/**
* stat an opened phar file handle stream, used by phar_stat()
*/
-void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_statbuf *ssb, zend_bool is_temp_dir)
+void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_statbuf *ssb, bool is_temp_dir)
{
memset(ssb, 0, sizeof(php_stream_statbuf));
myphar->is_persistent = PHAR_G(persist);
/* estimate number of entries, can't be certain with tar files */
zend_hash_init(&myphar->manifest, 2 + (totalsize >> 12),
- zend_get_hash_value, destroy_phar_manifest_entry, (zend_bool)myphar->is_persistent);
+ zend_get_hash_value, destroy_phar_manifest_entry, (bool)myphar->is_persistent);
zend_hash_init(&myphar->mounted_dirs, 5,
- zend_get_hash_value, NULL, (zend_bool)myphar->is_persistent);
+ zend_get_hash_value, NULL, (bool)myphar->is_persistent);
zend_hash_init(&myphar->virtual_dirs, 4 + (totalsize >> 11),
- zend_get_hash_value, NULL, (zend_bool)myphar->is_persistent);
+ zend_get_hash_value, NULL, (bool)myphar->is_persistent);
myphar->is_tar = 1;
/* remember whether this entire phar was compressed with gz/bzip2 */
myphar->flags = compression;
php_stream_seek(fp, PHAR_GET_32(locator.cdir_offset), SEEK_SET);
/* read in central directory */
zend_hash_init(&mydata->manifest, PHAR_GET_16(locator.count),
- zend_get_hash_value, destroy_phar_manifest_entry, (zend_bool)mydata->is_persistent);
+ zend_get_hash_value, destroy_phar_manifest_entry, (bool)mydata->is_persistent);
zend_hash_init(&mydata->mounted_dirs, 5,
- zend_get_hash_value, NULL, (zend_bool)mydata->is_persistent);
+ zend_get_hash_value, NULL, (bool)mydata->is_persistent);
zend_hash_init(&mydata->virtual_dirs, PHAR_GET_16(locator.count) * 2,
- zend_get_hash_value, NULL, (zend_bool)mydata->is_persistent);
+ zend_get_hash_value, NULL, (bool)mydata->is_persistent);
entry.phar = mydata;
entry.is_zip = 1;
entry.fp_type = PHAR_FP;
PHP_FUNCTION(pspell_config_runtogether)
{
zval *zcfg;
- zend_bool runtogether;
+ bool runtogether;
PspellConfig *config;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ob", &zcfg, php_pspell_config_ce, &runtogether) == FAILURE) {
PHP_FUNCTION(pspell_config_save_repl)
{
zval *zcfg;
- zend_bool save;
+ bool save;
PspellConfig *config;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ob", &zcfg, php_pspell_config_ce, &save) == FAILURE) {
/* Key used to avoid leaking addresses in ReflectionProperty::getId() */
#define REFLECTION_KEY_LEN 16
ZEND_BEGIN_MODULE_GLOBALS(reflection)
- zend_bool key_initialized;
+ bool key_initialized;
unsigned char key[REFLECTION_KEY_LEN];
ZEND_END_MODULE_GLOBALS(reflection)
ZEND_DECLARE_MODULE_GLOBALS(reflection)
/* Struct for parameters */
typedef struct _parameter_reference {
uint32_t offset;
- zend_bool required;
+ bool required;
struct _zend_arg_info *arg_info;
zend_function *fptr;
} parameter_reference;
typedef struct _type_reference {
zend_type type;
/* Whether to use backwards compatible null representation */
- zend_bool legacy_behavior;
+ bool legacy_behavior;
} type_reference;
/* Struct for attributes */
return ref->prop ? ref->prop->flags : ZEND_ACC_PUBLIC;
}
-static inline zend_bool is_closure_invoke(zend_class_entry *ce, zend_string *lcname) {
+static inline bool is_closure_invoke(zend_class_entry *ce, zend_string *lcname) {
return ce == zend_ce_closure
&& zend_string_equals_literal(lcname, ZEND_INVOKE_FUNC_NAME);
}
return SUCCESS;
}
-static inline zend_bool has_internal_arg_info(const zend_function *fptr) {
+static inline bool has_internal_arg_info(const zend_function *fptr) {
return fptr->type == ZEND_INTERNAL_FUNCTION
&& !(fptr->common.fn_flags & ZEND_ACC_USER_ARG_INFO);
}
/* {{{ _parameter_string */
-static void _parameter_string(smart_str *str, zend_function *fptr, struct _zend_arg_info *arg_info, uint32_t offset, zend_bool required, char* indent)
+static void _parameter_string(smart_str *str, zend_function *fptr, struct _zend_arg_info *arg_info, uint32_t offset, bool required, char* indent)
{
smart_str_append_printf(str, "Parameter #%d [ ", offset);
if (!required) {
/* }}} */
/* {{{ reflection_parameter_factory */
-static void reflection_parameter_factory(zend_function *fptr, zval *closure_object, struct _zend_arg_info *arg_info, uint32_t offset, zend_bool required, zval *object)
+static void reflection_parameter_factory(zend_function *fptr, zval *closure_object, struct _zend_arg_info *arg_info, uint32_t offset, bool required, zval *object)
{
reflection_object *intern;
parameter_reference *reference;
/* For backwards compatibility reasons, we need to return T|null style unions
* as a ReflectionNamedType. Here we determine what counts as a union type and
* what doesn't. */
-static zend_bool is_union_type(zend_type type) {
+static bool is_union_type(zend_type type) {
if (ZEND_TYPE_HAS_LIST(type)) {
return 1;
}
}
/* {{{ reflection_type_factory */
-static void reflection_type_factory(zend_type type, zval *object, zend_bool legacy_behavior)
+static void reflection_type_factory(zend_type type, zval *object, bool legacy_behavior)
{
reflection_object *intern;
type_reference *reference;
- zend_bool is_union = is_union_type(type);
- zend_bool is_mixed = ZEND_TYPE_PURE_MASK(type) == MAY_BE_ANY;
+ bool is_union = is_union_type(type);
+ bool is_mixed = ZEND_TYPE_PURE_MASK(type) == MAY_BE_ANY;
reflection_instantiate(is_union && !is_mixed ? reflection_union_type_ptr : reflection_named_type_ptr, object);
intern = Z_REFLECTION_P(object);
struct _zend_arg_info *arg_info;
uint32_t num_args;
zend_class_entry *ce = NULL;
- zend_bool is_closure = 0;
+ bool is_closure = 0;
ZEND_PARSE_PARAMETERS_START(2, 2)
Z_PARAM_ZVAL(reference)
ZEND_METHOD(ReflectionMethod, setAccessible)
{
reflection_object *intern;
- zend_bool visible;
+ bool visible;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &visible) == FAILURE) {
RETURN_THROWS();
/* }}} */
/* {{{ add_class_vars */
-static void add_class_vars(zend_class_entry *ce, zend_bool statics, zval *return_value)
+static void add_class_vars(zend_class_entry *ce, bool statics, zval *return_value)
{
zend_property_info *prop_info;
zval *prop, prop_copy;
continue;
}
- zend_bool is_static = (prop_info->flags & ZEND_ACC_STATIC) != 0;
+ bool is_static = (prop_info->flags & ZEND_ACC_STATIC) != 0;
if (statics != is_static) {
continue;
}
zend_class_entry *ce;
zend_function *mptr;
zend_long filter;
- zend_bool filter_is_null = 1;
+ bool filter_is_null = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) {
RETURN_THROWS();
} ZEND_HASH_FOREACH_END();
if (instanceof_function(ce, zend_ce_closure)) {
- zend_bool has_obj = Z_TYPE(intern->obj) != IS_UNDEF;
+ bool has_obj = Z_TYPE(intern->obj) != IS_UNDEF;
zval obj_tmp;
zend_object *obj;
if (!has_obj) {
zend_string *key;
zend_property_info *prop_info;
zend_long filter;
- zend_bool filter_is_null = 1;
+ bool filter_is_null = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) {
RETURN_THROWS();
zend_class_constant *constant;
zval val;
zend_long filter;
- zend_bool filter_is_null = 1;
+ bool filter_is_null = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) {
RETURN_THROWS();
zend_string *name;
zend_class_constant *constant;
zend_long filter;
- zend_bool filter_is_null = 1;
+ bool filter_is_null = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) {
RETURN_THROWS();
ZEND_METHOD(ReflectionProperty, setAccessible)
{
reflection_object *intern;
- zend_bool visible;
+ bool visible;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &visible) == FAILURE) {
RETURN_THROWS();
/* }}} */
/* {{{ add_extension_class */
-static void add_extension_class(zend_class_entry *ce, zend_string *key, zval *class_array, zend_module_entry *module, zend_bool add_reflection_class)
+static void add_extension_class(zend_class_entry *ce, zend_string *key, zval *class_array, zend_module_entry *module, bool add_reflection_class)
{
if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module && !strcasecmp(ce->info.internal.module->name, module->name)) {
zend_string *name;
}
/* }}} */
-static zend_bool is_ignorable_reference(HashTable *ht, zval *ref) {
+static bool is_ignorable_reference(HashTable *ht, zval *ref) {
if (Z_REFCOUNT_P(ref) != 1) {
return 0;
}
PS_CLOSE_FUNC(user)
{
- zend_bool bailout = 0;
+ bool bailout = 0;
STDVARS;
if (!PS(mod_user_implemented)) {
zend_long update_step;
zend_long next_update;
double next_update_time;
- zend_bool cancel_upload;
- zend_bool apply_trans_sid;
+ bool cancel_upload;
+ bool apply_trans_sid;
size_t content_length;
zval data; /* the array exported to session data */
zend_long cookie_lifetime;
char *cookie_path;
char *cookie_domain;
- zend_bool cookie_secure;
- zend_bool cookie_httponly;
+ bool cookie_secure;
+ bool cookie_httponly;
char *cookie_samesite;
const ps_module *mod;
const ps_module *default_mod;
int mod_user_is_open;
const struct ps_serializer_struct *serializer;
zval http_session_vars;
- zend_bool auto_start;
- zend_bool use_cookies;
- zend_bool use_only_cookies;
- zend_bool use_trans_sid; /* contains the INI value of whether to use trans-sid */
+ bool auto_start;
+ bool use_cookies;
+ bool use_only_cookies;
+ bool use_trans_sid; /* contains the INI value of whether to use trans-sid */
zend_long sid_length;
zend_long sid_bits_per_character;
int define_sid;
php_session_rfc1867_progress *rfc1867_progress;
- zend_bool rfc1867_enabled; /* session.upload_progress.enabled */
- zend_bool rfc1867_cleanup; /* session.upload_progress.cleanup */
+ bool rfc1867_enabled; /* session.upload_progress.enabled */
+ bool rfc1867_cleanup; /* session.upload_progress.cleanup */
char *rfc1867_prefix; /* session.upload_progress.prefix */
char *rfc1867_name; /* session.upload_progress.name */
zend_long rfc1867_freq; /* session.upload_progress.freq */
double rfc1867_min_freq; /* session.upload_progress.min_freq */
- zend_bool use_strict_mode; /* whether or not PHP accepts unknown session ids */
- zend_bool lazy_write; /* omit session write when it is possible */
- zend_bool in_save_handler; /* state if session is in save handler or not */
- zend_bool set_handler; /* state if session module i setting handler or not */
+ bool use_strict_mode; /* whether or not PHP accepts unknown session ids */
+ bool lazy_write; /* omit session write when it is possible */
+ bool in_save_handler; /* state if session is in save handler or not */
+ bool set_handler; /* state if session module i setting handler or not */
zend_string *session_vars; /* serialized original session data */
} php_ps_globals;
/* }}} */
-static zend_long php_session_gc(zend_bool immediate) /* {{{ */
+static zend_long php_session_gc(bool immediate) /* {{{ */
{
int nrand;
zend_long num = -1;
SESSION_CHECK_OUTPUT_STATE;
if (!strncasecmp(ZSTR_VAL(new_value), "on", sizeof("on"))) {
- PS(use_trans_sid) = (zend_bool) 1;
+ PS(use_trans_sid) = (bool) 1;
} else {
- PS(use_trans_sid) = (zend_bool) atoi(ZSTR_VAL(new_value));
+ PS(use_trans_sid) = (bool) atoi(ZSTR_VAL(new_value));
}
return SUCCESS;
{
int module_number = PS(module_number);
zval *sid, *data, *ppid;
- zend_bool apply_trans_sid;
+ bool apply_trans_sid;
if (!PS(id)) {
php_error_docref(NULL, E_WARNING, "Cannot set session ID - session ID is not initialized");
HashTable *options_ht;
zend_long lifetime_long;
zend_string *lifetime = NULL, *path = NULL, *domain = NULL, *samesite = NULL;
- zend_bool secure = 0, secure_null = 1;
- zend_bool httponly = 0, httponly_null = 1;
+ bool secure = 0, secure_null = 1;
+ bool httponly = 0, httponly_null = 1;
zend_string *ini_name;
int result;
int found = 0;
zval *obj = NULL;
zend_string *func_name;
zend_function *current_mptr;
- zend_bool register_shutdown = 1;
+ bool register_shutdown = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &obj, php_session_iface_entry, ®ister_shutdown) == FAILURE) {
RETURN_THROWS();
/* {{{ Update the current session id with a newly generated one. If delete_old_session is set to true, remove the old session. */
PHP_FUNCTION(session_regenerate_id)
{
- zend_bool del_ses = 0;
+ bool del_ses = 0;
zend_string *data;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &del_ses) == FAILURE) {
PHP_FUNCTION(session_cache_expire)
{
zend_long expires;
- zend_bool expires_is_null = 1;
+ bool expires_is_null = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &expires, &expires_is_null) == FAILURE) {
RETURN_THROWS();
* Module Setup and Destruction *
******************************** */
-static int php_rinit_session(zend_bool auto_start) /* {{{ */
+static int php_rinit_session(bool auto_start) /* {{{ */
{
php_rinit_session_globals();
* Upload hook handling *
************************ */
-static zend_bool early_find_sid_in(zval *dest, int where, php_session_rfc1867_progress *progress) /* {{{ */
+static bool early_find_sid_in(zval *dest, int where, php_session_rfc1867_progress *progress) /* {{{ */
{
zval *ppid;
early_find_sid_in(&progress->sid, TRACK_VARS_GET, progress);
} /* }}} */
-static zend_bool php_check_cancel_upload(php_session_rfc1867_progress *progress) /* {{{ */
+static bool php_check_cancel_upload(php_session_rfc1867_progress *progress) /* {{{ */
{
zval *progress_ary, *cancel_upload;
/* }}} */
/* {{{ sxe_prop_dim_read() */
-static zval *sxe_prop_dim_read(zend_object *object, zval *member, zend_bool elements, zend_bool attribs, int type, zval *rv)
+static zval *sxe_prop_dim_read(zend_object *object, zval *member, bool elements, bool attribs, int type, zval *rv)
{
php_sxe_object *sxe;
char *name;
/* }}} */
/* {{{ sxe_property_write() */
-static zval *sxe_prop_dim_write(zend_object *object, zval *member, zval *value, zend_bool elements, zend_bool attribs, xmlNodePtr *pnewnode)
+static zval *sxe_prop_dim_write(zend_object *object, zval *member, zval *value, bool elements, bool attribs, xmlNodePtr *pnewnode)
{
php_sxe_object *sxe;
xmlNodePtr node;
/* }}} */
/* {{{ sxe_prop_dim_exists() */
-static int sxe_prop_dim_exists(zend_object *object, zval *member, int check_empty, zend_bool elements, zend_bool attribs)
+static int sxe_prop_dim_exists(zend_object *object, zval *member, int check_empty, bool elements, bool attribs)
{
php_sxe_object *sxe;
xmlNodePtr node;
/* }}} */
/* {{{ sxe_prop_dim_delete() */
-static void sxe_prop_dim_delete(zend_object *object, zval *member, zend_bool elements, zend_bool attribs)
+static void sxe_prop_dim_delete(zend_object *object, zval *member, bool elements, bool attribs)
{
php_sxe_object *sxe;
xmlNodePtr node;
}
/* }}} */
-static void sxe_add_namespaces(php_sxe_object *sxe, xmlNodePtr node, zend_bool recursive, zval *return_value) /* {{{ */
+static void sxe_add_namespaces(php_sxe_object *sxe, xmlNodePtr node, bool recursive, zval *return_value) /* {{{ */
{
xmlAttrPtr attr;
/* {{{ Return all namespaces in use */
SXE_METHOD(getNamespaces)
{
- zend_bool recursive = 0;
+ bool recursive = 0;
php_sxe_object *sxe;
xmlNodePtr node;
}
/* }}} */
-static void sxe_add_registered_namespaces(php_sxe_object *sxe, xmlNodePtr node, zend_bool recursive, zval *return_value) /* {{{ */
+static void sxe_add_registered_namespaces(php_sxe_object *sxe, xmlNodePtr node, bool recursive, zval *return_value) /* {{{ */
{
xmlNsPtr ns;
/* {{{ Return all namespaces registered with document */
SXE_METHOD(getDocNamespaces)
{
- zend_bool recursive = 0, from_root = 1;
+ bool recursive = 0, from_root = 1;
php_sxe_object *sxe;
xmlNodePtr node;
char *nsprefix = NULL;
size_t nsprefix_len = 0;
xmlNodePtr node;
- zend_bool isprefix = 0;
+ bool isprefix = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!b", &nsprefix, &nsprefix_len, &isprefix) == FAILURE) {
RETURN_THROWS();
char *nsprefix = NULL;
size_t nsprefix_len = 0;
xmlNodePtr node;
- zend_bool isprefix = 0;
+ bool isprefix = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!b", &nsprefix, &nsprefix_len, &isprefix) == FAILURE) {
RETURN_THROWS();
php_sxe_object *clone;
xmlNodePtr nodep = NULL;
xmlDocPtr docp = NULL;
- zend_bool is_root_element = sxe->node && sxe->node->node && sxe->node->node->parent
+ bool is_root_element = sxe->node && sxe->node->node && sxe->node->node->parent
&& (sxe->node->node->parent->type == XML_DOCUMENT_NODE || sxe->node->node->parent->type == XML_HTML_DOCUMENT_NODE);
clone = php_sxe_object_new(sxe->zo.ce, sxe->fptr_count);
zend_long options = 0;
zend_class_entry *ce= sxe_class_entry;
zend_function *fptr_count;
- zend_bool isprefix = 0;
+ bool isprefix = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|C!lsb", &filename, &filename_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
RETURN_THROWS();
zend_long options = 0;
zend_class_entry *ce= sxe_class_entry;
zend_function *fptr_count;
- zend_bool isprefix = 0;
+ bool isprefix = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|C!lsb", &data, &data_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
RETURN_THROWS();
size_t data_len, ns_len = 0;
xmlDocPtr docp;
zend_long options = 0;
- zend_bool is_url = 0, isprefix = 0;
+ bool is_url = 0, isprefix = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lbsb", &data, &data_len, &options, &is_url, &ns, &ns_len, &isprefix) == FAILURE) {
RETURN_THROWS();
HashTable *oid_ht, *type_ht = NULL, *value_ht = NULL;
char *a1 = NULL, *a2 = NULL, *a3 = NULL, *a4 = NULL, *a5 = NULL, *a6 = NULL, *a7 = NULL;
size_t a1_len, a2_len, a3_len, a4_len, a5_len, a6_len, a7_len;
- zend_bool use_orignames = 0, suffix_keys = 0;
+ bool use_orignames = 0, suffix_keys = 0;
zend_long timeout = SNMP_DEFAULT_TIMEOUT;
zend_long retries = SNMP_DEFAULT_RETRIES;
struct objid_query objid_query;
/* {{{ Return all objects including their respective object id within the specified one */
PHP_FUNCTION(snmp_set_quick_print)
{
- zend_bool a1;
+ bool a1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &a1) == FAILURE) {
RETURN_THROWS();
/* {{{ Return all values that are enums with their enum value instead of the raw integer */
PHP_FUNCTION(snmp_set_enum_print)
{
- zend_bool a1;
+ bool a1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &a1) == FAILURE) {
RETURN_THROWS();
return NULL;
}
-static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node) {
+static bool soap_check_zval_ref(zval *data, xmlNodePtr node) {
xmlNodePtr node_ptr;
if (SOAP_GLOBAL(ref_map)) {
return 0;
}
-static zend_bool soap_check_xml_ref(zval *data, xmlNodePtr node)
+static bool soap_check_xml_ref(zval *data, xmlNodePtr node)
{
zval *data_ptr;
/* Additional HTTP headers */
void http_context_headers(php_stream_context* context,
- zend_bool has_authorization,
- zend_bool has_proxy_authorization,
- zend_bool has_cookies,
+ bool has_authorization,
+ bool has_proxy_authorization,
+ bool has_cookies,
smart_str* soap_headers)
{
zval *tmp;
zend_long redirect_max = 20;
char *content_encoding;
char *http_msg = NULL;
- zend_bool old_allow_url_fopen;
+ bool old_allow_url_fopen;
php_stream_context *context = NULL;
- zend_bool has_authorization = 0;
- zend_bool has_proxy_authorization = 0;
- zend_bool has_cookies = 0;
+ bool has_authorization = 0;
+ bool has_proxy_authorization = 0;
+ bool has_cookies = 0;
if (this_ptr == NULL || Z_TYPE_P(this_ptr) != IS_OBJECT) {
return FALSE;
int proxy_authentication(zval* this_ptr, smart_str* soap_headers);
int basic_authentication(zval* this_ptr, smart_str* soap_headers);
void http_context_headers(php_stream_context* context,
- zend_bool has_authorization,
- zend_bool has_proxy_authorization,
- zend_bool has_cookies,
+ bool has_authorization,
+ bool has_proxy_authorization,
+ bool has_cookies,
smart_str* soap_headers);
#endif
smart_str headers = {0};
char* key = NULL;
time_t t = time(0);
- zend_bool has_proxy_authorization = 0;
- zend_bool has_authorization = 0;
+ bool has_proxy_authorization = 0;
+ bool has_authorization = 0;
ZVAL_UNDEF(&orig_context);
ZVAL_UNDEF(&new_context);
HashTable *groups; /* array of sdlTypesPtr */
char *target_ns;
char *source;
- zend_bool is_persistent;
+ bool is_persistent;
};
typedef struct sdlCtx {
int cur_uniq_ns;
int soap_version;
sdlPtr sdl;
- zend_bool use_soap_error_handler;
+ bool use_soap_error_handler;
char* error_code;
zval error_object;
char cache;
{
xmlParserCtxtPtr ctxt = NULL;
xmlDocPtr ret;
- zend_bool old_allow_url_fopen;
+ bool old_allow_url_fopen;
/*
xmlInitParser();
ctxt = xmlCreateFileParserCtxt(filename);
PG(allow_url_fopen) = old_allow_url_fopen;
if (ctxt) {
- zend_bool old;
+ bool old;
ctxt->keepBlanks = 0;
ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace;
*/
ctxt = xmlCreateMemoryParserCtxt(buf, buf_size);
if (ctxt) {
- zend_bool old;
+ bool old;
ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace;
ctxt->sax->comment = soap_Comment;
static void soap_error_handler(int error_num, const char *error_filename, const uint32_t error_lineno, zend_string *message);
#define SOAP_SERVER_BEGIN_CODE() \
- zend_bool _old_handler = SOAP_GLOBAL(use_soap_error_handler);\
+ bool _old_handler = SOAP_GLOBAL(use_soap_error_handler);\
char* _old_error_code = SOAP_GLOBAL(error_code);\
zend_object* _old_error_object = Z_OBJ(SOAP_GLOBAL(error_object));\
int _old_soap_version = SOAP_GLOBAL(soap_version);\
SOAP_GLOBAL(soap_version) = _old_soap_version;
#define SOAP_CLIENT_BEGIN_CODE() \
- zend_bool _old_handler = SOAP_GLOBAL(use_soap_error_handler);\
+ bool _old_handler = SOAP_GLOBAL(use_soap_error_handler);\
char* _old_error_code = SOAP_GLOBAL(error_code);\
zend_object* _old_error_object = Z_OBJ(SOAP_GLOBAL(error_object));\
int _old_soap_version = SOAP_GLOBAL(soap_version);\
- zend_bool _old_in_compilation = CG(in_compilation); \
+ bool _old_in_compilation = CG(in_compilation); \
zend_execute_data *_old_current_execute_data = EG(current_execute_data); \
zval *_old_stack_top = EG(vm_stack_top); \
int _bailout = 0;\
zval *data = NULL;
zend_string *actor_str = NULL;
zend_long actor_long;
- zend_bool actor_is_null = 1;
+ bool actor_is_null = 1;
char *name, *ns;
size_t name_len, ns_len;
- zend_bool must_understand = 0;
+ bool must_understand = 0;
zval *this_ptr;
ZEND_PARSE_PARAMETERS_START(2, 5)
{
zval *data, *this_ptr;
zend_long type;
- zend_bool type_is_null = 1;
+ bool type_is_null = 1;
char *stype = NULL, *ns = NULL, *name = NULL, *namens = NULL;
size_t stype_len = 0, ns_len = 0, name_len = 0, namens_len = 0;
static zend_never_inline ZEND_COLD void soap_real_error_handler(int error_num, const char *error_filename, const uint32_t error_lineno, zend_string *message) /* {{{ */
{
- zend_bool _old_in_compilation;
+ bool _old_in_compilation;
zend_execute_data *_old_current_execute_data;
int _old_http_response_code;
char *_old_http_status_line;
/* {{{ */
PHP_FUNCTION(use_soap_error_handler)
{
- zend_bool handler = 1;
+ bool handler = 1;
ZVAL_BOOL(return_value, SOAP_GLOBAL(use_soap_error_handler));
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &handler) == SUCCESS) {
}
/* }}} */
-static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *action, int version, zend_bool one_way, zval *response) /* {{{ */
+static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *action, int version, bool one_way, zval *response) /* {{{ */
{
int ret = TRUE;
char *buf;
fn = get_function(sdl, function);
if (fn != NULL) {
sdlBindingPtr binding = fn->binding;
- zend_bool one_way = 0;
+ bool one_way = 0;
if (fn->responseName == NULL &&
fn->responseParameters == NULL &&
/* }}} */
/* {{{ Calls a SOAP function */
-void soap_client_call_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_soap_call)
+void soap_client_call_impl(INTERNAL_FUNCTION_PARAMETERS, bool is_soap_call)
{
char *function, *location=NULL, *soap_action = NULL, *uri = NULL;
size_t function_len;
zval *param;
int arg_count;
zval *tmp;
- zend_bool free_soap_headers = 0;
+ bool free_soap_headers = 0;
zval *this_ptr;
if (is_soap_call) {
char *location, *action;
size_t location_size, action_size;
zend_long version;
- zend_bool one_way = 0;
+ bool one_way = 0;
zval *this_ptr = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sssl|b",
PHP_SOCKET max_fd = 0;
int retval, sets = 0;
zend_long sec, usec = 0;
- zend_bool sec_is_null = 0;
+ bool sec_is_null = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a!a!a!l!|l", &r_array, &w_array, &e_array, &sec, &sec_is_null, &usec) == FAILURE) {
RETURN_THROWS();
int retval;
size_t str_len;
zend_long length = 0;
- zend_bool length_is_null = 1;
+ bool length_is_null = 1;
char *str;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|l!", &arg1, socket_ce, &str, &str_len, &length, &length_is_null) == FAILURE) {
int retval;
size_t addr_len;
zend_long port;
- zend_bool port_is_null = 1;
+ bool port_is_null = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|l!", &resource_socket, socket_ce, &addr, &addr_len, &port, &port_is_null) == FAILURE) {
RETURN_THROWS();
int retval;
size_t buf_len, addr_len;
zend_long len, flags, port;
- zend_bool port_is_null = 1;
+ bool port_is_null = 1;
char *buf, *addr;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Oslls|l!", &arg1, socket_ce, &buf, &buf_len, &len, &flags, &addr, &addr_len, &port, &port_is_null) == FAILURE) {
return ret;
}
-static zend_bool php_sodium_argon2_verify(const zend_string *password, const zend_string *hash) {
+static bool php_sodium_argon2_verify(const zend_string *password, const zend_string *hash) {
if ((ZSTR_LEN(password) >= 0xffffffff) || (ZSTR_LEN(hash) >= 0xffffffff)) {
return 0;
}
return crypto_pwhash_str_verify(ZSTR_VAL(hash), ZSTR_VAL(password), ZSTR_LEN(password)) == 0;
}
-static zend_bool php_sodium_argon2_needs_rehash(const zend_string *hash, zend_array *options) {
+static bool php_sodium_argon2_needs_rehash(const zend_string *hash, zend_array *options) {
size_t opslimit, memlimit;
if (get_options(options, &memlimit, &opslimit) == FAILURE) {
}
/* }}} */
-static zend_class_entry * spl_find_ce_by_name(zend_string *name, zend_bool autoload)
+static zend_class_entry * spl_find_ce_by_name(zend_string *name, bool autoload)
{
zend_class_entry *ce;
{
zval *obj;
zend_class_entry *parent_class, *ce;
- zend_bool autoload = 1;
+ bool autoload = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &obj, &autoload) == FAILURE) {
RETURN_THROWS();
PHP_FUNCTION(class_implements)
{
zval *obj;
- zend_bool autoload = 1;
+ bool autoload = 1;
zend_class_entry *ce;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &obj, &autoload) == FAILURE) {
PHP_FUNCTION(class_uses)
{
zval *obj;
- zend_bool autoload = 1;
+ bool autoload = 1;
zend_class_entry *ce;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &obj, &autoload) == FAILURE) {
return alfi;
}
-static zend_bool autoload_func_info_equals(
+static bool autoload_func_info_equals(
const autoload_func_info *alfi1, const autoload_func_info *alfi2) {
return alfi1->func_ptr == alfi2->func_ptr
&& alfi1->obj == alfi2->obj
/* {{{ Register given function as autoloader */
PHP_FUNCTION(spl_autoload_register)
{
- zend_bool do_throw = 1;
- zend_bool prepend = 0;
+ bool do_throw = 1;
+ bool prepend = 0;
zend_fcall_info fci = {0};
zend_fcall_info_cache fcc;
autoload_func_info *alfi;
}
/* }}} */
-static inline zend_bool spl_array_is_object(spl_array_object *intern) /* {{{ */
+static inline bool spl_array_is_object(spl_array_object *intern) /* {{{ */
{
while (intern->ar_flags & SPL_ARRAY_USE_OTHER) {
intern = Z_SPLARRAY_P(&intern->array);
}
{
- zend_bool result = check_empty ? zend_is_true(value) : Z_TYPE_P(value) != IS_NULL;
+ bool result = check_empty ? zend_is_true(value) : Z_TYPE_P(value) != IS_NULL;
if (value == &rv) {
zval_ptr_dtor(&rv);
}
{
spl_array_object *intern = spl_array_from_obj(object);
HashTable *ht;
- zend_bool dup;
+ bool dup;
if (intern->ar_flags & SPL_ARRAY_STD_PROP_LIST) {
return zend_std_get_properties_for(object, purpose);
static spl_filesystem_object *spl_filesystem_object_create_type(int num_args, spl_filesystem_object *source, int type, zend_class_entry *ce, zval *return_value) /* {{{ */
{
spl_filesystem_object *intern;
- zend_bool use_include_path = 0;
+ bool use_include_path = 0;
zval arg1, arg2;
zend_error_handling error_handling;
/* {{{ Returns whether current entry is a directory and not '.' or '..' */
PHP_METHOD(RecursiveDirectoryIterator, hasChildren)
{
- zend_bool allow_links = 0;
+ bool allow_links = 0;
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &allow_links) == FAILURE) {
PHP_METHOD(SplFileObject, __construct)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
- zend_bool use_include_path = 0;
+ bool use_include_path = 0;
char *p1, *p2;
char *tmp_path;
size_t tmp_path_len;
PHP_METHOD(SplDoublyLinkedList, offsetSet)
{
zend_long index;
- zend_bool index_is_null = 1;
+ bool index_is_null = 1;
zval *value;
spl_dllist_object *intern;
if (UNEXPECTED(intern->methods && intern->methods->fptr_offset_has)) {
zval rv;
- zend_bool result;
+ bool result;
zend_call_method_with_1_params(object, intern->std.ce, &intern->methods->fptr_offset_has, "offsetExists", &rv, offset);
result = zend_is_true(&rv);
spl_fixedarray array;
spl_fixedarray_object *intern;
int num;
- zend_bool save_indexes = 1;
+ bool save_indexes = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|b", &data, &save_indexes) == FAILURE) {
RETURN_THROWS();
RecursiveIteratorMode mode;
int flags;
int max_depth;
- zend_bool in_iteration;
+ bool in_iteration;
zend_function *beginIteration;
zend_function *endIteration;
zend_function *callHasChildren;
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
zend_long level;
- zend_bool level_is_null = 1;
+ bool level_is_null = 1;
zval *value;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &level, &level_is_null) == FAILURE) {
PHP_FUNCTION(iterator_to_array)
{
zval *obj;
- zend_bool use_keys = 1;
+ bool use_keys = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &obj, zend_ce_traversable, &use_keys) == FAILURE) {
RETURN_THROWS();
zval zinfo;
zend_string *info_str;
zend_long info_long;
- zend_bool info_is_null = 1;
+ bool info_is_null = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_OBJ_OF_CLASS(iterator, zend_ce_iterator)
zend_fcall_info authorizer_fci;
zend_fcall_info_cache authorizer_fcc;
- zend_bool exception;
+ bool exception;
zend_llist free_list;
zend_object zo;
{
php_sqlite3_db_object *db_obj;
zval *object = ZEND_THIS;
- zend_bool enable = 1;
+ bool enable = 1;
db_obj = Z_SQLITE3_DB_P(object);
int ret;
zend_string *sql;
char *errtext = NULL;
int return_code;
- zend_bool entire_row = 0;
+ bool entire_row = 0;
sqlite3_stmt *stmt;
db_obj = Z_SQLITE3_DB_P(object);
{
php_sqlite3_db_object *db_obj;
zval *object = ZEND_THIS;
- zend_bool enableExceptions = 0;
+ bool enableExceptions = 0;
db_obj = Z_SQLITE3_DB_P(object);
PHP_METHOD(SQLite3Stmt, getSQL)
{
php_sqlite3_stmt *stmt_obj;
- zend_bool expanded = 0;
+ bool expanded = 0;
zval *object = getThis();
stmt_obj = Z_SQLITE3_STMT_P(object);
int bind_rc;
{
zval args[2];
zval retval;
- zend_bool call_failed;
+ bool call_failed;
ZVAL_COPY(&args[0], &f->val);
ZVAL_COPY(&args[1], &s->val);
BG(user_compare_fci) = old_user_compare_fci; \
BG(user_compare_fci_cache) = old_user_compare_fci_cache; \
-static void php_usort(INTERNAL_FUNCTION_PARAMETERS, bucket_compare_func_t compare_func, zend_bool renumber) /* {{{ */
+static void php_usort(INTERNAL_FUNCTION_PARAMETERS, bucket_compare_func_t compare_func, bool renumber) /* {{{ */
{
zval *array;
zend_array *arr;
{
zval args[2];
zval retval;
- zend_bool call_failed;
+ bool call_failed;
if (f->key == NULL) {
ZVAL_LONG(&args[0], f->h);
*entry; /* pointer to array entry */
zend_ulong num_idx;
zend_string *str_idx;
- zend_bool strict = 0; /* strict comparison or not */
+ bool strict = 0; /* strict comparison or not */
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_ZVAL(value)
}
/* }}} */
-PHPAPI int php_prefix_varname(zval *result, zend_string *prefix, const char *var_name, size_t var_name_len, zend_bool add_underscore) /* {{{ */
+PHPAPI int php_prefix_varname(zval *result, zend_string *prefix, const char *var_name, size_t var_name_len, bool add_underscore) /* {{{ */
{
ZVAL_NEW_STR(result, zend_string_alloc(ZSTR_LEN(prefix) + (add_underscore ? 1 : 0) + var_name_len, 0));
memcpy(Z_STRVAL_P(result), ZSTR_VAL(prefix), ZSTR_LEN(prefix));
HashTable *rem_hash = NULL;
zend_long offset,
length = 0;
- zend_bool length_is_null = 1;
+ bool length_is_null = 1;
int num_in; /* Number of elements in the input array */
ZEND_PARSE_PARAMETERS_START(2, 4)
zval *entry; /* An array entry */
zend_long offset; /* Offset to get elements from */
zend_long length = 0; /* How many elements to get */
- zend_bool length_is_null = 1; /* Whether an explicit length has been omitted */
- zend_bool preserve_keys = 0; /* Whether to preserve keys while copying to the new array */
+ bool length_is_null = 1; /* Whether an explicit length has been omitted */
+ bool preserve_keys = 0; /* Whether to preserve keys while copying to the new array */
uint32_t num_in; /* Number of elements in the input array */
zend_string *string_key;
zend_ulong num_key;
return;
}
} else {
- zend_bool copy = 1;
+ bool copy = 1;
zend_string *string_key;
ZEND_HASH_FOREACH_STR_KEY(Z_ARRVAL_P(ret), string_key) {
*search_value = NULL, /* Value to search for */
*entry, /* An entry in the input array */
new_val; /* New value */
- zend_bool strict = 0; /* do strict comparison */
+ bool strict = 0; /* do strict comparison */
zend_ulong num_idx;
zend_string *str_idx;
zend_array *arrval;
zval *colval, *data, rv;
zend_string *column_str = NULL;
zend_long column_long;
- zend_bool column_is_null = 0;
+ bool column_is_null = 0;
zend_string *index_str = NULL;
zend_long index_long;
- zend_bool index_is_null = 1;
+ bool index_is_null = 1;
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_ARRAY_HT(input)
*entry; /* An entry in the input array */
zend_string *string_key;
zend_ulong num_key;
- zend_bool preserve_keys = 0; /* whether to preserve keys */
+ bool preserve_keys = 0; /* whether to preserve keys */
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_ARRAY(input)
int argc, i;
zval *args;
int (*intersect_data_compare_func)(zval *, zval *) = NULL;
- zend_bool ok;
+ bool ok;
zval *val, *data;
char *param_spec;
zend_string *key;
int argc, i;
zval *args;
int (*diff_data_compare_func)(zval *, zval *) = NULL;
- zend_bool ok;
+ bool ok;
zval *val, *data;
zend_string *key;
zend_ulong h;
zval *key;
zval args[2];
zval retval;
- zend_bool have_callback = 0;
+ bool have_callback = 0;
zend_long use_type = 0;
zend_string *string_key;
zend_fcall_info fci = empty_fcall_info;
zend_long size, current = 0;
zend_string *str_key;
zend_ulong num_key;
- zend_bool preserve_keys = 0;
+ bool preserve_keys = 0;
zval *input = NULL;
zval chunk;
zval *entry;
ZEND_BEGIN_MODULE_GLOBALS(assert)
zval callback;
char *cb;
- zend_bool active;
- zend_bool bail;
- zend_bool warning;
- zend_bool exception;
+ bool active;
+ bool bail;
+ bool warning;
+ bool exception;
ZEND_END_MODULE_GLOBALS(assert)
ZEND_DECLARE_MODULE_GLOBALS(assert)
{
zval *value = NULL;
zend_long what;
- zend_bool oldint;
+ bool oldint;
int ac = ZEND_NUM_ARGS();
zend_string *key;
}
#endif /* __aarch64__ */
-static zend_always_inline int php_base64_decode_impl(const unsigned char *in, size_t inl, unsigned char *out, size_t *outl, zend_bool strict) /* {{{ */
+static zend_always_inline int php_base64_decode_impl(const unsigned char *in, size_t inl, unsigned char *out, size_t *outl, bool strict) /* {{{ */
{
int ch;
size_t i = 0, padding = 0, j = *outl;
# if ZEND_INTRIN_AVX2_RESOLVER
ZEND_INTRIN_AVX2_FUNC_DECL(zend_string *php_base64_encode_avx2(const unsigned char *str, size_t length));
-ZEND_INTRIN_AVX2_FUNC_DECL(zend_string *php_base64_decode_ex_avx2(const unsigned char *str, size_t length, zend_bool strict));
+ZEND_INTRIN_AVX2_FUNC_DECL(zend_string *php_base64_decode_ex_avx2(const unsigned char *str, size_t length, bool strict));
# endif
# if ZEND_INTRIN_SSSE3_RESOLVER
ZEND_INTRIN_SSSE3_FUNC_DECL(zend_string *php_base64_encode_ssse3(const unsigned char *str, size_t length));
-ZEND_INTRIN_SSSE3_FUNC_DECL(zend_string *php_base64_decode_ex_ssse3(const unsigned char *str, size_t length, zend_bool strict));
+ZEND_INTRIN_SSSE3_FUNC_DECL(zend_string *php_base64_decode_ex_ssse3(const unsigned char *str, size_t length, bool strict));
# endif
zend_string *php_base64_encode_default(const unsigned char *str, size_t length);
-zend_string *php_base64_decode_ex_default(const unsigned char *str, size_t length, zend_bool strict);
+zend_string *php_base64_decode_ex_default(const unsigned char *str, size_t length, bool strict);
# if (ZEND_INTRIN_AVX2_FUNC_PROTO || ZEND_INTRIN_SSSE3_FUNC_PROTO)
PHPAPI zend_string *php_base64_encode(const unsigned char *str, size_t length) __attribute__((ifunc("resolve_base64_encode")));
-PHPAPI zend_string *php_base64_decode_ex(const unsigned char *str, size_t length, zend_bool strict) __attribute__((ifunc("resolve_base64_decode")));
+PHPAPI zend_string *php_base64_decode_ex(const unsigned char *str, size_t length, bool strict) __attribute__((ifunc("resolve_base64_decode")));
typedef zend_string *(*base64_encode_func_t)(const unsigned char *, size_t);
-typedef zend_string *(*base64_decode_func_t)(const unsigned char *, size_t, zend_bool);
+typedef zend_string *(*base64_decode_func_t)(const unsigned char *, size_t, bool);
ZEND_NO_SANITIZE_ADDRESS
ZEND_ATTRIBUTE_UNUSED /* clang mistakenly warns about this */
# else /* (ZEND_INTRIN_AVX2_FUNC_PROTO || ZEND_INTRIN_SSSE3_FUNC_PROTO) */
PHPAPI zend_string *(*php_base64_encode_ptr)(const unsigned char *str, size_t length) = NULL;
-PHPAPI zend_string *(*php_base64_decode_ex_ptr)(const unsigned char *str, size_t length, zend_bool strict) = NULL;
+PHPAPI zend_string *(*php_base64_decode_ex_ptr)(const unsigned char *str, size_t length, bool strict) = NULL;
PHPAPI zend_string *php_base64_encode(const unsigned char *str, size_t length) {
return php_base64_encode_ptr(str, length);
}
-PHPAPI zend_string *php_base64_decode_ex(const unsigned char *str, size_t length, zend_bool strict) {
+PHPAPI zend_string *php_base64_decode_ex(const unsigned char *str, size_t length, bool strict) {
return php_base64_decode_ex_ptr(str, length, strict);
}
#if ZEND_INTRIN_AVX2_NATIVE || ZEND_INTRIN_AVX2_RESOLVER || ZEND_INTRIN_SSSE3_NATIVE || ZEND_INTRIN_SSSE3_RESOLVER
# if ZEND_INTRIN_AVX2_NATIVE || ZEND_INTRIN_SSSE3_NATIVE
-PHPAPI zend_string *php_base64_decode_ex(const unsigned char *str, size_t length, zend_bool strict)
+PHPAPI zend_string *php_base64_decode_ex(const unsigned char *str, size_t length, bool strict)
# elif ZEND_INTRIN_AVX2_RESOLVER
-zend_string *php_base64_decode_ex_avx2(const unsigned char *str, size_t length, zend_bool strict)
+zend_string *php_base64_decode_ex_avx2(const unsigned char *str, size_t length, bool strict)
# else
-zend_string *php_base64_decode_ex_ssse3(const unsigned char *str, size_t length, zend_bool strict)
+zend_string *php_base64_decode_ex_ssse3(const unsigned char *str, size_t length, bool strict)
# endif
{
const unsigned char *c = str;
}
# if ZEND_INTRIN_SSSE3_RESOLVER && ZEND_INTRIN_AVX2_RESOLVER
-zend_string *php_base64_decode_ex_ssse3(const unsigned char *str, size_t length, zend_bool strict)
+zend_string *php_base64_decode_ex_ssse3(const unsigned char *str, size_t length, bool strict)
{
const unsigned char *c = str;
unsigned char *o;
#if !ZEND_INTRIN_AVX2_NATIVE && !ZEND_INTRIN_SSSE3_NATIVE
#if ZEND_INTRIN_AVX2_RESOLVER || ZEND_INTRIN_SSSE3_RESOLVER
-zend_string *php_base64_decode_ex_default(const unsigned char *str, size_t length, zend_bool strict)
+zend_string *php_base64_decode_ex_default(const unsigned char *str, size_t length, bool strict)
#else
-PHPAPI zend_string *php_base64_decode_ex(const unsigned char *str, size_t length, zend_bool strict)
+PHPAPI zend_string *php_base64_decode_ex(const unsigned char *str, size_t length, bool strict)
#endif
{
zend_string *result;
PHP_FUNCTION(base64_decode)
{
char *str;
- zend_bool strict = 0;
+ bool strict = 0;
size_t str_len;
zend_string *result;
#endif
PHPAPI extern zend_string *php_base64_encode(const unsigned char *, size_t);
-PHPAPI extern zend_string *php_base64_decode_ex(const unsigned char *, size_t, zend_bool);
+PHPAPI extern zend_string *php_base64_decode_ex(const unsigned char *, size_t, bool);
static inline zend_string *php_base64_encode_str(const zend_string *str) {
return php_base64_encode((const unsigned char*)(ZSTR_VAL(str)), ZSTR_LEN(str));
{
char *str = NULL;
size_t str_len;
- zend_bool local_only = 0;
+ bool local_only = 0;
ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
}
/* }}} */
-PHPAPI zend_bool register_user_shutdown_function(const char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry) /* {{{ */
+PHPAPI bool register_user_shutdown_function(const char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry) /* {{{ */
{
if (!BG(user_shutdown_function_names)) {
ALLOC_HASHTABLE(BG(user_shutdown_function_names));
}
/* }}} */
-PHPAPI zend_bool remove_user_shutdown_function(const char *function_name, size_t function_len) /* {{{ */
+PHPAPI bool remove_user_shutdown_function(const char *function_name, size_t function_len) /* {{{ */
{
if (BG(user_shutdown_function_names)) {
return zend_hash_str_del(BG(user_shutdown_function_names), function_name, function_len) != FAILURE;
}
/* }}} */
-PHPAPI zend_bool append_user_shutdown_function(php_shutdown_function_entry *shutdown_function_entry) /* {{{ */
+PHPAPI bool append_user_shutdown_function(php_shutdown_function_entry *shutdown_function_entry) /* {{{ */
{
if (!BG(user_shutdown_function_names)) {
ALLOC_HASHTABLE(BG(user_shutdown_function_names));
size_t filename_len;
int ret;
zend_syntax_highlighter_ini syntax_highlighter_ini;
- zend_bool i = 0;
+ bool i = 0;
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_PATH(filename, filename_len)
zend_string *str;
zend_syntax_highlighter_ini syntax_highlighter_ini;
char *hicompiled_string_description;
- zend_bool i = 0;
+ bool i = 0;
int old_error_reporting = EG(error_reporting);
ZEND_PARSE_PARAMETERS_START(1, 2)
char *extname = NULL;
size_t extname_len = 0, module_number = 0;
zend_module_entry *module;
- zend_bool details = 1;
+ bool details = 1;
zend_string *key;
zend_ini_entry *ini_entry;
PHP_FUNCTION(print_r)
{
zval *var;
- zend_bool do_return = 0;
+ bool do_return = 0;
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_ZVAL(var)
/* {{{ Set whether we want to ignore a user abort event or not */
PHP_FUNCTION(ignore_user_abort)
{
- zend_bool arg = 0;
- zend_bool arg_is_null = 1;
+ bool arg = 0;
+ bool arg_is_null = 1;
int old_setting;
ZEND_PARSE_PARAMETERS_START(0, 1)
{
char *path, *new_path;
size_t path_len, new_path_len;
- zend_bool successful = 0;
+ bool successful = 0;
#ifndef PHP_WIN32
int oldmask; int ret;
{
char *filename = NULL;
size_t filename_len = 0;
- zend_bool process_sections = 0;
+ bool process_sections = 0;
zend_long scanner_mode = ZEND_INI_SCANNER_NORMAL;
zend_file_handle fh;
zend_ini_parser_cb_t ini_parser_cb;
{
char *string = NULL, *str = NULL;
size_t str_len = 0;
- zend_bool process_sections = 0;
+ bool process_sections = 0;
zend_long scanner_mode = ZEND_INI_SCANNER_NORMAL;
zend_ini_parser_cb_t ini_parser_cb;
/* Left for BC (not binary safe!) */
PHPAPI int _php_error_log(int opt_err, const char *message, const char *opt, const char *headers);
PHPAPI int _php_error_log_ex(int opt_err, const char *message, size_t message_len, const char *opt, const char *headers);
-PHPAPI int php_prefix_varname(zval *result, zend_string *prefix, const char *var_name, size_t var_name_len, zend_bool add_underscore);
+PHPAPI int php_prefix_varname(zval *result, zend_string *prefix, const char *var_name, size_t var_name_len, bool add_underscore);
#define MT_N (624)
HashTable putenv_ht;
zend_string *strtok_string;
zend_string *ctype_string; /* current LC_CTYPE locale (or NULL for 'C') */
- zend_bool locale_changed; /* locale was changed and has to be restored */
+ bool locale_changed; /* locale was changed and has to be restored */
char *strtok_last;
char strtok_table[256];
size_t strtok_len;
uint32_t *next; /* next random value is computed from here */
int left; /* can *next++ this many times before reloading */
- zend_bool mt_rand_is_seeded; /* Whether mt_rand() has been seeded */
+ bool mt_rand_is_seeded; /* Whether mt_rand() has been seeded */
zend_long mt_rand_mode;
/* syslog.c */
int arg_count;
} php_shutdown_function_entry;
-PHPAPI extern zend_bool register_user_shutdown_function(const char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry);
-PHPAPI extern zend_bool remove_user_shutdown_function(const char *function_name, size_t function_len);
-PHPAPI extern zend_bool append_user_shutdown_function(php_shutdown_function_entry *shutdown_function_entry);
+PHPAPI extern bool register_user_shutdown_function(const char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry);
+PHPAPI extern bool remove_user_shutdown_function(const char *function_name, size_t function_len);
+PHPAPI extern bool append_user_shutdown_function(php_shutdown_function_entry *shutdown_function_entry);
PHPAPI void php_call_shutdown_functions(void);
PHPAPI void php_free_shutdown_functions(void);
pefree(entry, 1);
}
-static inline zend_bool is_placeholder(char c) {
+static inline bool is_placeholder(char c) {
return c == '?' || c == '*';
}
} browscap_parser_ctx;
static zend_string *browscap_intern_str(
- browscap_parser_ctx *ctx, zend_string *str, zend_bool persistent) {
+ browscap_parser_ctx *ctx, zend_string *str, bool persistent) {
zend_string *interned = zend_hash_find_ptr(&ctx->str_interned, str);
if (interned) {
zend_string_addref(interned);
}
static zend_string *browscap_intern_str_ci(
- browscap_parser_ctx *ctx, zend_string *str, zend_bool persistent) {
+ browscap_parser_ctx *ctx, zend_string *str, bool persistent) {
zend_string *lcname;
zend_string *interned;
ALLOCA_FLAG(use_heap);
}
static void browscap_add_kv(
- browser_data *bdata, zend_string *key, zend_string *value, zend_bool persistent) {
+ browser_data *bdata, zend_string *key, zend_string *value, bool persistent) {
if (bdata->kv_used == bdata->kv_size) {
bdata->kv_size *= 2;
bdata->kv = safe_perealloc(bdata->kv, sizeof(browscap_kv), bdata->kv_size, 0, persistent);
PHP_FUNCTION(get_browser)
{
zend_string *agent_name = NULL, *lookup_browser_name;
- zend_bool return_array = 0;
+ bool return_array = 0;
browser_data *bdata;
browscap_entry *found_entry = NULL;
HashTable *agent_ht;
}
/* }}} */
-PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const char *salt, int salt_len, zend_bool quiet)
+PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const char *salt, int salt_len, bool quiet)
{
char *crypt_res;
zend_string *result;
char *s_bytes;
/* Default number of rounds. */
size_t rounds = ROUNDS_DEFAULT;
- zend_bool rounds_custom = 0;
+ bool rounds_custom = 0;
/* Find beginning of salt string. The prefix should normally always
be present. Just in case it is not. */
char *s_bytes;
/* Default number of rounds. */
size_t rounds = ROUNDS_DEFAULT;
- zend_bool rounds_custom = 0;
+ bool rounds_custom = 0;
/* Find beginning of salt string. The prefix should normally always
be present. Just in case it is not. */
glob_t globbuf;
size_t n;
int ret;
- zend_bool basedir_limit = 0;
+ bool basedir_limit = 0;
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_PATH(pattern, pattern_len)
u_char *cp = NULL, *end = NULL;
int n, qd, an, ns = 0, ar = 0;
int type, first_query = 1, store_results = 1;
- zend_bool raw = 0;
+ bool raw = 0;
ZEND_PARSE_PARAMETERS_START(1, 5)
Z_PARAM_STRING(hostname, hostname_len)
zend_long type_param = PHP_DNS_ANY;
zval *authns = NULL, *addtl = NULL;
int type, type_to_fetch, first_query = 1, store_results = 1;
- zend_bool raw = 0;
+ bool raw = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz!z!b",
&hostname, &hostname_len, &type_param, &authns, &addtl, &raw) == FAILURE) {
{
char *filename;
size_t filename_len;
- zend_bool use_include_path = 0;
+ bool use_include_path = 0;
int in_tag = 0, done = 0;
int looking_for_val = 0, have_name = 0, have_content = 0;
int saw_name = 0, saw_content = 0;
{
char *filename;
size_t filename_len;
- zend_bool use_include_path = 0;
+ bool use_include_path = 0;
php_stream *stream;
zend_long offset = 0;
zend_long maxlen;
- zend_bool maxlen_is_null = 1;
+ bool maxlen_is_null = 1;
zval *zcontext = NULL;
php_stream_context *context = NULL;
zend_string *contents;
register int i = 0;
char eol_marker = '\n';
zend_long flags = 0;
- zend_bool use_include_path;
- zend_bool include_new_line;
- zend_bool skip_blank_lines;
+ bool use_include_path;
+ bool include_new_line;
+ bool skip_blank_lines;
php_stream *stream;
zval *zcontext = NULL;
php_stream_context *context = NULL;
{
char *filename, *mode;
size_t filename_len, mode_len;
- zend_bool use_include_path = 0;
+ bool use_include_path = 0;
zval *zcontext = NULL;
php_stream *stream;
php_stream_context *context = NULL;
{
zval *res;
zend_long len = 1024;
- zend_bool len_is_null = 1;
+ bool len_is_null = 1;
char *buf = NULL;
size_t line_len = 0;
zend_string *str;
ssize_t ret;
size_t num_bytes;
zend_long maxlen = 0;
- zend_bool maxlen_is_null = 1;
+ bool maxlen_is_null = 1;
php_stream *stream;
ZEND_PARSE_PARAMETERS_START(2, 3)
size_t dir_len;
zval *zcontext = NULL;
zend_long mode = 0777;
- zend_bool recursive = 0;
+ bool recursive = 0;
php_stream_context *context;
ZEND_PARSE_PARAMETERS_START(1, 4)
char *filename;
size_t filename_len;
size_t size = 0;
- zend_bool use_include_path = 0;
+ bool use_include_path = 0;
zval *zcontext = NULL;
php_stream *stream;
php_stream_context *context = NULL;
PHP_FUNCTION(umask)
{
zend_long mask = 0;
- zend_bool mask_is_null = 1;
+ bool mask_is_null = 1;
int oldumask;
ZEND_PARSE_PARAMETERS_START(0, 1)
{
zval *fd;
- zend_bool len_is_null = 1;
+ bool len_is_null = 1;
char *delimiter_str = NULL;
size_t delimiter_str_len = 0;
char *enclosure_str = NULL;
char *temp, *tptr, *bptr, *line_end, *limit;
size_t temp_len, line_end_len;
int inc_len;
- zend_bool first_field = 1;
+ bool first_field = 1;
ZEND_ASSERT((escape_char >= 0 && escape_char <= UCHAR_MAX) || escape_char == PHP_CSV_NO_ESCAPE);
typedef struct {
int pclose_ret;
size_t def_chunk_size;
- zend_bool auto_detect_line_endings;
+ bool auto_detect_line_endings;
zend_long default_socket_timeout;
char *user_agent; /* for the http wrapper */
char *from_address; /* for the ftp and http wrappers */
char *filename;
size_t filename_len;
zend_long filetime = 0, fileatime = 0;
- zend_bool filetime_is_null = 1, fileatime_is_null = 1;
+ bool filetime_is_null = 1, fileatime_is_null = 1;
int ret;
FILE *file;
struct utimbuf newtimebuf;
#endif
/* {{{ php_clear_stat_cache() */
-PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, size_t filename_len)
+PHPAPI void php_clear_stat_cache(bool clear_realpath_cache, const char *filename, size_t filename_len)
{
/* always clear CurrentStatFile and CurrentLStatFile even if filename is not NULL
* as it may contain outdated data (e.g. "nlink" for a directory when deleting a file
/* {{{ Clear file stat cache */
PHP_FUNCTION(clearstatcache)
{
- zend_bool clear_realpath_cache = 0;
+ bool clear_realpath_cache = 0;
char *filename = NULL;
size_t filename_len = 0;
zend_long port = -1;
zval *zerrno = NULL, *zerrstr = NULL;
double timeout;
- zend_bool timeout_is_null = 1;
+ bool timeout_is_null = 1;
#ifndef PHP_WIN32
time_t conv;
#else
php_stream *reuseid=NULL;
size_t file_size = 0;
zval *tmpzval;
- zend_bool allow_overwrite = 0;
+ bool allow_overwrite = 0;
int8_t read_write = 0;
char *transport;
int transport_len;
/* {{{ Sends a raw HTTP header */
PHP_FUNCTION(header)
{
- zend_bool rep = 1;
+ bool rep = 1;
sapi_header_line ctr = {0};
char *line;
size_t len;
}
static zend_result php_head_parse_cookie_options_array(HashTable *options, zend_long *expires, zend_string **path,
- zend_string **domain, zend_bool *secure, zend_bool *httponly, zend_string **samesite)
+ zend_string **domain, bool *secure, bool *httponly, zend_string **samesite)
{
zend_string *key;
zval *value;
HashTable *options = NULL;
zend_long expires = 0;
zend_string *name, *value = NULL, *path = NULL, *domain = NULL, *samesite = NULL;
- zend_bool secure = 0, httponly = 0;
+ bool secure = 0, httponly = 0;
ZEND_PARSE_PARAMETERS_START(1, 7)
Z_PARAM_STR(name)
PHP_FUNCTION(hrtime)
{
#if HRTIME_AVAILABLE
- zend_bool get_as_num = 0;
+ bool get_as_num = 0;
php_hrtime_t t = _timer_current();
ZEND_PARSE_PARAMETERS_START(0, 1)
/* {{{ entity_charset determine_charset
* Returns the charset identifier based on an explicitly provided charset,
* the internal_encoding and default_charset ini settings, or UTF-8 by default. */
-static enum entity_charset determine_charset(const char *charset_hint, zend_bool quiet)
+static enum entity_charset determine_charset(const char *charset_hint, bool quiet)
{
if (!charset_hint || !*charset_hint) {
charset_hint = get_default_charset();
/* }}} */
/* {{{ php_escape_html_entities */
-PHPAPI zend_string *php_escape_html_entities_ex(const unsigned char *old, size_t oldlen, int all, int flags, const char *hint_charset, zend_bool double_encode, zend_bool quiet)
+PHPAPI zend_string *php_escape_html_entities_ex(const unsigned char *old, size_t oldlen, int all, int flags, const char *hint_charset, bool double_encode, bool quiet)
{
size_t cursor, maxlen, len;
zend_string *replaced;
zend_string *str, *hint_charset = NULL;
zend_long flags = ENT_COMPAT;
zend_string *replaced;
- zend_bool double_encode = 1;
+ bool double_encode = 1;
ZEND_PARSE_PARAMETERS_START(1, 4)
Z_PARAM_STR(str)
void register_html_constants(INIT_FUNC_ARGS);
PHPAPI zend_string *php_escape_html_entities(const unsigned char *old, size_t oldlen, int all, int flags, const char *hint_charset);
-PHPAPI zend_string *php_escape_html_entities_ex(const unsigned char *old, size_t oldlen, int all, int flags, const char *hint_charset, zend_bool double_encode, zend_bool quiet);
+PHPAPI zend_string *php_escape_html_entities_ex(const unsigned char *old, size_t oldlen, int all, int flags, const char *hint_charset, bool double_encode, bool quiet);
PHPAPI zend_string *php_unescape_html_entities(zend_string *str, int all, int flags, const char *hint_charset);
PHPAPI unsigned int php_next_utf8_char(const unsigned char *str, size_t str_len, size_t *cursor, int *status);
arg_sep_len = strlen(arg_sep);
ZEND_HASH_FOREACH_KEY_VAL(ht, idx, key, zdata) {
- zend_bool is_dynamic = 1;
+ bool is_dynamic = 1;
if (Z_TYPE_P(zdata) == IS_INDIRECT) {
zdata = Z_INDIRECT_P(zdata);
if (Z_ISUNDEF_P(zdata)) {
}
}
-static zend_bool check_has_header(const char *headers, const char *header) {
+static bool check_has_header(const char *headers, const char *header) {
const char *s = headers;
while ((s = strstr(s, header))) {
if (s == headers || *(s-1) == '\n') {
zend_string *errstr = NULL;
size_t transport_len;
int have_header = 0;
- zend_bool request_fulluri = 0, ignore_errors = 0;
+ bool request_fulluri = 0, ignore_errors = 0;
struct timeval timeout;
char *user_headers = NULL;
int header_init = ((flags & HTTP_WRAPPER_HEADER_INIT) != 0);
int redirected = ((flags & HTTP_WRAPPER_REDIRECTED) != 0);
- zend_bool follow_location = 1;
+ bool follow_location = 1;
php_stream_filter *transfer_encoding = NULL;
int response_code;
smart_str req_buf = {0};
- zend_bool custom_request_method;
+ bool custom_request_method;
tmp_line[0] = '\0';
PHP_FUNCTION(image_type_to_extension)
{
zend_long image_type;
- zend_bool inc_dot=1;
+ bool inc_dot=1;
const char *imgext = NULL;
ZEND_PARSE_PARAMETERS_START(1, 2)
zend_string *spoolbuf = NULL;
unsigned char *poi = NULL;
zend_stat_t sb;
- zend_bool written = 0;
+ bool written = 0;
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_STRING(iptcdata, iptcdata_len)
extern zend_long php_getuid(void);
-static zend_bool php_mail_build_headers_check_field_value(zval *val)
+static bool php_mail_build_headers_check_field_value(zval *val)
{
size_t len = 0;
zend_string *value = Z_STR_P(val);
}
-static zend_bool php_mail_build_headers_check_field_name(zend_string *key)
+static bool php_mail_build_headers_check_field_name(zend_string *key)
{
size_t len = 0;
PHP_FUNCTION(md5)
{
zend_string *arg;
- zend_bool raw_output = 0;
+ bool raw_output = 0;
PHP_MD5_CTX context;
unsigned char digest[16];
{
char *arg;
size_t arg_len;
- zend_bool raw_output = 0;
+ bool raw_output = 0;
unsigned char buf[1024];
unsigned char digest[16];
PHP_MD5_CTX context;
#ifdef HAVE_GETTIMEOFDAY
static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode)
{
- zend_bool get_as_float = 0;
+ bool get_as_float = 0;
struct timeval tp = {0};
ZEND_PARSE_PARAMETERS_START(0, 1)
/* bcrypt implementation */
-static zend_bool php_password_bcrypt_valid(const zend_string *hash) {
+static bool php_password_bcrypt_valid(const zend_string *hash) {
const char *h = ZSTR_VAL(hash);
return (ZSTR_LEN(hash) == 60) &&
(h[0] == '$') && (h[1] == '2') && (h[2] == 'y');
return SUCCESS;
}
-static zend_bool php_password_bcrypt_needs_rehash(const zend_string *hash, zend_array *options) {
+static bool php_password_bcrypt_needs_rehash(const zend_string *hash, zend_array *options) {
zval *znew_cost;
zend_long old_cost = PHP_PASSWORD_BCRYPT_COST;
zend_long new_cost = PHP_PASSWORD_BCRYPT_COST;
return old_cost != new_cost;
}
-static zend_bool php_password_bcrypt_verify(const zend_string *password, const zend_string *hash) {
+static bool php_password_bcrypt_verify(const zend_string *password, const zend_string *hash) {
size_t i;
int status = 0;
zend_string *ret = php_crypt(ZSTR_VAL(password), (int)ZSTR_LEN(password), ZSTR_VAL(hash), (int)ZSTR_LEN(hash), 1);
return SUCCESS;
}
-static zend_bool php_password_argon2_needs_rehash(const zend_string *hash, zend_array *options) {
+static bool php_password_argon2_needs_rehash(const zend_string *hash, zend_array *options) {
zend_long v = 0;
zend_long new_memory_cost = PHP_PASSWORD_ARGON2_MEMORY_COST, memory_cost = 0;
zend_long new_time_cost = PHP_PASSWORD_ARGON2_TIME_COST, time_cost = 0;
/* argon2i specific methods */
-static zend_bool php_password_argon2i_verify(const zend_string *password, const zend_string *hash) {
+static bool php_password_argon2i_verify(const zend_string *password, const zend_string *hash) {
return ARGON2_OK == argon2_verify(ZSTR_VAL(hash), ZSTR_VAL(password), ZSTR_LEN(password), Argon2_i);
}
/* argon2id specific methods */
-static zend_bool php_password_argon2id_verify(const zend_string *password, const zend_string *hash) {
+static bool php_password_argon2id_verify(const zend_string *password, const zend_string *hash) {
return ARGON2_OK == argon2_verify(ZSTR_VAL(hash), ZSTR_VAL(password), ZSTR_LEN(password), Argon2_id);
}
return Z_PTR_P(tmp);
}
-static const php_password_algo* php_password_algo_find_zval(zend_string *arg_str, zend_long arg_long, zend_bool arg_is_null) {
+static const php_password_algo* php_password_algo_find_zval(zend_string *arg_str, zend_long arg_long, bool arg_is_null) {
if (arg_is_null) {
return php_password_algo_default();
}
zend_string *hash;
zend_string *new_algo_str;
zend_long new_algo_long;
- zend_bool new_algo_is_null;
+ bool new_algo_is_null;
zend_array *options = 0;
ZEND_PARSE_PARAMETERS_START(2, 3)
zend_string *password, *digest = NULL;
zend_string *algo_str;
zend_long algo_long;
- zend_bool algo_is_null;
+ bool algo_is_null;
const php_password_algo *algo;
zend_array *options = NULL;
ZEND_BEGIN_MODULE_GLOBALS(array)
bucket_compare_func_t *multisort_func;
- zend_bool compare_deprecation_thrown;
+ bool compare_deprecation_thrown;
ZEND_END_MODULE_GLOBALS(array)
#define ARRAYG(v) ZEND_MODULE_GLOBALS_ACCESSOR(array, v)
#ifndef PHP_CRYPT_H
#define PHP_CRYPT_H
-PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const char *salt, int salt_len, zend_bool quiet);
+PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const char *salt, int salt_len, bool quiet);
PHP_MINIT_FUNCTION(crypt);
PHP_MSHUTDOWN_FUNCTION(crypt);
PHP_RINIT_FUNCTION(crypt);
/* Compatibility. */
typedef size_t php_stat_len;
-PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, size_t filename_len);
+PHPAPI void php_clear_stat_cache(bool clear_realpath_cache, const char *filename, size_t filename_len);
PHPAPI void php_stat(const char *filename, size_t filename_length, int type, zval *return_value);
/* Switches for various filestat functions: */
#define PHP_CLASS_ATTRIBUTES \
zend_string *class_name; \
- zend_bool incomplete_class ZEND_ATTRIBUTE_UNUSED = 0
+ bool incomplete_class ZEND_ATTRIBUTE_UNUSED = 0
#define INCOMPLETE_CLASS "__PHP_Incomplete_Class"
#define MAGIC_MEMBER "__PHP_Incomplete_Class_Name"
typedef struct _php_password_algo {
const char *name;
zend_string *(*hash)(const zend_string *password, zend_array *options);
- zend_bool (*verify)(const zend_string *password, const zend_string *hash);
- zend_bool (*needs_rehash)(const zend_string *password, zend_array *options);
+ bool (*verify)(const zend_string *password, const zend_string *hash);
+ bool (*needs_rehash)(const zend_string *password, zend_array *options);
int (*get_info)(zval *return_value, const zend_string *hash);
- zend_bool (*valid)(const zend_string *hash);
+ bool (*valid)(const zend_string *hash);
} php_password_algo;
extern const php_password_algo php_password_algo_bcrypt;
#define php_random_int_silent(min, max, result) \
php_random_int((min), (max), (result), 0)
-PHPAPI int php_random_bytes(void *bytes, size_t size, zend_bool should_throw);
-PHPAPI int php_random_int(zend_long min, zend_long max, zend_long *result, zend_bool should_throw);
+PHPAPI int php_random_bytes(void *bytes, size_t size, bool should_throw);
+PHPAPI int php_random_int(zend_long min, zend_long max, zend_long *result, bool should_throw);
#ifdef ZTS
# define RANDOM_G(v) ZEND_TSRMG(random_globals_id, php_random_globals *, v)
size_t needle_len, const char *str, size_t str_len);
PHPAPI zend_string *php_trim(zend_string *str, const char *what, size_t what_len, int mode);
PHPAPI size_t php_strip_tags(char *rbuf, size_t len, const char *allow, size_t allow_len);
-PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, const char *allow, size_t allow_len, zend_bool allow_tag_spaces);
+PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, const char *allow, size_t allow_len, bool allow_tag_spaces);
PHPAPI void php_implode(const zend_string *delim, HashTable *arr, zval *return_value);
PHPAPI void php_explode(const zend_string *delim, zend_string *str, zval *return_value, zend_long limit);
PHPAPI size_t php_strspn(const char *s1, const char *s2, const char *s1_end, const char *s2_end);
PHPAPI size_t php_strcspn(const char *s1, const char *s2, const char *s1_end, const char *s2_end);
-PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive);
+PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, bool case_insensitive);
PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2);
PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2);
{
smart_string str = {0};
zval *arg_zv;
- zend_bool is_prog_name = 1;
+ bool is_prog_name = 1;
int elem_num = 0;
ZEND_HASH_FOREACH_VAL(args, arg_zv) {
/* }}} */
/* {{{ php_random_bytes */
-PHPAPI int php_random_bytes(void *bytes, size_t size, zend_bool should_throw)
+PHPAPI int php_random_bytes(void *bytes, size_t size, bool should_throw)
{
#ifdef PHP_WIN32
/* Defer to CryptGenRandom on Windows */
/* }}} */
/* {{{ */
-PHPAPI int php_random_int(zend_long min, zend_long max, zend_long *result, zend_bool should_throw)
+PHPAPI int php_random_int(zend_long min, zend_long max, zend_long *result, bool should_throw)
{
zend_ulong umax;
zend_ulong trial;
PHP_FUNCTION(sha1)
{
zend_string *arg;
- zend_bool raw_output = 0;
+ bool raw_output = 0;
PHP_SHA1_CTX context;
unsigned char digest[20];
{
char *arg;
size_t arg_len;
- zend_bool raw_output = 0;
+ bool raw_output = 0;
unsigned char buf[1024];
unsigned char digest[20];
PHP_SHA1_CTX context;
zend_string *host;
zval *zerrno = NULL, *zerrstr = NULL, *zcontext = NULL;
double timeout;
- zend_bool timeout_is_null = 1;
+ bool timeout_is_null = 1;
php_timeout_ull conv;
struct timeval tv;
char *hashkey = NULL;
PHP_FUNCTION(stream_socket_accept)
{
double timeout;
- zend_bool timeout_is_null = 1;
+ bool timeout_is_null = 1;
zval *zpeername = NULL;
zend_string *peername = NULL;
php_timeout_ull conv;
{
php_stream *stream;
zval *zstream;
- zend_bool want_peer;
+ bool want_peer;
zend_string *name = NULL;
ZEND_PARSE_PARAMETERS_START(2, 2)
php_stream *stream;
zval *zsrc;
zend_long maxlen, desiredpos = -1L;
- zend_bool maxlen_is_null = 1;
+ bool maxlen_is_null = 1;
zend_string *contents;
ZEND_PARSE_PARAMETERS_START(1, 3)
php_stream *src, *dest;
zval *zsrc, *zdest;
zend_long maxlen, pos = 0;
- zend_bool maxlen_is_null = 1;
+ bool maxlen_is_null = 1;
size_t len;
int ret;
php_socket_t max_fd = 0;
int retval, sets = 0;
zend_long sec, usec = 0;
- zend_bool secnull;
+ bool secnull;
int set_count, max_set_count = 0;
ZEND_PARSE_PARAMETERS_START(4, 5)
PHP_FUNCTION(stream_set_blocking)
{
zval *zstream;
- zend_bool block;
+ bool block;
php_stream *stream;
ZEND_PARSE_PARAMETERS_START(2, 2)
zend_long cryptokind = 0;
zval *zstream, *zsessstream = NULL;
php_stream *stream, *sessstream = NULL;
- zend_bool enable, cryptokindnull = 1;
+ bool enable, cryptokindnull = 1;
int ret;
ZEND_PARSE_PARAMETERS_START(2, 4)
{
zval *zsrc;
php_stream *stream;
- zend_bool enable, enable_is_null = 1;
+ bool enable, enable_is_null = 1;
zend_long fileno;
ZEND_PARSE_PARAMETERS_START(1, 2)
{
zend_string *s11, *s22;
zend_long start = 0, len = 0;
- zend_bool len_is_null = 1;
+ bool len_is_null = 1;
ZEND_PARSE_PARAMETERS_START(2, 4)
Z_PARAM_STR(s11)
size_t alloced;
zend_long current = 0, laststart = 0, lastspace = 0;
zend_long linelength = 75;
- zend_bool docut = 0;
+ bool docut = 0;
zend_string *newtext;
ZEND_PARSE_PARAMETERS_START(1, 4)
size_t found_offset;
char *haystack_dup;
char *orig_needle;
- zend_bool part = 0;
+ bool part = 0;
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_STR(haystack)
zend_string *haystack, *needle;
const char *found = NULL;
zend_long found_offset;
- zend_bool part = 0;
+ bool part = 0;
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_STR(haystack)
{
zend_string *str;
zend_long l = 0, f;
- zend_bool len_is_null = 1;
+ bool len_is_null = 1;
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_STR(str)
zend_long from_long;
HashTable *len_ht = NULL;
zend_long len_long;
- zend_bool len_is_null = 1;
+ bool len_is_null = 1;
zend_long l = 0;
zend_long f;
zend_string *result;
zend_string *str;
char *target;
size_t repl_cnt = 0;
- zend_bool is_xhtml = 1;
+ bool is_xhtml = 1;
zend_string *result;
ZEND_PARSE_PARAMETERS_START(1, 2)
swm: Added ability to strip <?xml tags without assuming it PHP
code.
*/
-PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, const char *allow, size_t allow_len, zend_bool allow_tag_spaces)
+PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, const char *allow, size_t allow_len, bool allow_tag_spaces)
{
char *tbuf, *tp, *rp, c, lc;
const char *buf, *p, *end;
}
/* }}} */
-PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive) /* {{{ */
+PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, bool case_insensitive) /* {{{ */
{
zend_string *tmp_str1, *tmp_str2;
zend_string *str1 = zval_get_tmp_string(op1, &tmp_str1);
{
char *haystack, *needle;
zend_long offset = 0, length = 0;
- zend_bool length_is_null = 1;
+ bool length_is_null = 1;
zend_long count = 0;
size_t haystack_len, needle_len;
const char *p, *endp;
{
zend_string *s1, *s2;
zend_long offset, len=0;
- zend_bool len_is_default=1;
- zend_bool cs=0;
+ bool len_is_default=1;
+ bool cs=0;
size_t cmp_len;
ZEND_PARSE_PARAMETERS_START(3, 5)
zval *var, *callable_name = NULL;
zend_string *name;
char *error;
- zend_bool retval;
- zend_bool syntax_only = 0;
+ bool retval;
+ bool syntax_only = 0;
int check_flags = 0;
ZEND_PARSE_PARAMETERS_START(1, 3)
PHP_FUNCTION(uniqid)
{
char *prefix = "";
- zend_bool more_entropy = 0;
+ bool more_entropy = 0;
zend_string *uniqid;
int sec, usec;
size_t prefix_len = 0;
/* {{{ php_url_parse */
PHPAPI php_url *php_url_parse_ex(char const *str, size_t length)
{
- zend_bool has_port;
+ bool has_port;
return php_url_parse_ex2(str, length, &has_port);
}
/* {{{ php_url_parse_ex2
*/
-PHPAPI php_url *php_url_parse_ex2(char const *str, size_t length, zend_bool *has_port)
+PHPAPI php_url *php_url_parse_ex2(char const *str, size_t length, bool *has_port)
{
char port_buf[6];
php_url *ret = ecalloc(1, sizeof(php_url));
php_url *resource;
zend_long key = -1;
zval tmp;
- zend_bool has_port;
+ bool has_port;
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STRING(str, str_len)
static const unsigned char hexchars[] = "0123456789ABCDEF";
-static zend_always_inline zend_string *php_url_encode_impl(const char *s, size_t len, zend_bool raw) /* {{{ */ {
+static zend_always_inline zend_string *php_url_encode_impl(const char *s, size_t len, bool raw) /* {{{ */ {
register unsigned char c;
unsigned char *to;
unsigned char const *from, *end;
size_t url_len;
php_stream *stream;
zval *prev_val, *hdr = NULL;
- zend_bool format = 0;
+ bool format = 0;
zval *zcontext = NULL;
php_stream_context *context;
PHPAPI void php_url_free(php_url *theurl);
PHPAPI php_url *php_url_parse(char const *str);
PHPAPI php_url *php_url_parse_ex(char const *str, size_t length);
-PHPAPI php_url *php_url_parse_ex2(char const *str, size_t length, zend_bool *has_port);
+PHPAPI php_url *php_url_parse_ex2(char const *str, size_t length, bool *has_port);
PHPAPI size_t php_url_decode(char *str, size_t len); /* return value: length of decoded string */
PHPAPI size_t php_raw_url_decode(char *str, size_t len); /* return value: length of decoded string */
PHPAPI zend_string *php_url_encode(char const *s, size_t len);
}
-static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush, url_adapt_state_ex_t *ctx)
+static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, bool do_flush, url_adapt_state_ex_t *ctx)
{
char *retval;
}
if (ZSTR_LEN(url_state->url_app.s) != 0) {
- *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT | PHP_OUTPUT_HANDLER_FLUSH | PHP_OUTPUT_HANDLER_FINAL) ? 1 : 0), url_state);
+ *handled_output = url_adapt_ext(output, output_len, &len, (bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT | PHP_OUTPUT_HANDLER_FLUSH | PHP_OUTPUT_HANDLER_FINAL) ? 1 : 0), url_state);
if (sizeof(unsigned int) < sizeof(size_t)) {
if (len > UINT_MAX)
len = UINT_MAX;
smart_str form_app = {0};
zend_string *encoded;
int ret = SUCCESS;
- zend_bool sep_removed = 0;
+ bool sep_removed = 0;
url_adapt_state_ex_t *url_state;
if (type) {
PHP_METHOD(php_user_filter, filter)
{
zval *in, *out, *consumed;
- zend_bool closing;
+ bool closing;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrzb", &in, &out, &consumed, &closing) == FAILURE) {
RETURN_THROWS();
}
PHP_FUNCTION(var_export)
{
zval *var;
- zend_bool return_output = 0;
+ bool return_output = 0;
smart_str buf = {0};
ZEND_PARSE_PARAMETERS_START(1, 2)
{
zval *zv;
zend_ulong key;
- zend_bool is_ref = Z_ISREF_P(var);
+ bool is_ref = Z_ISREF_P(var);
data->n += 1;
}
/* }}} */
-static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc) /* {{{ */
+static inline bool php_var_serialize_class_name(smart_str *buf, zval *struc) /* {{{ */
{
PHP_CLASS_ATTRIBUTES;
}
/* }}} */
-static void php_var_serialize_nested_data(smart_str *buf, zval *struc, HashTable *ht, uint32_t count, zend_bool incomplete_class, php_serialize_data_t var_hash) /* {{{ */
+static void php_var_serialize_nested_data(smart_str *buf, zval *struc, HashTable *ht, uint32_t count, bool incomplete_class, php_serialize_data_t var_hash) /* {{{ */
{
smart_str_append_unsigned(buf, count);
smart_str_appendl(buf, ":{", 2);
case IS_OBJECT: {
zend_class_entry *ce = Z_OBJCE_P(struc);
- zend_bool incomplete_class;
+ bool incomplete_class;
uint32_t count;
if (ce->__serialize) {
/* {{{ Returns the allocated by PHP memory */
PHP_FUNCTION(memory_get_usage) {
- zend_bool real_usage = 0;
+ bool real_usage = 0;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
/* {{{ Returns the peak allocated by PHP memory */
PHP_FUNCTION(memory_get_peak_usage) {
- zend_bool real_usage = 0;
+ bool real_usage = 0;
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
zend_long i;
var_entries *var_hash = (*var_hashx)->entries.next;
var_dtor_entries *var_dtor_hash = (*var_hashx)->first_dtor;
- zend_bool delayed_call_failed = 0;
+ bool delayed_call_failed = 0;
zval wakeup_name;
ZVAL_UNDEF(&wakeup_name);
#ifdef PHP_WIN32
# pragma optimize("", off)
#endif
-static inline int object_common(UNSERIALIZE_PARAMETER, zend_long elements, zend_bool has_unserialize)
+static inline int object_common(UNSERIALIZE_PARAMETER, zend_long elements, bool has_unserialize)
{
HashTable *ht;
- zend_bool has_wakeup;
+ bool has_wakeup;
if (has_unserialize) {
zval ary, *tmp;
char *str;
zend_string *class_name;
zend_class_entry *ce;
- zend_bool incomplete_class = 0;
- zend_bool custom_object = 0;
- zend_bool has_unserialize = 0;
+ bool incomplete_class = 0;
+ bool custom_object = 0;
+ bool has_unserialize = 0;
zval user_func;
zval retval;
zval *out_message, *queue, *out_msgtype, *zerrcode = NULL;
zend_long desiredmsgtype, maxsize, flags = 0;
zend_long realflags = 0;
- zend_bool do_unserialize = 1;
+ bool do_unserialize = 1;
sysvmsg_queue_t *mq = NULL;
struct php_msgbuf *messagebuffer = NULL; /* buffer to transmit */
int result;
{
zval *message, *queue, *zerror=NULL;
zend_long msgtype;
- zend_bool do_serialize = 1, blocking = 1;
+ bool do_serialize = 1, blocking = 1;
sysvmsg_queue_t * mq = NULL;
struct php_msgbuf * messagebuffer = NULL; /* buffer to transmit */
int result;
PHP_FUNCTION(sem_get)
{
zend_long key, max_acquire = 1, perm = 0666;
- zend_bool auto_release = 1;
+ bool auto_release = 1;
int semid;
struct sembuf sop[3];
int count;
static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
{
zval *arg_id;
- zend_bool nowait = 0;
+ bool nowait = 0;
sysvsem_sem *sem_ptr;
struct sembuf sop;
char *shm_ptr;
sysvshm_chunk_head *chunk_ptr;
zend_long shm_key, shm_id, shm_size, shm_flag = 0666;
- zend_bool shm_size_is_null = 1;
+ bool shm_size_is_null = 1;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "l|l!l", &shm_key, &shm_size, &shm_size_is_null, &shm_flag)) {
RETURN_THROWS();
ZEND_BEGIN_MODULE_GLOBALS(tidy)
char *default_config;
- zend_bool clean_output;
+ bool clean_output;
ZEND_END_MODULE_GLOBALS(tidy)
#define TG(v) ZEND_MODULE_GLOBALS_ACCESSOR(tidy, v)
/* }}} */
/* {{{ ext/tidy prototypes */
-static zend_string *php_tidy_file_to_mem(char *, zend_bool);
+static zend_string *php_tidy_file_to_mem(char *, bool);
static void tidy_object_free_storage(zend_object *);
static zend_object *tidy_object_new_node(zend_class_entry *);
static zend_object *tidy_object_new_doc(zend_class_entry *);
return FAILURE;
}
-static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_file)
+static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, bool is_file)
{
char *enc = NULL;
size_t enc_len = 0;
HashTable *config_ht = NULL;
if (is_file) {
- zend_bool use_include_path = 0;
+ bool use_include_path = 0;
ZEND_PARSE_PARAMETERS_START(1, 4)
Z_PARAM_PATH_STR(arg1)
tidyRelease(doc);
}
-static zend_string *php_tidy_file_to_mem(char *filename, zend_bool use_include_path)
+static zend_string *php_tidy_file_to_mem(char *filename, bool use_include_path)
{
php_stream *stream;
zend_string *data = NULL;
static PHP_INI_MH(php_tidy_set_clean_output)
{
int status;
- zend_bool value;
+ bool value;
if (ZSTR_LEN(new_value)==2 && strcasecmp("on", ZSTR_VAL(new_value))==0) {
- value = (zend_bool) 1;
+ value = (bool) 1;
} else if (ZSTR_LEN(new_value)==3 && strcasecmp("yes", ZSTR_VAL(new_value))==0) {
- value = (zend_bool) 1;
+ value = (bool) 1;
} else if (ZSTR_LEN(new_value)==4 && strcasecmp("true", ZSTR_VAL(new_value))==0) {
- value = (zend_bool) 1;
+ value = (bool) 1;
} else {
- value = (zend_bool) atoi(ZSTR_VAL(new_value));
+ value = (bool) atoi(ZSTR_VAL(new_value));
}
if (stage == PHP_INI_STAGE_RUNTIME) {
{
char *enc = NULL;
size_t enc_len = 0;
- zend_bool use_include_path = 0;
+ bool use_include_path = 0;
zend_string *inputfile, *contents, *options_str = NULL;
HashTable *options_ht = NULL;
{
char *enc = NULL;
size_t enc_len = 0;
- zend_bool use_include_path = 0;
+ bool use_include_path = 0;
HashTable *options_ht = NULL;
zend_string *contents, *inputfile = NULL, *options_str = NULL;
PHPTidyObj *obj;
{
char *enc = NULL;
size_t enc_len = 0;
- zend_bool use_include_path = 0;
+ bool use_include_path = 0;
HashTable *options_ht = NULL;
zend_string *inputfile, *contents, *options_str = NULL;
PHPTidyObj *obj;
return Z_STR_P(text_zval);
}
-static zend_bool tokenize_common(
+static bool tokenize_common(
zval *return_value, zend_string *source, zend_long flags, zend_class_entry *token_class);
PHP_METHOD(PhpToken, tokenize)
zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &token);
}
-static zend_bool tokenize(zval *return_value, zend_string *source, zend_class_entry *token_class)
+static bool tokenize(zval *return_value, zend_string *source, zend_class_entry *token_class)
{
zval source_zval;
zend_lex_state original_lex_state;
}
}
-static zend_bool tokenize_parse(
+static bool tokenize_parse(
zval *return_value, zend_string *source, zend_class_entry *token_class)
{
zval source_zval;
struct event_context ctx;
zval token_stream;
zend_lex_state original_lex_state;
- zend_bool original_in_compilation;
- zend_bool success;
+ bool original_in_compilation;
+ bool success;
ZVAL_STR_COPY(&source_zval, source);
return success;
}
-static zend_bool tokenize_common(
+static bool tokenize_common(
zval *return_value, zend_string *source, zend_long flags, zend_class_entry *token_class)
{
if (flags & TOKEN_PARSE) {
char *data;
size_t data_len;
int ret;
- zend_bool isFinal = 0;
+ bool isFinal = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|b", &pind, xml_parser_ce, &data, &data_len, &isFinal) == FAILURE) {
RETURN_THROWS();
zval *id;
zend_long property;
int retval = -1;
- zend_bool value;
+ bool value;
xmlreader_object *intern;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "lb", &property, &value) == FAILURE) {
{
xmlTextWriterPtr ptr;
int retval;
- zend_bool indent;
+ bool indent;
zval *self;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ob", &self, xmlwriter_class_entry_ce, &indent) == FAILURE) {
char *name;
size_t name_len;
int retval;
- zend_bool isparm;
+ bool isparm;
zval *self;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osb", &self, xmlwriter_class_entry_ce, &name, &name_len, &isparm) == FAILURE) {
int retval;
/* Optional parameters */
char *pubid = NULL, *sysid = NULL, *ndataid = NULL;
- zend_bool pe = 0;
+ bool pe = 0;
size_t pubid_len, sysid_len, ndataid_len;
zval *self;
static void php_xmlwriter_flush(INTERNAL_FUNCTION_PARAMETERS, int force_string) {
xmlTextWriterPtr ptr;
xmlBufferPtr buffer;
- zend_bool empty = 1;
+ bool empty = 1;
int output_bytes;
zval *self;
PHP_METHOD(ZipArchive, isCompressionMethodSupported)
{
zend_long method;
- zend_bool enc = 1;
+ bool enc = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|b", &method, &enc) == FAILURE) {
return;
PHP_METHOD(ZipArchive, isEncryptionMethodSupported)
{
zend_long method;
- zend_bool enc = 1;
+ bool enc = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|b", &method, &enc) == FAILURE) {
return;
char *output_handler;
php_zlib_context *ob_gzhandler;
zend_long output_compression_default;
- zend_bool handler_registered;
+ bool handler_registered;
int compression_coding;
ZEND_END_MODULE_GLOBALS(zlib);
PHP_ZLIB_DECODE_FUNC(gzuncompress, PHP_ZLIB_ENCODING_DEFLATE);
/* }}} */
-static zend_bool zlib_create_dictionary_string(HashTable *options, char **dict, size_t *dictlen) {
+static bool zlib_create_dictionary_string(HashTable *options, char **dict, size_t *dictlen) {
zval *option_buffer;
if (options && (option_buffer = zend_hash_str_find(options, ZEND_STRL("dictionary"))) != NULL) {
unsigned char *outbuf;
size_t outbuf_len;
int persistent;
- zend_bool finished; /* for zlib.deflate: signals that no flush is pending */
+ bool finished; /* for zlib.deflate: signals that no flush is pending */
} php_zlib_filter_data;
/* }}} */
}
}
-SAPI_API int sapi_add_header_ex(const char *header_line, size_t header_line_len, zend_bool duplicate, zend_bool replace)
+SAPI_API int sapi_add_header_ex(const char *header_line, size_t header_line_len, bool duplicate, bool replace)
{
sapi_header_line ctr = {0};
int r;
const char *content_type;
- zend_bool headers_only;
- zend_bool no_headers;
- zend_bool headers_read;
+ bool headers_only;
+ bool no_headers;
+ bool headers_read;
sapi_post_entry *post_entry;
HashTable *rfc1867_uploaded_files;
zend_long post_max_size;
int options;
- zend_bool sapi_started;
+ bool sapi_started;
double global_request_time;
HashTable known_post_content_types;
zval callback_func;
SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg);
/* Deprecated functions. Use sapi_header_op instead. */
-SAPI_API int sapi_add_header_ex(const char *header_line, size_t header_line_len, zend_bool duplicate, zend_bool replace);
+SAPI_API int sapi_add_header_ex(const char *header_line, size_t header_line_len, bool duplicate, bool replace);
#define sapi_add_header(a, b, c) sapi_add_header_ex((a),(b),(c),1)
char *filename = NULL;
zend_string *resolved_path = NULL;
size_t length;
- zend_bool orig_display_errors;
+ bool orig_display_errors;
path_info = SG(request_info).request_uri;
#if HAVE_PWD_H
static void report_zend_debug_error_notify_cb(int type, const char *error_filename, uint32_t error_lineno, zend_string *message)
{
if (PG(report_zend_debug)) {
- zend_bool trigger_break;
+ bool trigger_break;
switch (type) {
case E_ERROR:
extended error handling function */
static ZEND_COLD void php_error_cb(int orig_type, const char *error_filename, const uint32_t error_lineno, zend_string *message)
{
- zend_bool display;
+ bool display;
int type = orig_type & E_ALL;
/* check for repeated errors to be ignored */
/* {{{ php_request_shutdown */
void php_request_shutdown(void *dummy)
{
- zend_bool report_memleaks;
+ bool report_memleaks;
EG(flags) |= EG_FLAGS_IN_SHUTDOWN;
/* 3. Flush all output buffers */
zend_try {
- zend_bool send_buffer = SG(request_info).headers_only ? 0 : 1;
+ bool send_buffer = SG(request_info).headers_only ? 0 : 1;
if (CG(unclean_shutdown) && PG(last_error_type) == E_ERROR &&
(size_t)PG(memory_limit) < zend_memory_usage(1)
/* {{{ static void php_output_context_feed(php_output_context *context, char *, size_t, size_t)
* Feed output contexts input buffer */
-static inline void php_output_context_feed(php_output_context *context, char *data, size_t size, size_t used, zend_bool free)
+static inline void php_output_context_feed(php_output_context *context, char *data, size_t size, size_t used, bool free)
{
if (context->in.free && context->in.data) {
efree(context->in.data);
/* {{{ Return the status of the active or all output buffers */
PHP_FUNCTION(ob_get_status)
{
- zend_bool full_status = 0;
+ bool full_status = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &full_status) == FAILURE) {
RETURN_THROWS();
} arg_separators;
struct _php_core_globals {
- zend_bool implicit_flush;
+ bool implicit_flush;
zend_long output_buffering;
- zend_bool enable_dl;
+ bool enable_dl;
char *output_handler;
zend_long max_input_time;
zend_uchar display_errors;
- zend_bool display_startup_errors;
- zend_bool log_errors;
+ bool display_startup_errors;
+ bool log_errors;
zend_long log_errors_max_len;
- zend_bool ignore_repeated_errors;
- zend_bool ignore_repeated_source;
- zend_bool report_memleaks;
+ bool ignore_repeated_errors;
+ bool ignore_repeated_source;
+ bool report_memleaks;
char *error_log;
char *doc_root;
HashTable rfc1867_protected_variables;
short connection_status;
- zend_bool ignore_user_abort;
+ bool ignore_user_abort;
unsigned char header_is_being_sent;
zval http_globals[6];
- zend_bool expose_php;
+ bool expose_php;
- zend_bool register_argc_argv;
- zend_bool auto_globals_jit;
+ bool register_argc_argv;
+ bool auto_globals_jit;
char *docref_root;
char *docref_ext;
- zend_bool html_errors;
- zend_bool xmlrpc_errors;
+ bool html_errors;
+ bool xmlrpc_errors;
zend_long xmlrpc_error_number;
- zend_bool activated_auto_globals[8];
+ bool activated_auto_globals[8];
- zend_bool modules_activated;
- zend_bool file_uploads;
- zend_bool during_request_startup;
- zend_bool allow_url_fopen;
- zend_bool enable_post_data_reading;
- zend_bool report_zend_debug;
+ bool modules_activated;
+ bool file_uploads;
+ bool during_request_startup;
+ bool allow_url_fopen;
+ bool enable_post_data_reading;
+ bool report_zend_debug;
int last_error_type;
zend_string *last_error_message;
char *php_sys_temp_dir;
char *disable_classes;
- zend_bool allow_url_include;
+ bool allow_url_include;
#ifdef PHP_WIN32
- zend_bool com_initialized;
+ bool com_initialized;
#endif
zend_long max_input_nesting_level;
zend_long max_input_vars;
- zend_bool in_user_include;
+ bool in_user_include;
char *user_ini_filename;
zend_long user_ini_cache_ttl;
char *request_order;
- zend_bool mail_x_header;
+ bool mail_x_header;
char *mail_log;
- zend_bool in_error_log;
+ bool in_error_log;
#ifdef PHP_WIN32
- zend_bool windows_show_crt_warning;
+ bool windows_show_crt_warning;
#endif
zend_long syslog_facility;
char *syslog_ident;
- zend_bool have_called_openlog;
+ bool have_called_openlog;
zend_long syslog_filter;
};
{
int module_number;
zend_ini_entry *ini_entry;
- zend_bool first = 1;
+ bool first = 1;
if (module) {
module_number = module->module_number;
char *var, *var_orig;
size_t var_len, index_len;
zval gpc_element, *gpc_element_p;
- zend_bool is_array = 0;
+ bool is_array = 0;
HashTable *symtable1 = NULL;
ALLOCA_FLAG(use_heap)
size_t already_scanned;
} post_var_data_t;
-static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof)
+static bool add_post_var(zval *arr, post_var_data_t *var, bool eof)
{
char *start, *ksep, *vsep, *val;
size_t klen, vlen;
return 1;
}
-static inline int add_post_vars(zval *arr, post_var_data_t *vars, zend_bool eof)
+static inline int add_post_vars(zval *arr, post_var_data_t *vars, bool eof)
{
uint64_t max_vars = PG(max_input_vars);
tsrm_env_unlock();
}
-zend_bool php_std_auto_global_callback(char *name, uint32_t name_len)
+bool php_std_auto_global_callback(char *name, uint32_t name_len)
{
zend_printf("%s\n", name);
return 0; /* don't rearm */
}
/* }}} */
-static zend_bool php_auto_globals_create_get(zend_string *name)
+static bool php_auto_globals_create_get(zend_string *name)
{
if (PG(variables_order) && (strchr(PG(variables_order),'G') || strchr(PG(variables_order),'g'))) {
sapi_module.treat_data(PARSE_GET, NULL, NULL);
return 0; /* don't rearm */
}
-static zend_bool php_auto_globals_create_post(zend_string *name)
+static bool php_auto_globals_create_post(zend_string *name)
{
if (PG(variables_order) &&
(strchr(PG(variables_order),'P') || strchr(PG(variables_order),'p')) &&
return 0; /* don't rearm */
}
-static zend_bool php_auto_globals_create_cookie(zend_string *name)
+static bool php_auto_globals_create_cookie(zend_string *name)
{
if (PG(variables_order) && (strchr(PG(variables_order),'C') || strchr(PG(variables_order),'c'))) {
sapi_module.treat_data(PARSE_COOKIE, NULL, NULL);
return 0; /* don't rearm */
}
-static zend_bool php_auto_globals_create_files(zend_string *name)
+static bool php_auto_globals_create_files(zend_string *name)
{
if (Z_TYPE(PG(http_globals)[TRACK_VARS_FILES]) == IS_UNDEF) {
array_init(&PG(http_globals)[TRACK_VARS_FILES]);
}
}
-static zend_bool php_auto_globals_create_server(zend_string *name)
+static bool php_auto_globals_create_server(zend_string *name)
{
if (PG(variables_order) && (strchr(PG(variables_order),'S') || strchr(PG(variables_order),'s'))) {
php_register_server_variables();
return 0; /* don't rearm */
}
-static zend_bool php_auto_globals_create_env(zend_string *name)
+static bool php_auto_globals_create_env(zend_string *name)
{
zval_ptr_dtor_nogc(&PG(http_globals)[TRACK_VARS_ENV]);
array_init(&PG(http_globals)[TRACK_VARS_ENV]);
return 0; /* don't rearm */
}
-static zend_bool php_auto_globals_create_request(zend_string *name)
+static bool php_auto_globals_create_request(zend_string *name)
{
zval form_variables;
unsigned char _gpc_flags[3] = {0, 0, 0};
PHPAPI int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra) = NULL;
-static void safe_php_register_variable(char *var, char *strval, size_t val_len, zval *track_vars_array, zend_bool override_protection);
+static void safe_php_register_variable(char *var, char *strval, size_t val_len, zval *track_vars_array, bool override_protection);
/* The longest property name we use in an uploaded file array */
#define MAX_SIZE_OF_INDEX sizeof("[tmp_name]")
}
/* }}} */
-static zend_bool is_protected_variable(char *varname) /* {{{ */
+static bool is_protected_variable(char *varname) /* {{{ */
{
normalize_protected_variable(varname);
return zend_hash_str_exists(&PG(rfc1867_protected_variables), varname, strlen(varname));
}
/* }}} */
-static void safe_php_register_variable(char *var, char *strval, size_t val_len, zval *track_vars_array, zend_bool override_protection) /* {{{ */
+static void safe_php_register_variable(char *var, char *strval, size_t val_len, zval *track_vars_array, bool override_protection) /* {{{ */
{
if (override_protection || !is_protected_variable(var)) {
php_register_variable_safe(var, strval, val_len, track_vars_array);
}
/* }}} */
-static void safe_php_register_variable_ex(char *var, zval *val, zval *track_vars_array, zend_bool override_protection) /* {{{ */
+static void safe_php_register_variable_ex(char *var, zval *val, zval *track_vars_array, bool override_protection) /* {{{ */
{
if (override_protection || !is_protected_variable(var)) {
php_register_variable_ex(var, val, track_vars_array);
}
/* }}} */
-static void register_http_post_files_variable(char *strvar, char *val, zval *http_post_files, zend_bool override_protection) /* {{{ */
+static void register_http_post_files_variable(char *strvar, char *val, zval *http_post_files, bool override_protection) /* {{{ */
{
safe_php_register_variable(strvar, val, strlen(val), http_post_files, override_protection);
}
/* }}} */
-static void register_http_post_files_variable_ex(char *var, zval *val, zval *http_post_files, zend_bool override_protection) /* {{{ */
+static void register_http_post_files_variable_ex(char *var, zval *val, zval *http_post_files, bool override_protection) /* {{{ */
{
safe_php_register_variable_ex(var, val, http_post_files, override_protection);
}
/*
* Do format conversion placing the output in buffer
*/
-static void xbuf_format_converter(void *xbuf, zend_bool is_char, const char *fmt, va_list ap) /* {{{ */
+static void xbuf_format_converter(void *xbuf, bool is_char, const char *fmt, va_list ap) /* {{{ */
{
char *s = NULL;
size_t s_len;
zval args[4];
int call_result;
php_stream *stream = NULL;
- zend_bool old_in_user_include;
+ bool old_in_user_include;
/* Try to catch bad usage without preventing flexibility */
if (FG(user_stream_current_filename) != NULL && strcmp(filename, FG(user_stream_current_filename)) == 0) {
php_stream_xport_param *xparam STREAMS_DC)
{
int clisock;
- zend_bool nodelay = 0;
+ bool nodelay = 0;
zval *tmpzval = NULL;
xparam->outputs.client = NULL;
return NULL;
}
-static zend_bool should_overwrite_per_dir_entry(HashTable *target_ht, zval *zv, zend_hash_key *hash_key, void *pData)
+static bool should_overwrite_per_dir_entry(HashTable *target_ht, zval *zv, zend_hash_key *hash_key, void *pData)
{
php_dir_entry *new_per_dir_entry = Z_PTR_P(zv);
php_dir_entry *orig_per_dir_entry;
#define APR_ARRAY_FOREACH_CLOSE() }}
typedef struct {
- zend_bool engine;
- zend_bool xbithack;
- zend_bool last_modified;
+ bool engine;
+ bool xbithack;
+ bool last_modified;
} php_apache2_info_struct;
extern zend_module_entry apache2_module_entry;
php_struct *ctx;
char *variable=NULL, *string_val=NULL;
size_t variable_len, string_val_len;
- zend_bool walk_to_top = 0;
+ bool walk_to_top = 0;
int arg_count = ZEND_NUM_ARGS();
request_rec *r;
php_struct *ctx;
char *variable;
size_t variable_len;
- zend_bool walk_to_top = 0;
+ bool walk_to_top = 0;
int arg_count = ZEND_NUM_ARGS();
char *env_val=NULL;
request_rec *r;
typedef struct _php_cgi_globals_struct {
HashTable user_config_cache;
char *redirect_status_env;
- zend_bool rfc2616_headers;
- zend_bool nph;
- zend_bool check_shebang_line;
- zend_bool fix_pathinfo;
- zend_bool force_redirect;
- zend_bool discard_path;
- zend_bool fcgi_logging;
+ bool rfc2616_headers;
+ bool nph;
+ bool check_shebang_line;
+ bool fix_pathinfo;
+ bool force_redirect;
+ bool discard_path;
+ bool fcgi_logging;
#ifdef PHP_WIN32
- zend_bool impersonate;
+ bool impersonate;
#endif
} php_cgi_globals_struct;
{
sapi_header_struct *h;
zend_llist_position pos;
- zend_bool ignore_status = 0;
+ bool ignore_status = 0;
int response_status = SG(sapi_headers).http_response_code;
if (SG(request_info).no_headers == 1) {
if (CGIG(nph) || SG(sapi_headers).http_response_code != 200)
{
int len;
- zend_bool has_status = 0;
+ bool has_status = 0;
char buf[SAPI_CGI_MAX_HEADER_LENGTH];
if (CGIG(rfc2616_headers) && SG(sapi_headers).http_status_line) {
static php_stream *s_in_process = NULL;
-static void cli_register_file_handles(zend_bool no_close) /* {{{ */
+static void cli_register_file_handles(bool no_close) /* {{{ */
{
php_stream *s_in, *s_out, *s_err;
php_stream_context *sc_in=NULL, *sc_out=NULL, *sc_err=NULL;
{
int color = 0, effective_status = status;
char *basic_buf, *message_buf = "", *error_buf = "";
- zend_bool append_error_message = 0;
+ bool append_error_message = 0;
if (PG(last_error_message)) {
if (PG(last_error_type) & E_FATAL_ERRORS) {
sapi_module.phpinfo_as_text = 0;
{
- zend_bool ipv6 = strchr(server.host, ':');
+ bool ipv6 = strchr(server.host, ':');
php_cli_server_logf(
PHP_CLI_SERVER_LOG_PROCESS,
"PHP %s Development Server (http://%s%s%s:%d) started",
};
typedef struct _php_cgi_globals_struct {
- zend_bool rfc2616_headers;
- zend_bool nph;
- zend_bool fix_pathinfo;
- zend_bool force_redirect;
- zend_bool discard_path;
- zend_bool fcgi_logging;
+ bool rfc2616_headers;
+ bool nph;
+ bool fix_pathinfo;
+ bool force_redirect;
+ bool discard_path;
+ bool fcgi_logging;
char *redirect_status_env;
HashTable user_config_cache;
char *error_header;
char buf[SAPI_CGI_MAX_HEADER_LENGTH];
sapi_header_struct *h;
zend_llist_position pos;
- zend_bool ignore_status = 0;
+ bool ignore_status = 0;
int response_status = SG(sapi_headers).http_response_code;
if (SG(request_info).no_headers == 1) {
if (CGIG(nph) || SG(sapi_headers).http_response_code != 200)
{
int len;
- zend_bool has_status = 0;
+ bool has_status = 0;
if (CGIG(rfc2616_headers) && SG(sapi_headers).http_status_line) {
char *s;
int php_allow_to_run_as_root = 0;
int ret;
#if ZEND_RC_DEBUG
- zend_bool old_rc_debug;
+ bool old_rc_debug;
#endif
#if defined(SIGPIPE) && defined(SIG_IGN)
}
int fuzzer_do_request_from_buffer(
- char *filename, const char *data, size_t data_len, zend_bool execute)
+ char *filename, const char *data, size_t data_len, bool execute)
{
int retval = FAILURE; /* failure by default */
void fuzzer_call_php_func(const char *func_name, int nargs, char **params);
void fuzzer_call_php_func_zval(const char *func_name, int nargs, zval *args);
int fuzzer_do_request_from_buffer(
- char *filename, const char *data, size_t data_len, zend_bool execute);
+ char *filename, const char *data, size_t data_len, bool execute);
char buf[SAPI_LSAPI_MAX_HEADER_LENGTH];
sapi_header_struct *h;
zend_llist_position pos;
- zend_bool ignore_status = 0;
+ bool ignore_status = 0;
int response_status = SG(sapi_headers).http_response_code;
if (SG(request_info).no_headers == 1) {
if (SG(sapi_headers).http_response_code != 200)
{
int len;
- zend_bool has_status = 0;
+ bool has_status = 0;
char *s;
STD_PHP_INI_ENTRY("phpdbg.eol", "2", PHP_INI_ALL, OnUpdateEol, eol, zend_phpdbg_globals, phpdbg_globals)
PHP_INI_END()
-static zend_bool phpdbg_booted = 0;
-static zend_bool phpdbg_fully_started = 0;
-zend_bool use_mm_wrappers = 1;
+static bool phpdbg_booted = 0;
+static bool phpdbg_fully_started = 0;
+bool use_mm_wrappers = 1;
static void php_phpdbg_destroy_bp_file(zval *brake) /* {{{ */
{
{
zend_stat_t sb;
- zend_bool result = 1;
+ bool result = 1;
if (VCWD_STAT(ZSTR_VAL(exec), &sb) != FAILURE) {
if (sb.st_mode & (S_IFREG|S_IFLNK)) {
PHPDBG_G(oplog_cur)->next = NULL;
}
-static zend_always_inline zend_bool phpdbg_is_ignored_opcode(zend_uchar opcode) {
+static zend_always_inline bool phpdbg_is_ignored_opcode(zend_uchar opcode) {
return
opcode == ZEND_NOP || opcode == ZEND_OP_DATA || opcode == ZEND_FE_FREE || opcode == ZEND_FREE || opcode == ZEND_ASSERT_CHECK || opcode == ZEND_VERIFY_RETURN_TYPE
|| opcode == ZEND_DECLARE_CONST || opcode == ZEND_DECLARE_CLASS || opcode == ZEND_DECLARE_FUNCTION
;
}
-static void phpdbg_oplog_fill_executable(zend_op_array *op_array, HashTable *insert_ht, zend_bool by_opcode) {
+static void phpdbg_oplog_fill_executable(zend_op_array *op_array, HashTable *insert_ht, bool by_opcode) {
/* ignore RECV_* opcodes */
zend_op *cur = op_array->opcodes + op_array->num_args + !!(op_array->fn_flags & ZEND_ACC_VARIADIC);
zend_op *end = op_array->opcodes + op_array->last;
{
HashTable *options = NULL;
zval *option_buffer;
- zend_bool by_function = 0;
- zend_bool by_opcode = 0;
+ bool by_function = 0;
+ bool by_opcode = 0;
HashTable *insert_ht;
zend_function *func;
HashTable *options = NULL;
zval *option_buffer;
- zend_bool by_function = 0;
- zend_bool by_opcode = 0;
+ bool by_function = 0;
+ bool by_opcode = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|H", &options) == FAILURE) {
RETURN_THROWS();
"error_log=\n"
"output_buffering=off\n\0";
-static void phpdbg_welcome(zend_bool cleaning) /* {{{ */
+static void phpdbg_welcome(bool cleaning) /* {{{ */
{
/* print blurb */
if (!cleaning) {
int ini_entries_len;
char **zend_extensions = NULL;
zend_ulong zend_extensions_len = 0L;
- zend_bool ini_ignore;
+ bool ini_ignore;
char *ini_override;
char *exec = NULL;
char *first_command = NULL;
char *init_file;
size_t init_file_len;
- zend_bool init_file_default;
+ bool init_file_default;
char *oplog_file;
size_t oplog_file_len;
uint64_t flags;
char *php_optarg;
int php_optind, opt, show_banner = 1;
long cleaning = -1;
- volatile zend_bool quit_immediately = 0; /* somehow some gcc release builds will play a bit around with order in combination with setjmp..., hence volatile */
- zend_bool remote = 0;
+ volatile bool quit_immediately = 0; /* somehow some gcc release builds will play a bit around with order in combination with setjmp..., hence volatile */
+ bool remote = 0;
zend_phpdbg_globals *settings = NULL;
char *bp_tmp = NULL;
char *address;
int socket = -1;
FILE* stream = NULL;
char *print_opline_func;
- zend_bool ext_stmt = 0;
- zend_bool is_exit;
+ bool ext_stmt = 0;
+ bool is_exit;
int exit_status;
char *read_from_stdin = NULL;
zend_string *backup_phpdbg_compile = NULL;
- zend_bool show_help = 0, show_version = 0;
+ bool show_help = 0, show_version = 0;
void* (*_malloc)(size_t);
void (*_free)(void*);
void* (*_realloc)(void*, size_t);
HashTable watch_free; /* pointers to watch for being freed */
HashTable *watchlist_mem; /* triggered watchpoints */
HashTable *watchlist_mem_backup; /* triggered watchpoints backup table while iterating over it */
- zend_bool watchpoint_hit; /* a watchpoint was hit */
+ bool watchpoint_hit; /* a watchpoint was hit */
void (*original_free_function)(void *); /* the original AG(mm_heap)->_free function */
phpdbg_watch_element *watch_tmp; /* temporary pointer for a watch element */
zval retval; /* return value */
int bp_count; /* breakpoint count */
int vmret; /* return from last opcode handler execution */
- zend_bool in_execution; /* in execution? */
- zend_bool unclean_eval; /* do not check for memory leaks when we needed to bail out during eval */
+ bool in_execution; /* in execution? */
+ bool unclean_eval; /* do not check for memory leaks when we needed to bail out during eval */
zend_op_array *(*compile_file)(zend_file_handle *file_handle, int type);
zend_op_array *(*init_compile_file)(zend_file_handle *file_handle, int type);
ssize_t (*php_stdiop_write)(php_stream *, const char *, size_t);
int in_script_xml; /* in <stream> output mode */
struct {
- zend_bool active;
+ bool active;
int type;
int fd;
char *tag;
char *prompt[2]; /* prompt */
const phpdbg_color_t *colors[PHPDBG_COLORS]; /* colors */
char *buffer; /* buffer */
- zend_bool last_was_newline; /* check if we don't need to output a newline upon next phpdbg_error or phpdbg_notice */
+ bool last_was_newline; /* check if we don't need to output a newline upon next phpdbg_error or phpdbg_notice */
FILE *stdin_file; /* FILE pointer to stdin source file */
const php_stream_wrapper *orig_url_wrap_php;
php_stream_statbuf ssb;
char realpath[MAXPATHLEN];
const char *original_path = path;
- zend_bool pending = 0;
+ bool pending = 0;
zend_string *path_str;
HashTable *broken, *file_breaks = &PHPDBG_G(bp)[PHPDBG_BREAK_FILE];
return zend_hash_index_find_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE], zend_hash_func(opname, strlen(opname)));
} /* }}} */
-static inline zend_bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend_execute_data *execute_data) /* {{{ */
+static inline bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend_execute_data *execute_data) /* {{{ */
{
zend_function *function = execute_data->func;
PHPDBG_G(bp_count) = 0;
} /* }}} */
-PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t *brake, zend_bool output) /* {{{ */
+PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t *brake, bool output) /* {{{ */
{
brake->hits++;
int id; \
zend_uchar type; \
zend_ulong hits; \
- zend_bool disabled; \
+ bool disabled; \
const char *name /* }}} */
/* {{{ breakpoint base */
typedef struct _phpdbg_breakcond_t {
phpdbg_breakbase(code);
size_t code_len;
- zend_bool paramed;
+ bool paramed;
phpdbg_param_t param;
zend_ulong hash;
zend_op_array *ops;
PHPDBG_API phpdbg_breakbase_t* phpdbg_find_breakpoint(zend_execute_data*); /* }}} */
/* {{{ Misc Breakpoint API */
-PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t* brake, zend_bool output);
+PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t* brake, bool output);
PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type);
PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t* brake);
PHPDBG_API void phpdbg_reset_breakpoints(void);
return SUCCESS;
}
-void phpdbg_btree_clean_recursive(phpdbg_btree_branch *branch, zend_ulong depth, zend_bool persistent) {
+void phpdbg_btree_clean_recursive(phpdbg_btree_branch *branch, zend_ulong depth, bool persistent) {
phpdbg_btree_branch *start = branch;
while (depth--) {
- zend_bool use_branch = branch + 1 == branch->branches[0];
+ bool use_branch = branch + 1 == branch->branches[0];
if (branch->branches[use_branch]) {
phpdbg_btree_clean_recursive(branch->branches[use_branch], depth, persistent);
}
typedef struct {
zend_ulong count;
zend_ulong depth;
- zend_bool persistent;
+ bool persistent;
phpdbg_btree_branch *branch;
} phpdbg_btree;
return hash;
} /* }}} */
-PHPDBG_API zend_bool phpdbg_match_param(const phpdbg_param_t *l, const phpdbg_param_t *r) /* {{{ */
+PHPDBG_API bool phpdbg_match_param(const phpdbg_param_t *l, const phpdbg_param_t *r) /* {{{ */
{
if (l && r) {
if (l->type == r->type) {
size_t least = 0L,
received = 0L,
current = 0L;
- zend_bool optional = 0;
+ bool optional = 0;
/* check for arg spec */
if (!(arg) || !(*arg)) {
return NULL;
} /* }}} */
-static int phpdbg_internal_stack_execute(phpdbg_param_t *stack, zend_bool allow_async_unsafe) {
+static int phpdbg_internal_stack_execute(phpdbg_param_t *stack, bool allow_async_unsafe) {
const phpdbg_command_t *handler = NULL;
phpdbg_param_t *top = (phpdbg_param_t *) stack->next;
} /* }}} */
/* {{{ */
-PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async_unsafe) {
+PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, bool allow_async_unsafe) {
phpdbg_param_t *top = stack;
if (stack->type != STACK_PARAM) {
const phpdbg_command_t *subs; /* Sub Commands */
char *args; /* Argument Spec */
const phpdbg_command_t *parent; /* Parent Command */
- zend_bool flags; /* General flags */
+ bool flags; /* General flags */
};
/* }}} */
PHPDBG_API void phpdbg_stack_separate(phpdbg_param_t *param);
PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t *commands, const phpdbg_command_t *parent, phpdbg_param_t **top);
PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param_t **stack);
-PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async_unsafe);
+PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, bool allow_async_unsafe);
PHPDBG_API void phpdbg_stack_free(phpdbg_param_t *stack);
/*
*/
PHPDBG_API void phpdbg_clear_param(phpdbg_param_t*);
PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t*, phpdbg_param_t*);
-PHPDBG_API zend_bool phpdbg_match_param(const phpdbg_param_t *, const phpdbg_param_t *);
+PHPDBG_API bool phpdbg_match_param(const phpdbg_param_t *, const phpdbg_param_t *);
PHPDBG_API zend_ulong phpdbg_hash_param(const phpdbg_param_t *);
PHPDBG_API const char* phpdbg_get_param_type(const phpdbg_param_t*);
PHPDBG_API char* phpdbg_param_tostring(const phpdbg_param_t *param, char **pointer);
if (args) {
const zend_function *func = NULL;
const zend_arg_info *arginfo = NULL;
- zend_bool is_variadic = 0;
+ bool is_variadic = 0;
int j = 0, m;
phpdbg_try_access {
/* {{{ Commands Table */
#define PHPDBG_COMMAND_HELP_D(name, tip, alias, action) \
- {PHPDBG_STRL(#name), tip, sizeof(tip)-1, alias, action, &phpdbg_prompt_commands[16], 0, NULL, (zend_bool) 0}
+ {PHPDBG_STRL(#name), tip, sizeof(tip)-1, alias, action, &phpdbg_prompt_commands[16], 0, NULL, (bool) 0}
const phpdbg_command_t phpdbg_help_commands[] = {
PHPDBG_COMMAND_HELP_D(aliases, "show alias list", 'a', phpdbg_do_help_aliases),
return 0;
}
-static int phpdbg_print_symbols(zend_bool show_globals) {
+static int phpdbg_print_symbols(bool show_globals) {
HashTable vars;
zend_array *symtable;
zend_string *var;
PHPDBG_INFO(literal) /* {{{ */
{
/* literals are assumed to not be manipulated during executing of their op_array and as such async safe */
- zend_bool in_executor = PHPDBG_G(in_execution) && EG(current_execute_data) && EG(current_execute_data)->func;
+ bool in_executor = PHPDBG_G(in_execution) && EG(current_execute_data) && EG(current_execute_data)->func;
if (in_executor || PHPDBG_G(ops)) {
zend_op_array *ops = in_executor ? &EG(current_execute_data)->func->op_array : PHPDBG_G(ops);
int literal = 0, count = ops->last_literal - 1;
{
size_t used, real, peak_used, peak_real;
zend_mm_heap *orig_heap = NULL;
- zend_bool is_mm;
+ bool is_mm;
if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) {
orig_heap = zend_mm_set_heap(phpdbg_original_heap_sigsafe_mem());
return result;
} /* }}} */
-void phpdbg_print_opline_ex(zend_execute_data *execute_data, zend_bool ignore_flags) /* {{{ */
+void phpdbg_print_opline_ex(zend_execute_data *execute_data, bool ignore_flags) /* {{{ */
{
/* force out a line while stepping so the user knows what is happening */
if (ignore_flags ||
}
} /* }}} */
-void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags) /* {{{ */
+void phpdbg_print_opline(zend_execute_data *execute_data, bool ignore_flags) /* {{{ */
{
phpdbg_print_opline_ex(execute_data, ignore_flags);
} /* }}} */
#include "zend_types.h"
char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op);
-void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags);
-void phpdbg_print_opline_ex(zend_execute_data *execute_data, zend_bool ignore_flags);
+void phpdbg_print_opline(zend_execute_data *execute_data, bool ignore_flags);
+void phpdbg_print_opline_ex(zend_execute_data *execute_data, bool ignore_flags);
typedef struct _phpdbg_oplog_entry phpdbg_oplog_entry;
struct _phpdbg_oplog_entry {
/*
* Do format conversion placing the output in buffer
*/
-static int format_converter(register buffy *odp, const char *fmt, zend_bool escape_xml, va_list ap) {
+static int format_converter(register buffy *odp, const char *fmt, bool escape_xml, va_list ap) {
char *sp;
char *bep;
int cc = 0;
char *s = NULL, *free_s = NULL;
size_t s_len;
- zend_bool free_zcopy;
+ bool free_zcopy;
zval *zvp, zcopy;
int min_width = 0;
return (cc);
}
-static void strx_printv(int *ccp, char *buf, size_t len, const char *format, zend_bool escape_xml, va_list ap) {
+static void strx_printv(int *ccp, char *buf, size_t len, const char *format, bool escape_xml, va_list ap) {
buffy od;
int cc;
}
}
-static int phpdbg_xml_vsnprintf(char *buf, size_t len, const char *format, zend_bool escape_xml, va_list ap) {
+static int phpdbg_xml_vsnprintf(char *buf, size_t len, const char *format, bool escape_xml, va_list ap) {
int cc;
strx_printv(&cc, buf, len, format, escape_xml, ap);
return (cc);
}
-PHPDBG_API int phpdbg_xml_vasprintf(char **buf, const char *format, zend_bool escape_xml, va_list ap) {
+PHPDBG_API int phpdbg_xml_vasprintf(char **buf, const char *format, bool escape_xml, va_list ap) {
va_list ap2;
int cc;
}
}
-PHPDBG_API void phpdbg_activate_err_buf(zend_bool active) {
+PHPDBG_API void phpdbg_activate_err_buf(bool active) {
PHPDBG_G(err_buf).active = active;
}
#endif
PHPDBG_API void phpdbg_free_err_buf(void);
-PHPDBG_API void phpdbg_activate_err_buf(zend_bool active);
+PHPDBG_API void phpdbg_activate_err_buf(bool active);
PHPDBG_API int phpdbg_output_err_buf(const char *tag, const char *xmlfmt, const char *strfmt, ...);
static void phpdbg_print_opcodes_ce(zend_class_entry *ce) {
zend_function *method;
zend_string *method_name;
- zend_bool first = 1;
+ bool first = 1;
phpdbg_out("%s %s: %s\n",
(ce->type == ZEND_USER_CLASS) ?
struct phpdbg_init_state {
int line;
- zend_bool in_code;
+ bool in_code;
char *code;
size_t code_len;
const char *init_file;
}
}
-void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init) /* {{{ */
+void phpdbg_try_file_init(char *init_file, size_t init_file_len, bool free_init) /* {{{ */
{
zend_stat_t sb;
}
} /* }}} */
-void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default) /* {{{ */
+void phpdbg_init(char *init_file, size_t init_file_len, bool use_default) /* {{{ */
{
if (init_file) {
phpdbg_try_file_init(init_file, init_file_len, 1);
}
/* }}} */
-void phpdbg_clean(zend_bool full, zend_bool resubmit) /* {{{ */
+void phpdbg_clean(bool full, bool resubmit) /* {{{ */
{
/* this is implicitly required */
if (PHPDBG_G(ops)) {
{
if (PHPDBG_G(ops) || PHPDBG_G(exec)) {
zend_execute_data *ex = EG(current_execute_data);
- zend_bool restore = 1;
+ bool restore = 1;
if (PHPDBG_G(in_execution)) {
if (phpdbg_ask_user_permission("Do you really want to restart execution?") == SUCCESS) {
PHPDBG_COMMAND(ev) /* {{{ */
{
- zend_bool stepping = ((PHPDBG_G(flags) & PHPDBG_IS_STEPPING) == PHPDBG_IS_STEPPING);
+ bool stepping = ((PHPDBG_G(flags) & PHPDBG_IS_STEPPING) == PHPDBG_IS_STEPPING);
zval retval;
zend_execute_data *original_execute_data = EG(current_execute_data);
return SUCCESS;
} /* }}} */
-int phpdbg_interactive(zend_bool allow_async_unsafe, char *input) /* {{{ */
+int phpdbg_interactive(bool allow_async_unsafe, char *input) /* {{{ */
{
int ret = SUCCESS;
phpdbg_param_t stack;
void phpdbg_execute_ex(zend_execute_data *execute_data) /* {{{ */
{
- zend_bool original_in_execution = PHPDBG_G(in_execution);
+ bool original_in_execution = PHPDBG_G(in_execution);
if ((PHPDBG_G(flags) & PHPDBG_IS_STOPPING) && !(PHPDBG_G(flags) & PHPDBG_IS_RUNNING)) {
zend_bailout();
/* {{{ */
void phpdbg_string_init(char *buffer);
-void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default);
-void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init);
-int phpdbg_interactive(zend_bool allow_async_unsafe, char *input);
+void phpdbg_init(char *init_file, size_t init_file_len, bool use_default);
+void phpdbg_try_file_init(char *init_file, size_t init_file_len, bool free_init);
+int phpdbg_interactive(bool allow_async_unsafe, char *input);
int phpdbg_compile(void);
int phpdbg_compile_stdin(zend_string *code);
void phpdbg_force_interruption(void);
PHPDBG_G(sigsafe_mem).mem = NULL;
}
-zend_bool phpdbg_active_sigsafe_mem(void) {
+bool phpdbg_active_sigsafe_mem(void) {
return !!PHPDBG_G(sigsafe_mem).mem;
}
typedef struct {
char *mem;
- zend_bool allocated;
+ bool allocated;
zend_mm_heap *heap;
zend_mm_heap *old_heap;
} phpdbg_signal_safe_mem;
#include "phpdbg.h"
-zend_bool phpdbg_active_sigsafe_mem(void);
+bool phpdbg_active_sigsafe_mem(void);
void phpdbg_set_sigsafe_mem(char *mem);
void phpdbg_clear_sigsafe_mem(void);
return callback(name, len, keyname, keylen, parent, zv);
}
-PHPDBG_API int phpdbg_parse_variable(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_func callback, zend_bool silent) {
+PHPDBG_API int phpdbg_parse_variable(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_func callback, bool silent) {
return phpdbg_parse_variable_with_arg(input, len, parent, i, (phpdbg_parse_var_with_arg_func) phpdbg_parse_variable_arg_wrapper, NULL, silent, callback);
}
-PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_with_arg_func callback, phpdbg_parse_var_with_arg_func step_cb, zend_bool silent, void *arg) {
+PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_with_arg_func callback, phpdbg_parse_var_with_arg_func step_cb, bool silent, void *arg) {
int ret = FAILURE;
- zend_bool new_index = 1;
+ bool new_index = 1;
char *last_index = NULL;
size_t index_len = 0;
zval *zv;
zend_ulong num;
zval *val;
int (*element_dump_func)(zval *zv, zend_string *key, zend_ulong num);
- zend_bool is_ref = 0;
+ bool is_ref = 0;
phpdbg_try_access {
is_ref = Z_ISREF_P(zv) && GC_REFCOUNT(Z_COUNTED_P(zv)) > 1;
} phpdbg_end_try_access();
}
-PHPDBG_API zend_bool phpdbg_check_caught_ex(zend_execute_data *execute_data, zend_object *exception) {
+PHPDBG_API bool phpdbg_check_caught_ex(zend_execute_data *execute_data, zend_object *exception) {
const zend_op *op;
zend_op *cur;
uint32_t op_num, i;
typedef int (*phpdbg_parse_var_func)(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv);
typedef int (*phpdbg_parse_var_with_arg_func)(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, void *arg);
-PHPDBG_API int phpdbg_parse_variable(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_func callback, zend_bool silent);
-PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_with_arg_func callback, phpdbg_parse_var_with_arg_func step_cb, zend_bool silent, void *arg);
+PHPDBG_API int phpdbg_parse_variable(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_func callback, bool silent);
+PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_with_arg_func callback, phpdbg_parse_var_with_arg_func step_cb, bool silent, void *arg);
int phpdbg_is_auto_global(char *name, int len);
char *phpdbg_short_zval_print(zval *zv, int maxlen);
-PHPDBG_API zend_bool phpdbg_check_caught_ex(zend_execute_data *ex, zend_object *exception);
+PHPDBG_API bool phpdbg_check_caught_ex(zend_execute_data *ex, zend_object *exception);
static zend_always_inline zend_execute_data *phpdbg_user_execute_data(zend_execute_data *ex) {
while (!ex->func || !ZEND_USER_CODE(ex->func->common.type)) {
#define HT_WATCH_HT(watch) HT_PTR_HT((watch)->addr.ptr)
/* ### PRINTING POINTER DIFFERENCES ### */
-zend_bool phpdbg_check_watch_diff(phpdbg_watchtype type, void *oldPtr, void *newPtr) {
+bool phpdbg_check_watch_diff(phpdbg_watchtype type, void *oldPtr, void *newPtr) {
switch (type) {
case WATCH_ON_BUCKET:
if (memcmp(&((Bucket *) oldPtr)->h, &((Bucket *) newPtr)->h, sizeof(Bucket) - sizeof(zval) /* key/val comparison */) != 0) {
return phpdbg_add_watch_element(&watch, element);
}
-zend_bool phpdbg_is_recursively_watched(void *ptr, phpdbg_watch_element *element) {
+bool phpdbg_is_recursively_watched(void *ptr, phpdbg_watch_element *element) {
phpdbg_watch_element *next = element;
do {
element = next;
}
}
-zend_bool phpdbg_try_readding_watch_element(zval *parent, phpdbg_watch_element *element) {
+bool phpdbg_try_readding_watch_element(zval *parent, phpdbg_watch_element *element) {
zval *zv;
HashTable *ht = HT_FROM_ZVP(parent);
return ret;
}
-PHPDBG_API int phpdbg_watchpoint_parse_input(char *input, size_t len, HashTable *parent, size_t i, phpdbg_watch_parse_struct *info, zend_bool silent) {
+PHPDBG_API int phpdbg_watchpoint_parse_input(char *input, size_t len, HashTable *parent, size_t i, phpdbg_watch_parse_struct *info, bool silent) {
return phpdbg_parse_variable_with_arg(input, len, parent, i, (phpdbg_parse_var_with_arg_func) phpdbg_watchpoint_parse_wrapper, NULL, 0, info);
}
HANDLE handle;
char resolved_path_buff[MAXPATHLEN];
size_t resolvedw_len, filespecw_len, index;
- zend_bool might_need_prefix;
+ bool might_need_prefix;
if (!VCWD_REALPATH(dir, resolved_path_buff)) {
return NULL;
wchar_t *filespecw;
HANDLE handle;
size_t dirw_len, filespecw_len, index;
- zend_bool might_need_prefix;
+ bool might_need_prefix;
FindClose(dp->handle);
/* true globals; only used from main thread and from kernel callback */
static zval ctrl_handler;
static DWORD ctrl_evt = (DWORD)-1;
-static zend_bool *vm_interrupt_flag = NULL;
+static bool *vm_interrupt_flag = NULL;
static void (*orig_interrupt_function)(zend_execute_data *execute_data);
{
zend_fcall_info fci;
zend_fcall_info_cache fcc;
- zend_bool add = 1;
+ bool add = 1;
/* callable argument corresponds to the CTRL handler */
PHP_FUNCTION(sapi_windows_generate_ctrl_event)
{/*{{{*/
zend_long evt, pid = 0;
- zend_bool ret = 0;
+ bool ret = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &evt, &pid) == FAILURE) {
RETURN_THROWS();