Lines Matching refs:buffer
111 typedef void (*out_fct_type)(char character, void *buffer, size_t idx, size_t maxlen);
118 static int (*lazy_vsnprintf)(out_fct_type out, char *buffer, const size_t maxlen, const char *forma…
128 static inline void _out_buffer(char character, void *buffer, size_t idx, size_t maxlen) { in _out_buffer() argument
130 ((char *) buffer)[idx] = character; in _out_buffer()
135 static inline void _out_null(char character, void *buffer, size_t idx, size_t maxlen) { in _out_null() argument
137 (void) buffer; in _out_null()
143 static inline void _out_fct(char character, void *buffer, size_t idx, size_t maxlen) { in _out_fct() argument
148 ((out_fct_wrap_type *) buffer)->fct(character, ((out_fct_wrap_type *) buffer)->arg); in _out_fct()
180 static size_t _out_rev(out_fct_type out, char *buffer, size_t idx, size_t maxlen, const char *buf, … in _out_rev() argument
187 out(' ', buffer, idx++, maxlen); in _out_rev()
193 out(buf[--len], buffer, idx++, maxlen); in _out_rev()
199 out(' ', buffer, idx++, maxlen); in _out_rev()
208 static size_t _ntoa_format(out_fct_type out, char *buffer, size_t idx, size_t maxlen, char *buf, si… in _ntoa_format() argument
254 return _out_rev(out, buffer, idx, maxlen, buf, len, width, flags); in _ntoa_format()
259 static size_t _ntoa_long(out_fct_type out, char *buffer, size_t idx, size_t maxlen, unsigned long v… in _ntoa_long() argument
278 …return _ntoa_format(out, buffer, idx, maxlen, buf, len, negative, (unsigned int) base, prec, width… in _ntoa_long()
285 static size_t _ntoa_long_long(out_fct_type out, char *buffer, size_t idx, size_t maxlen, unsigned l… in _ntoa_long_long() argument
305 …return _ntoa_format(out, buffer, idx, maxlen, buf, len, negative, (unsigned int) base, prec, width… in _ntoa_long_long()
315 static size_t _etoa(out_fct_type out, char *buffer, size_t idx, size_t maxlen, double value, unsign…
322 static size_t _ftoa(out_fct_type out, char *buffer, size_t idx, size_t maxlen, double value, unsign… in _ftoa() argument
333 return _out_rev(out, buffer, idx, maxlen, "nan", 3, width, flags); in _ftoa()
335 return _out_rev(out, buffer, idx, maxlen, "fni-", 4, width, flags); in _ftoa()
337 …return _out_rev(out, buffer, idx, maxlen, (flags & FLAGS_PLUS) ? "fni+" : "fni", (flags & FLAGS_PL… in _ftoa()
344 return _etoa(out, buffer, idx, maxlen, value, prec, width, flags); in _ftoa()
440 return _out_rev(out, buffer, idx, maxlen, buf, len, width, flags); in _ftoa()
447 static size_t _etoa(out_fct_type out, char *buffer, size_t idx, size_t maxlen, double value, unsign… in _etoa() argument
451 return _ftoa(out, buffer, idx, maxlen, value, prec, width, flags); in _etoa()
540 …idx = _ftoa(out, buffer, idx, maxlen, negative ? -value : value, prec, fwidth, flags & ~FLAGS_ADAP… in _etoa()
545 out((flags & FLAGS_UPPERCASE) ? 'E' : 'e', buffer, idx++, maxlen); in _etoa()
547 …idx = _ntoa_long(out, buffer, idx, maxlen, (uint)((expval < 0) ? -expval : expval), expval < 0, 10… in _etoa()
551 while (idx - start_idx < width) out(' ', buffer, idx++, maxlen); in _etoa()
561 static int _vsnprintf(out_fct_type out, char *buffer, const size_t maxlen, const char *format, va_l… in _vsnprintf() argument
568 if (!buffer) { in _vsnprintf()
577 out(*format, buffer, idx++, maxlen); in _vsnprintf()
727 idx = _ntoa_long_long(out, buffer, idx, maxlen, in _vsnprintf()
733 … idx = _ntoa_long(out, buffer, idx, maxlen, (unsigned long) (value > 0 ? value : 0 - value), in _vsnprintf()
739 … idx = _ntoa_long(out, buffer, idx, maxlen, (unsigned int) (value > 0 ? value : 0 - value), in _vsnprintf()
746 … idx = _ntoa_long_long(out, buffer, idx, maxlen, va_arg(va, unsigned long long), false, base, in _vsnprintf()
750 … idx = _ntoa_long(out, buffer, idx, maxlen, va_arg(va, unsigned long), false, base, precision, in _vsnprintf()
758 … idx = _ntoa_long(out, buffer, idx, maxlen, value, false, base, precision, width, flags); in _vsnprintf()
768 idx = _ftoa(out, buffer, idx, maxlen, va_arg(va, double), precision, width, flags); in _vsnprintf()
770 for(int i=0;i<2;i++) out('?', buffer, idx++, maxlen); in _vsnprintf()
782 idx = _etoa(out, buffer, idx, maxlen, va_arg(va, double), precision, width, flags); in _vsnprintf()
784 for(int i=0;i<2;i++) out('?', buffer, idx++, maxlen); in _vsnprintf()
794 out(' ', buffer, idx++, maxlen); in _vsnprintf()
798 out((char) va_arg(va, int), buffer, idx++, maxlen); in _vsnprintf()
802 out(' ', buffer, idx++, maxlen); in _vsnprintf()
818 out(' ', buffer, idx++, maxlen); in _vsnprintf()
823 out(*(p++), buffer, idx++, maxlen); in _vsnprintf()
828 out(' ', buffer, idx++, maxlen); in _vsnprintf()
841 … idx = _ntoa_long_long(out, buffer, idx, maxlen, (uintptr_t) va_arg(va, void*), false, 16U, in _vsnprintf()
845 … idx = _ntoa_long(out, buffer, idx, maxlen, (unsigned long) ((uintptr_t) va_arg(va, void*)), false, in _vsnprintf()
855 out('%', buffer, idx++, maxlen); in _vsnprintf()
860 out(*format, buffer, idx++, maxlen); in _vsnprintf()
867 out((char) 0, buffer, idx < maxlen ? idx : maxlen - 1U, maxlen); in _vsnprintf()
876 int WRAPPER_FUNC(sprintf)(char *buffer, const char *format, ...) { in WRAPPER_FUNC()
879 const int ret = _vsnprintf(_out_buffer, buffer, (size_t) -1, format, va); in WRAPPER_FUNC()
884 int WRAPPER_FUNC(snprintf)(char *buffer, size_t count, const char *format, ...) { in WRAPPER_FUNC()
887 const int ret = _vsnprintf(_out_buffer, buffer, count, format, va); in WRAPPER_FUNC()
892 int WRAPPER_FUNC(vsnprintf)(char *buffer, size_t count, const char *format, va_list va) { in WRAPPER_FUNC()
893 return _vsnprintf(_out_buffer, buffer, count, format, va); in WRAPPER_FUNC()
913 static inline void _out_char(char character, void *buffer, size_t idx, size_t maxlen) { in _out_char() argument
914 (void) buffer; in _out_char()
932 char buffer[1]; in weak_raw_vprintf() local
933 lazy_vsnprintf(_out_char, buffer, (size_t) -1, fmt, args); in weak_raw_vprintf()