c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen#ifndef PRINTF_FORMAT_FIX_H
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen#define PRINTF_FORMAT_FIX_H
402f9183489c1a75736b1e9068c33fe2741a366dTimo Sirainen
402f9183489c1a75736b1e9068c33fe2741a366dTimo Sirainen/* Replaces %m in format with strerror(errno) and panics if %n modifier is
5dd05e966ffd69181ab3067f6939b03ced68ebc3Timo Sirainen used. If the format string was modified, it's returned from data stack. */
43d32cbe60fdaef2699d99f1ca259053e9350411Timo Sirainenconst char *printf_format_fix(const char *format) ATTR_FORMAT_ARG(1);
5dd05e966ffd69181ab3067f6939b03ced68ebc3Timo Sirainen/* Like printf_format_fix(), except return also the format string's length. */
2ac5f36aa7c2e7a07ba8815d43a6d7483f62e74cTimo Sirainenconst char *printf_format_fix_get_len(const char *format, size_t *len_r)
43d32cbe60fdaef2699d99f1ca259053e9350411Timo Sirainen ATTR_FORMAT_ARG(1);
5dd05e966ffd69181ab3067f6939b03ced68ebc3Timo Sirainen/* Like printf_format_fix(), except the format string is written to data
5dd05e966ffd69181ab3067f6939b03ced68ebc3Timo Sirainen stack without actually allocating it. Data stack must not be used until
5dd05e966ffd69181ab3067f6939b03ced68ebc3Timo Sirainen format string is no longer needed. */
43d32cbe60fdaef2699d99f1ca259053e9350411Timo Sirainenconst char *printf_format_fix_unsafe(const char *format) ATTR_FORMAT_ARG(1);
402f9183489c1a75736b1e9068c33fe2741a366dTimo Sirainen
402f9183489c1a75736b1e9068c33fe2741a366dTimo Sirainen#endif