Lines Matching refs:str
26 ZEND_API void ZEND_FASTCALL smart_str_erealloc(smart_str *str, size_t len);
27 ZEND_API void ZEND_FASTCALL smart_str_realloc(smart_str *str, size_t len);
28 ZEND_API void ZEND_FASTCALL smart_str_append_escaped(smart_str *str, const char *s, size_t l);
32 smart_str *str, double num, int precision, bool zero_fraction);
35 ZEND_API void ZEND_FASTCALL smart_str_append_escaped_truncated(smart_str *str, const zend_string *v…
36 ZEND_API void ZEND_FASTCALL smart_str_append_scalar(smart_str *str, const zval *value, size_t trunc…
40 static zend_always_inline size_t smart_str_alloc(smart_str *str, size_t len, bool persistent) { in END_EXTERN_C()
41 if (UNEXPECTED(!str->s)) { in END_EXTERN_C()
44 len += ZSTR_LEN(str->s); in END_EXTERN_C()
45 if (UNEXPECTED(len >= str->a)) { in END_EXTERN_C()
48 smart_str_realloc(str, len); in END_EXTERN_C()
50 smart_str_erealloc(str, len); in END_EXTERN_C()
69 static zend_always_inline void smart_str_free_ex(smart_str *str, bool persistent) { in smart_str_free_ex() argument
70 if (str->s) { in smart_str_free_ex()
71 zend_string_release_ex(str->s, persistent); in smart_str_free_ex()
72 str->s = NULL; in smart_str_free_ex()
74 str->a = 0; in smart_str_free_ex()
77 static zend_always_inline void smart_str_free(smart_str *str) in smart_str_free() argument
79 smart_str_free_ex(str, false); in smart_str_free()
82 static zend_always_inline void smart_str_0(smart_str *str) { in smart_str_0() argument
83 if (str->s) { in smart_str_0()
84 ZSTR_VAL(str->s)[ZSTR_LEN(str->s)] = '\0'; in smart_str_0() local
88 static zend_always_inline size_t smart_str_get_len(smart_str *str) { in smart_str_get_len() argument
89 return str->s ? ZSTR_LEN(str->s) : 0; in smart_str_get_len()
92 static zend_always_inline void smart_str_trim_to_size_ex(smart_str *str, bool persistent) in smart_str_trim_to_size_ex() argument
94 if (str->s && str->a > ZSTR_LEN(str->s)) { in smart_str_trim_to_size_ex()
95 str->s = zend_string_realloc(str->s, ZSTR_LEN(str->s), persistent); in smart_str_trim_to_size_ex()
96 str->a = ZSTR_LEN(str->s); in smart_str_trim_to_size_ex()
105 static zend_always_inline zend_string *smart_str_extract_ex(smart_str *str, bool persistent) { in smart_str_extract_ex() argument
106 if (str->s) { in smart_str_extract_ex()
108 smart_str_0(str); in smart_str_extract_ex()
109 smart_str_trim_to_size_ex(str, persistent); in smart_str_extract_ex()
110 res = str->s; in smart_str_extract_ex()
111 str->s = NULL; in smart_str_extract_ex()
129 static zend_always_inline void smart_str_appendl_ex(smart_str *dest, const char *str, size_t len, b… in smart_str_appendl_ex() argument
131 memcpy(ZSTR_VAL(dest->s) + ZSTR_LEN(dest->s), str, len); in smart_str_appendl_ex()