return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
+
ZEND_API int add_u_assoc_stringl_ex(zval *arg, zend_uchar type, zstr key, uint key_len, char *str, uint length, int duplicate)
{
zval *tmp;
return zend_u_symtable_update(Z_ARRVAL_P(arg), type, key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
+
ZEND_API int add_assoc_unicode_ex(zval *arg, char *key, uint key_len, UChar *str, int duplicate)
{
zval *tmp;
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
+ZEND_API int add_assoc_utf8_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate)
+{
+ zval *tmp;
+
+ MAKE_STD_ZVAL(tmp);
+ ZVAL_UTF8_STRINGL(tmp, str, length, duplicate);
+
+ return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
+}
+
+ZEND_API int add_u_assoc_utf8_stringl_ex(zval *arg, zend_uchar type, zstr key, uint key_len, char *str, uint length, int duplicate)
+{
+ zval *tmp;
+
+ MAKE_STD_ZVAL(tmp);
+ ZVAL_UTF8_STRINGL(tmp, str, length, duplicate);
+
+ return zend_u_symtable_update(Z_ARRVAL_P(arg), type, key, key_len, (void *) &tmp, sizeof(zval *), NULL);
+}
+
ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value)
{
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &value, sizeof(zval *), NULL);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &value, sizeof(zval *), NULL);
}
+ZEND_API int add_index_utf8_string(zval *arg, ulong index, char *str, int duplicate)
+{
+ zval *tmp;
+
+ MAKE_STD_ZVAL(tmp);
+ ZVAL_UTF8_STRING(tmp, str, duplicate);
+
+ return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
+}
+
+
+ZEND_API int add_index_utf8_stringl(zval *arg, ulong index, char *str, uint length, int duplicate)
+{
+ zval *tmp;
+
+ MAKE_STD_ZVAL(tmp);
+ ZVAL_UTF8_STRINGL(tmp, str, length, duplicate);
+
+ return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
+}
+
ZEND_API int add_next_index_long(zval *arg, long n)
{
add_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
}
-#define add_assoc_utf8_string_ex(arg, key, key_len, str, flags) \
- { \
- UErrorCode status = U_ZERO_ERROR; \
- UChar *u_str; \
- int u_len; \
- int length = strlen(str); \
- zend_string_to_unicode_ex(UG(utf8_conv), &u_str, &u_len, str, length, &status); \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- add_assoc_unicodel_ex(arg, key, key_len, u_str, u_len, 0); \
- }
-
-#define add_assoc_utf8_stringl_ex(arg, key, key_len, str, length, flags) \
- { \
- UErrorCode status = U_ZERO_ERROR; \
- UChar *u_str; \
- int u_len; \
- zend_string_to_unicode_ex(UG(utf8_conv), &u_str, &u_len, str, length, &status); \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- add_assoc_unicodel_ex(arg, key, key_len, u_str, u_len, 0); \
- }
-
#define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key)+1, __n)
#define add_assoc_null(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key) + 1)
#define add_assoc_bool(__arg, __key, __b) add_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b)