weston/include
Pekka Paalanen 664e882415 libweston: add weston_log_scope_stream()
Printing directly into an stdio stream and hooking up to the flush (the
write callback) avoids having to allocate+free a temporary buffer on
every printing call. The FILE uses a permanent buffer for storing the
text, and once it fills up or a newline is detected, it is flushed out.

It is fine to mix the new and the old APIs, since the old API flushes
the stream.

The buffer size of 3 kB is just a guess.

The man-page for fopencookie() recommends setting _FILE_OFFSET_BITS to
64. Even though this patch does not strictly need it (we don't implement
seek or take the address of fopencookie()), I think it's good to follow
anyway.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-10 16:40:40 +02:00
..
libweston libweston: add weston_log_scope_stream() 2026-03-10 16:40:40 +02:00
meson.build libweston/desktop: Migrate libweston-desktop/libweston-desktop.h 2022-09-23 13:57:26 +03:00