We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3578 - Is possible to implement stdarg output into SDL_RWops (vfprintf-like output) natively without middle buffers?
Summary: Is possible to implement stdarg output into SDL_RWops (vfprintf-like output) ...
Status: ASSIGNED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.1
Hardware: All All
: P2 minor
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-02 08:55 UTC by Vitaly Novichkov
Modified: 2019-11-21 11:10 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vitaly Novichkov 2017-02-02 08:55:21 UTC
I had my own logger based on usage of vfprintf function which prints output log into the file with arguments sending into it without having extra buffer until I will send it into the stream. I trying to use SDL_RWops because of native UTF8 support in file paths (however, manual getting the FILE* descriptor from utf8 path is easy, but requires extra function calls on Windows to convert into UTF16 until I'll be able to call _wfopen()).

Would be cool if we can have SDL_RWprintV()-like function which receives format string with va_list thing which also would be useful to send formatted string DIRECTLY into real file stream without any middle buffers. The implementation I made over existing API uses vsnprintf with a middle buffer which is not a good solution (especially in a case when is needed to send buffer data directly into file stream).

Note: I know about SDL_Log, but because of 4096 buffer size limit in some cases may be not good. I also using logger to store crash dumps (which are may have any size)
Comment 1 Sam Lantinga 2017-08-11 17:56:55 UTC
Yes, this is a good idea for SDL 2.1