mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
zend_smart_string: Add smart_string_append_printf()
(#18160)
This is for API parity with `smart_str_append_printf()`.
This commit is contained in:
parent
a519a03f63
commit
cff76a98ae
3 changed files with 12 additions and 0 deletions
|
@ -21,6 +21,8 @@ PHP 8.5 INTERNALS UPGRADE NOTES
|
|||
could interfere.
|
||||
. zend_get_callable_name() now returns the name of the underlying function
|
||||
for fake closures.
|
||||
. Added smart_string_append_printf() matching smart_str_append_printf() for
|
||||
char* instead of zend_string*-based smart strings.
|
||||
|
||||
========================
|
||||
2. Build system changes
|
||||
|
|
|
@ -131,6 +131,13 @@ ZEND_API void smart_str_append_printf(smart_str *dest, const char *format, ...)
|
|||
va_end(arg);
|
||||
}
|
||||
|
||||
ZEND_API void smart_string_append_printf(smart_string *dest, const char *format, ...) {
|
||||
va_list arg;
|
||||
va_start(arg, format);
|
||||
zend_printf_to_smart_string(dest, format, arg);
|
||||
va_end(arg);
|
||||
}
|
||||
|
||||
#define SMART_STRING_OVERHEAD (ZEND_MM_OVERHEAD + 1)
|
||||
#define SMART_STRING_START_SIZE 256
|
||||
#define SMART_STRING_START_LEN (SMART_STRING_START_SIZE - SMART_STRING_OVERHEAD)
|
||||
|
|
|
@ -48,6 +48,9 @@
|
|||
#define smart_string_append_unsigned(str, val) \
|
||||
smart_string_append_unsigned_ex((str), (val), 0)
|
||||
|
||||
ZEND_API void smart_string_append_printf(smart_string *dest, const char *format, ...)
|
||||
ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
|
||||
|
||||
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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue