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, zend_string *value, …
36 ZEND_API void ZEND_FASTCALL smart_str_append_scalar(smart_str *str, zval *value, size_t truncate);
39 static zend_always_inline size_t smart_str_alloc(smart_str *str, size_t len, bool persistent) { in END_EXTERN_C()
40 if (UNEXPECTED(!str->s)) { in END_EXTERN_C()
43 len += ZSTR_LEN(str->s); in END_EXTERN_C()
44 if (UNEXPECTED(len >= str->a)) { in END_EXTERN_C()
47 smart_str_realloc(str, len); in END_EXTERN_C()
49 smart_str_erealloc(str, len); in END_EXTERN_C()
68 static zend_always_inline void smart_str_free_ex(smart_str *str, bool persistent) { in smart_str_free_ex() argument
69 if (str->s) { in smart_str_free_ex()
70 zend_string_release_ex(str->s, persistent); in smart_str_free_ex()
71 str->s = NULL; in smart_str_free_ex()
73 str->a = 0; in smart_str_free_ex()
76 static zend_always_inline void smart_str_free(smart_str *str) in smart_str_free() argument
78 smart_str_free_ex(str, false); in smart_str_free()
81 static zend_always_inline void smart_str_0(smart_str *str) { in smart_str_0() argument
82 if (str->s) { in smart_str_0()
83 ZSTR_VAL(str->s)[ZSTR_LEN(str->s)] = '\0'; in smart_str_0() local
87 static zend_always_inline size_t smart_str_get_len(smart_str *str) { in smart_str_get_len() argument
88 return str->s ? ZSTR_LEN(str->s) : 0; in smart_str_get_len()
91 static zend_always_inline void smart_str_trim_to_size_ex(smart_str *str, bool persistent) in smart_str_trim_to_size_ex() argument
93 if (str->s && str->a > ZSTR_LEN(str->s)) { in smart_str_trim_to_size_ex()
94 str->s = zend_string_realloc(str->s, ZSTR_LEN(str->s), persistent); in smart_str_trim_to_size_ex()
95 str->a = ZSTR_LEN(str->s); in smart_str_trim_to_size_ex()
104 static zend_always_inline zend_string *smart_str_extract_ex(smart_str *str, bool persistent) { in smart_str_extract_ex() argument
105 if (str->s) { in smart_str_extract_ex()
107 smart_str_0(str); in smart_str_extract_ex()
108 smart_str_trim_to_size_ex(str, persistent); in smart_str_extract_ex()
109 res = str->s; in smart_str_extract_ex()
110 str->s = NULL; in smart_str_extract_ex()
128 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
130 memcpy(ZSTR_VAL(dest->s) + ZSTR_LEN(dest->s), str, len); in smart_str_appendl_ex()