printf-format-fix.h revision 43d32cbe60fdaef2699d99f1ca259053e9350411
2454dfa32c93c20a8522c6ed42fe057baaac9f9aStephan Bosch#ifndef PRINTF_FORMAT_FIX_H
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen#define PRINTF_FORMAT_FIX_H
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen/* Replaces %m in format with strerror(errno) and panics if %n modifier is
dfa2201c6ac8ddb2d2798dee15662cfe774e644eMartti Rannanjärvi used. If the format string was modified, it's returned from data stack. */
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainenconst char *printf_format_fix(const char *format) ATTR_FORMAT_ARG(1);
fd8b93ca5cbeba64fe6fa5dc98a3e580fb046791Timo Sirainen/* Like printf_format_fix(), except return also the format string's length. */
472369cba85d9f7c995dda60e7cd01d78b4a960aTimo Sirainenconst char *printf_format_fix_get_len(const char *format, unsigned int *len_r)
e28fa207d1a097fa6e4a867f74ee0761472ef1ceTimo Sirainen ATTR_FORMAT_ARG(1);
37847ec8eaec9ad55c9df10ae109efe7b37ac573Timo Sirainen/* Like printf_format_fix(), except the format string is written to data
bd4e36a8cd7257cca7d1434c49a1e343ed7c5100Timo Sirainen stack without actually allocating it. Data stack must not be used until
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainen format string is no longer needed. */
b1f37113a5760bee842c5a7678bb5fa6f5bd8b60Timo Sirainenconst char *printf_format_fix_unsafe(const char *format) ATTR_FORMAT_ARG(1);
1c1cecd3dfaf71b0c9499b044023e631841e88aaTimo Sirainen
94d8e51119003d2bc5a100c663f90141f297385dTimo Sirainen#endif
9393445a6dabd17ce62ebfc12fd73545b0065824Timo Sirainen