summaryrefslogtreecommitdiff
path: root/Zend/zend_API.h
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_API.h')
-rw-r--r--Zend/zend_API.h112
1 files changed, 56 insertions, 56 deletions
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 0fceb42a44..7f61431e2f 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -303,15 +303,15 @@ ZEND_API int zend_get_module_started(const char *module_name);
ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, zval *property, int access_type, zend_string *doc_comment TSRMLS_DC);
ZEND_API int zend_declare_property(zend_class_entry *ce, const char *name, int name_length, zval *property, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_null(zend_class_entry *ce, const char *name, int name_length, int access_type TSRMLS_DC);
-ZEND_API int zend_declare_property_bool(zend_class_entry *ce, const char *name, int name_length, long value, int access_type TSRMLS_DC);
-ZEND_API int zend_declare_property_long(zend_class_entry *ce, const char *name, int name_length, long value, int access_type TSRMLS_DC);
+ZEND_API int zend_declare_property_bool(zend_class_entry *ce, const char *name, int name_length, zend_int_t value, int access_type TSRMLS_DC);
+ZEND_API int zend_declare_property_int(zend_class_entry *ce, const char *name, int name_length, zend_int_t value, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_double(zend_class_entry *ce, const char *name, int name_length, double value, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_string(zend_class_entry *ce, const char *name, int name_length, const char *value, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, const char *name, int name_length, const char *value, int value_len, int access_type TSRMLS_DC);
ZEND_API int zend_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value TSRMLS_DC);
ZEND_API int zend_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length TSRMLS_DC);
-ZEND_API int zend_declare_class_constant_long(zend_class_entry *ce, const char *name, size_t name_length, long value TSRMLS_DC);
+ZEND_API int zend_declare_class_constant_int(zend_class_entry *ce, const char *name, size_t name_length, zend_int_t value TSRMLS_DC);
ZEND_API int zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_bool value TSRMLS_DC);
ZEND_API int zend_declare_class_constant_double(zend_class_entry *ce, const char *name, size_t name_length, double value TSRMLS_DC);
ZEND_API int zend_declare_class_constant_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_length TSRMLS_DC);
@@ -320,8 +320,8 @@ ZEND_API int zend_declare_class_constant_string(zend_class_entry *ce, const char
ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC);
ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, const char *name, int name_length, zval *value TSRMLS_DC);
ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, const char *name, int name_length TSRMLS_DC);
-ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, const char *name, int name_length, long value TSRMLS_DC);
-ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, const char *name, int name_length, long value TSRMLS_DC);
+ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, const char *name, int name_length, zend_int_t value TSRMLS_DC);
+ZEND_API void zend_update_property_int(zend_class_entry *scope, zval *object, const char *name, int name_length, zend_int_t value TSRMLS_DC);
ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, const char *name, int name_length, double value TSRMLS_DC);
ZEND_API void zend_update_property_str(zend_class_entry *scope, zval *object, const char *name, int name_length, zend_string *value TSRMLS_DC);
ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, const char *name, int name_length, const char *value TSRMLS_DC);
@@ -329,8 +329,8 @@ ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object
ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, int name_length, zval *value TSRMLS_DC);
ZEND_API int zend_update_static_property_null(zend_class_entry *scope, const char *name, int name_length TSRMLS_DC);
-ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, const char *name, int name_length, long value TSRMLS_DC);
-ZEND_API int zend_update_static_property_long(zend_class_entry *scope, const char *name, int name_length, long value TSRMLS_DC);
+ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, const char *name, int name_length, zend_int_t value TSRMLS_DC);
+ZEND_API int zend_update_static_property_int(zend_class_entry *scope, const char *name, int name_length, zend_int_t value TSRMLS_DC);
ZEND_API int zend_update_static_property_double(zend_class_entry *scope, const char *name, int name_length, double value TSRMLS_DC);
ZEND_API int zend_update_static_property_string(zend_class_entry *scope, const char *name, int name_length, const char *value TSRMLS_DC);
ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, const char *name, int name_length, const char *value, int value_length TSRMLS_DC);
@@ -374,7 +374,7 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties TSRMLS_DC);
/* no longer supported */
ZEND_API int add_assoc_function(zval *arg, const char *key, void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS));
-ZEND_API int add_assoc_long_ex(zval *arg, const char *key, uint key_len, long n);
+ZEND_API int add_assoc_int_ex(zval *arg, const char *key, uint key_len, zend_int_t n);
ZEND_API int add_assoc_null_ex(zval *arg, const char *key, uint key_len);
ZEND_API int add_assoc_bool_ex(zval *arg, const char *key, uint key_len, int b);
ZEND_API int add_assoc_resource_ex(zval *arg, const char *key, uint key_len, zend_resource *r);
@@ -384,7 +384,7 @@ ZEND_API int add_assoc_string_ex(zval *arg, const char *key, uint key_len, char
ZEND_API int add_assoc_stringl_ex(zval *arg, const char *key, uint key_len, char *str, uint length);
ZEND_API int add_assoc_zval_ex(zval *arg, const char *key, uint key_len, zval *value);
-#define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key), __n)
+#define add_assoc_int(__arg, __key, __n) add_assoc_int_ex(__arg, __key, strlen(__key), __n)
#define add_assoc_null(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key))
#define add_assoc_bool(__arg, __key, __b) add_assoc_bool_ex(__arg, __key, strlen(__key), __b)
#define add_assoc_resource(__arg, __key, __r) add_assoc_resource_ex(__arg, __key, strlen(__key), __r)
@@ -400,17 +400,17 @@ ZEND_API int add_assoc_zval_ex(zval *arg, const char *key, uint key_len, zval *v
#define add_next_index_unset(__arg) add_next_index_null(__arg)
#define add_property_unset(__arg, __key) add_property_null(__arg, __key)
-ZEND_API int add_index_long(zval *arg, ulong idx, long n);
-ZEND_API int add_index_null(zval *arg, ulong idx);
-ZEND_API int add_index_bool(zval *arg, ulong idx, int b);
-ZEND_API int add_index_resource(zval *arg, ulong idx, zend_resource *r);
-ZEND_API int add_index_double(zval *arg, ulong idx, double d);
-ZEND_API int add_index_str(zval *arg, ulong idx, zend_string *str);
-ZEND_API int add_index_string(zval *arg, ulong idx, const char *str);
-ZEND_API int add_index_stringl(zval *arg, ulong idx, const char *str, uint length);
-ZEND_API int add_index_zval(zval *arg, ulong index, zval *value);
-
-ZEND_API int add_next_index_long(zval *arg, long n);
+ZEND_API int add_index_int(zval *arg, zend_uint_t idx, zend_int_t n);
+ZEND_API int add_index_null(zval *arg, zend_uint_t idx);
+ZEND_API int add_index_bool(zval *arg, zend_uint_t idx, int b);
+ZEND_API int add_index_resource(zval *arg, zend_uint_t idx, zend_resource *r);
+ZEND_API int add_index_double(zval *arg, zend_uint_t idx, double d);
+ZEND_API int add_index_str(zval *arg, zend_uint_t idx, zend_string *str);
+ZEND_API int add_index_string(zval *arg, zend_uint_t idx, const char *str);
+ZEND_API int add_index_stringl(zval *arg, zend_uint_t idx, const char *str, uint length);
+ZEND_API int add_index_zval(zval *arg, zend_uint_t index, zval *value);
+
+ZEND_API int add_next_index_int(zval *arg, zend_int_t n);
ZEND_API int add_next_index_null(zval *arg);
ZEND_API int add_next_index_bool(zval *arg, int b);
ZEND_API int add_next_index_resource(zval *arg, zend_resource *r);
@@ -426,17 +426,17 @@ ZEND_API zval *add_get_assoc_stringl_ex(zval *arg, const char *key, uint key_len
#define add_get_assoc_string(__arg, __key, __str) add_get_assoc_string_ex(__arg, __key, strlen(__key), __str)
#define add_get_assoc_stringl(__arg, __key, __str, __length) add_get_assoc_stringl_ex(__arg, __key, strlen(__key), __str, __length)
-ZEND_API zval *add_get_index_long(zval *arg, ulong idx, long l);
-ZEND_API zval *add_get_index_double(zval *arg, ulong idx, double d);
-ZEND_API zval *add_get_index_str(zval *arg, ulong index, zend_string *str);
-ZEND_API zval *add_get_index_string(zval *arg, ulong idx, const char *str);
-ZEND_API zval *add_get_index_stringl(zval *arg, ulong idx, const char *str, uint length);
+ZEND_API zval *add_get_index_int(zval *arg, zend_uint_t idx, zend_int_t l);
+ZEND_API zval *add_get_index_double(zval *arg, zend_uint_t idx, double d);
+ZEND_API zval *add_get_index_str(zval *arg, zend_uint_t index, zend_string *str);
+ZEND_API zval *add_get_index_string(zval *arg, zend_uint_t idx, const char *str);
+ZEND_API zval *add_get_index_stringl(zval *arg, zend_uint_t idx, const char *str, uint length);
ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value TSRMLS_DC);
-ZEND_API int add_property_long_ex(zval *arg, const char *key, uint key_len, long l TSRMLS_DC);
+ZEND_API int add_property_int_ex(zval *arg, const char *key, uint key_len, zend_int_t l TSRMLS_DC);
ZEND_API int add_property_null_ex(zval *arg, const char *key, uint key_len TSRMLS_DC);
-ZEND_API int add_property_bool_ex(zval *arg, const char *key, uint key_len, int b TSRMLS_DC);
+ZEND_API int add_property_bool_ex(zval *arg, const char *key, uint key_len, zend_int_t b TSRMLS_DC);
ZEND_API int add_property_resource_ex(zval *arg, const char *key, uint key_len, zend_resource *r TSRMLS_DC);
ZEND_API int add_property_double_ex(zval *arg, const char *key, uint key_len, double d TSRMLS_DC);
ZEND_API int add_property_str_ex(zval *arg, const char *key, uint key_len, zend_string *str TSRMLS_DC);
@@ -444,7 +444,7 @@ ZEND_API int add_property_string_ex(zval *arg, const char *key, uint key_len, co
ZEND_API int add_property_stringl_ex(zval *arg, const char *key, uint key_len, const char *str, uint length TSRMLS_DC);
ZEND_API int add_property_zval_ex(zval *arg, const char *key, uint key_len, zval *value TSRMLS_DC);
-#define add_property_long(__arg, __key, __n) add_property_long_ex(__arg, __key, strlen(__key), __n TSRMLS_CC)
+#define add_property_int(__arg, __key, __n) add_property_int_ex(__arg, __key, strlen(__key), __n TSRMLS_CC)
#define add_property_null(__arg, __key) add_property_null_ex(__arg, __key, strlen(__key) TSRMLS_CC)
#define add_property_bool(__arg, __key, __b) add_property_bool_ex(__arg, __key, strlen(__key), __b TSRMLS_CC)
#define add_property_resource(__arg, __key, __r) add_property_resource_ex(__arg, __key, strlen(__key), __r TSRMLS_CC)
@@ -547,7 +547,7 @@ END_EXTERN_C()
#define CHECK_ZVAL_STRING_REL(z)
#endif
-#define CHECK_ZVAL_NULL_PATH(p) (Z_STRLEN_P(p) != strlen(Z_STRVAL_P(p)))
+#define CHECK_ZVAL_NULL_PATH(p) (Z_STRSIZE_P(p) != strlen(Z_STRVAL_P(p)))
#define CHECK_NULL_PATH(p, l) (strlen(p) != l)
#define ZVAL_STRINGL(z, s, l) do { \
@@ -598,7 +598,7 @@ END_EXTERN_C()
#define RETVAL_BOOL(b) ZVAL_BOOL(return_value, b)
#define RETVAL_NULL() ZVAL_NULL(return_value)
-#define RETVAL_LONG(l) ZVAL_LONG(return_value, l)
+#define RETVAL_INT(l) ZVAL_INT(return_value, l)
#define RETVAL_DOUBLE(d) ZVAL_DOUBLE(return_value, d)
#define RETVAL_STR(s) ZVAL_STR(return_value, s)
#define RETVAL_INT_STR(s) ZVAL_INT_STR(return_value, s)
@@ -614,7 +614,7 @@ END_EXTERN_C()
#define RETURN_BOOL(b) { RETVAL_BOOL(b); return; }
#define RETURN_NULL() { RETVAL_NULL(); return;}
-#define RETURN_LONG(l) { RETVAL_LONG(l); return; }
+#define RETURN_INT(l) { RETVAL_INT(l); return; }
#define RETURN_DOUBLE(d) { RETVAL_DOUBLE(d); return; }
#define RETURN_STR(s) { RETVAL_STR(s); return; }
#define RETURN_INT_STR(s) { RETVAL_INT_STR(s); return; }
@@ -899,28 +899,28 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
Z_PARAM_ARRAY_OR_OBJECT_HT_EX(dest, 0, 0)
/* old "l" */
-#define Z_PARAM_LONG_EX(dest, is_null, check_null, separate) \
+#define Z_PARAM_INT_EX(dest, is_null, check_null, separate) \
Z_PARAM_PROLOGUE(separate); \
- if (UNEXPECTED(!_z_param_long(_arg, &dest, &is_null, check_null, 0))) { \
+ if (UNEXPECTED(!_z_param_int(_arg, &dest, &is_null, check_null, 0))) { \
_expected_type = Z_EXPECTED_LONG; \
error_code = ZPP_ERROR_WRONG_ARG; \
break; \
}
-#define Z_PARAM_LONG(dest) \
- Z_PARAM_LONG_EX(dest, _dummy, 0, 0)
+#define Z_PARAM_INT(dest) \
+ Z_PARAM_INT_EX(dest, _dummy, 0, 0)
/* old "L" */
-#define Z_PARAM_STRICT_LONG_EX(dest, is_null, check_null, separate) \
+#define Z_PARAM_STRICT_INT_EX(dest, is_null, check_null, separate) \
Z_PARAM_PROLOGUE(separate); \
- if (UNEXPECTED(!_z_param_long(_arg, &dest, &is_null, check_null, 1))) { \
+ if (UNEXPECTED(!_z_param_int(_arg, &dest, &is_null, check_null, 1))) { \
_expected_type = Z_EXPECTED_LONG; \
error_code = ZPP_ERROR_WRONG_ARG; \
break; \
}
-#define Z_PARAM_STRICT_LONG(dest) \
- Z_PARAM_STRICT_LONG_EX(dest, _dummy, 0, 0)
+#define Z_PARAM_STRICT_INT(dest) \
+ Z_PARAM_STRICT_INT_EX(dest, _dummy, 0, 0)
/* old "o" */
#define Z_PARAM_OBJECT_EX(dest, check_null, separate) \
@@ -1073,33 +1073,33 @@ static zend_always_inline int _z_param_bool(zval *arg, zend_bool *dest, zend_boo
return 1;
}
-static zend_always_inline int _z_param_long(zval *arg, long *dest, zend_bool *is_null, int check_null, int strict)
+static zend_always_inline int _z_param_int(zval *arg, zend_int_t *dest, zend_bool *is_null, int check_null, int strict)
{
if (check_null) {
*is_null = 0;
}
- if (EXPECTED(Z_TYPE_P(arg) == IS_LONG)) {
- *dest = Z_LVAL_P(arg);
+ if (EXPECTED(Z_TYPE_P(arg) == IS_INT)) {
+ *dest = Z_IVAL_P(arg);
} else if (EXPECTED(Z_TYPE_P(arg) == IS_DOUBLE)) {
- if (strict && UNEXPECTED(Z_DVAL_P(arg) > LONG_MAX)) {
- *dest = LONG_MAX;
- } else if (strict && UNEXPECTED(Z_DVAL_P(arg) < LONG_MIN)) {
- *dest = LONG_MIN;
+ if (strict && UNEXPECTED(Z_DVAL_P(arg) > ZEND_INT_MAX)) {
+ *dest = ZEND_INT_MAX;
+ } else if (strict && UNEXPECTED(Z_DVAL_P(arg) < ZEND_INT_MIN)) {
+ *dest = ZEND_INT_MIN;
} else {
- *dest = zend_dval_to_lval(Z_DVAL_P(arg));
+ *dest = zend_dval_to_ival(Z_DVAL_P(arg));
}
} else if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) {
double d;
int type;
- if (UNEXPECTED((type = is_numeric_str_function(Z_STR_P(arg), dest, &d)) != IS_LONG)) {
+ if (UNEXPECTED((type = is_numeric_str_function(Z_STR_P(arg), dest, &d)) != IS_INT)) {
if (EXPECTED(type != 0)) {
- if (strict && UNEXPECTED(d > LONG_MAX)) {
- *dest = LONG_MAX;
- } else if (strict && UNEXPECTED(d < LONG_MIN)) {
- *dest = LONG_MIN;
+ if (strict && UNEXPECTED(d > ZEND_INT_MAX)) {
+ *dest = ZEND_INT_MAX;
+ } else if (strict && UNEXPECTED(d < ZEND_INT_MIN)) {
+ *dest = ZEND_INT_MIN;
} else {
- *dest = zend_dval_to_lval(d);
+ *dest = zend_dval_to_ival(d);
}
} else {
return 0;
@@ -1125,10 +1125,10 @@ static zend_always_inline int _z_param_double(zval *arg, double *dest, zend_bool
}
if (EXPECTED(Z_TYPE_P(arg) == IS_DOUBLE)) {
*dest = Z_DVAL_P(arg);
- } else if (EXPECTED(Z_TYPE_P(arg) == IS_LONG)) {
- *dest = (double)Z_LVAL_P(arg);
+ } else if (EXPECTED(Z_TYPE_P(arg) == IS_INT)) {
+ *dest = (double)Z_IVAL_P(arg);
} else if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) {
- long l;
+ zend_int_t l;
int type;
if (UNEXPECTED((type = is_numeric_str_function(Z_STR_P(arg), &l, dest)) != IS_DOUBLE)) {