printf: extract clovers printf impl
Also make the code cleaner and simplier. Signed-off-by: Karol Herbst <kherbst@redhat.com> Acked-by: Jesse Natalie <jenatali@microsoft.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17334>
This commit is contained in:
@@ -29,6 +29,13 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct u_printf_info {
|
||||
unsigned num_args;
|
||||
unsigned *arg_sizes;
|
||||
unsigned string_size;
|
||||
char *strings;
|
||||
} u_printf_info;
|
||||
|
||||
/* find next valid printf specifier in a C string wrapper */
|
||||
size_t util_printf_next_spec_pos(const char *str, size_t pos);
|
||||
|
||||
@@ -39,6 +46,9 @@ size_t util_printf_next_spec_pos(const char *str, size_t pos);
|
||||
*/
|
||||
size_t u_printf_length(const char *fmt, va_list untouched_args);
|
||||
|
||||
void u_printf(FILE *out, const char *buffer, size_t buffer_size,
|
||||
const u_printf_info*, unsigned info_size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user