17#ifndef SECUREPRINTOUTPUT_H_E950DA2C_902F_4B15_BECD_948E99090D9C
18#define SECUREPRINTOUTPUT_H_E950DA2C_902F_4B15_BECD_948E99090D9C
22#ifndef SECUREC_HANDLE_WFORMAT
23#define SECUREC_HANDLE_WFORMAT 1
26#if SECUREC_HANDLE_WFORMAT && defined(__GNUC__) && ((__GNUC__ >= 5) || \
27 (defined(__GNUC_MINOR__) && (__GNUC__ == 4 && __GNUC_MINOR__ > 7)))
29#define SECUREC_MASK_WFORMAT_WARNING _Pragma("GCC diagnostic push") \
30 _Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"")
32#define SECUREC_MASK_WFORMAT_WARNING _Pragma("GCC diagnostic push") \
33 _Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"") \
34 _Pragma("GCC diagnostic ignored \"-Wmissing-format-attribute\"") \
35 _Pragma("GCC diagnostic ignored \"-Wsuggest-attribute=format\"")
37#define SECUREC_END_MASK_WFORMAT_WARNING _Pragma("GCC diagnostic pop")
39#define SECUREC_MASK_WFORMAT_WARNING
40#define SECUREC_END_MASK_WFORMAT_WARNING
43#define SECUREC_MASK_VSPRINTF_WARNING SECUREC_MASK_WFORMAT_WARNING \
44 SECUREC_MASK_MSVC_CRT_WARNING
46#define SECUREC_END_MASK_VSPRINTF_WARNING SECUREC_END_MASK_WFORMAT_WARNING \
47 SECUREC_END_MASK_MSVC_CRT_WARNING
53#define SECUREC_FLAG_SIGN 0x00001U
54#define SECUREC_FLAG_SIGN_SPACE 0x00002U
55#define SECUREC_FLAG_LEFT 0x00004U
56#define SECUREC_FLAG_LEADZERO 0x00008U
57#define SECUREC_FLAG_LONG 0x00010U
58#define SECUREC_FLAG_SHORT 0x00020U
59#define SECUREC_FLAG_SIGNED 0x00040U
60#define SECUREC_FLAG_ALTERNATE 0x00080U
61#define SECUREC_FLAG_NEGATIVE 0x00100U
62#define SECUREC_FLAG_FORCE_OCTAL 0x00200U
63#define SECUREC_FLAG_LONG_DOUBLE 0x00400U
64#define SECUREC_FLAG_WIDECHAR 0x00800U
65#define SECUREC_FLAG_LONGLONG 0x01000U
66#define SECUREC_FLAG_CHAR 0x02000U
67#define SECUREC_FLAG_POINTER 0x04000U
68#define SECUREC_FLAG_I64 0x08000U
69#define SECUREC_FLAG_PTRDIFF 0x10000U
70#define SECUREC_FLAG_SIZE 0x20000U
71#ifdef SECUREC_COMPATIBLE_LINUX_FORMAT
72#define SECUREC_FLAG_INTMAX 0x40000U
88#ifndef SECUREC_BUFFER_SIZE
90#define SECUREC_BUFFER_SIZE 32
91#elif defined(SECUREC_STACK_SIZE_LESS_THAN_1K)
96#define SECUREC_BUFFER_SIZE 256
98#define SECUREC_BUFFER_SIZE 512
101#if SECUREC_BUFFER_SIZE < 23
102#error SECUREC_BUFFER_SIZE Can not be less than 23
105#define SECUREC_WCHAR_BUFFER_SIZE 4
107#define SECUREC_MAX_PRECISION SECUREC_BUFFER_SIZE
109#define SECUREC_MB_LEN 16
111#define SECUREC_PRINTF_TRUNCATE (-2)
113#define SECUREC_VSPRINTF_PARAM_ERROR(format, strDest, destMax, maxLimit) \
114 ((format) == NULL || (strDest) == NULL || (destMax) == 0 || (destMax) > (maxLimit))
116#define SECUREC_VSPRINTF_CLEAR_DEST(strDest, destMax, maxLimit) do { \
117 if ((strDest) != NULL && (destMax) > 0 && (destMax) <= (maxLimit)) { \
122#ifdef SECUREC_COMPATIBLE_WIN_FORMAT
123#define SECUREC_VSNPRINTF_PARAM_ERROR(format, strDest, destMax, count, maxLimit) \
124 (((format) == NULL || (strDest) == NULL || (destMax) == 0 || (destMax) > (maxLimit)) || \
125 ((count) > (SECUREC_STRING_MAX_LEN - 1) && (count) != (size_t)(-1)))
128#define SECUREC_VSNPRINTF_PARAM_ERROR(format, strDest, destMax, count, maxLimit) \
129 (((format) == NULL || (strDest) == NULL || (destMax) == 0 || (destMax) > (maxLimit)) || \
130 ((count) > (SECUREC_STRING_MAX_LEN - 1)))
136#ifdef SECUREC_FOR_WCHAR
137int SecVswprintfImpl(
wchar_t *
string,
size_t count,
const wchar_t *
format, va_list argList);
int format(const char *dev, int sectors, int option)
formatting sd card
int SecVsnprintfImpl(char *string, size_t count, const char *format, va_list argList)
SecFmtState
Definition secureprintoutput.h:76
@ STAT_DOT
Definition secureprintoutput.h:81
@ STAT_TYPE
Definition secureprintoutput.h:84
@ STAT_WIDTH
Definition secureprintoutput.h:80
@ STAT_FLAG
Definition secureprintoutput.h:79
@ STAT_PRECIS
Definition secureprintoutput.h:82
@ STAT_PERCENT
Definition secureprintoutput.h:78
@ STAT_SIZE
Definition secureprintoutput.h:83
@ STAT_INVALID
Definition secureprintoutput.h:85
@ STAT_NORMAL
Definition secureprintoutput.h:77