#include <stdio.h>
#include <stdarg.h>
#include <tchar.h>
#include <strings.h>
#include <math.h>
#include <float.h>
Go to the source code of this file.
|
enum | {
FLAG_ALIGN_LEFT = 0x01,
FLAG_FORCE_SIGN = 0x02,
FLAG_FORCE_SIGNSP = 0x04,
FLAG_PAD_ZERO = 0x08,
FLAG_SPECIAL = 0x10,
FLAG_SHORT = 0x100,
FLAG_LONG = 0x200,
FLAG_WIDECHAR = FLAG_LONG,
FLAG_INT64 = 0x400,
FLAG_INTPTR = 0,
FLAG_LONGDOUBLE = 0x800
} |
|
|
int | mbtowc (wchar_t *wchar, const char *mbchar, size_t count) |
|
int | wctomb (char *mbchar, wchar_t wchar) |
|
void | format_float (TCHAR chr, unsigned int flags, int precision, TCHAR **string, const TCHAR **prefix, va_list *argptr) |
|
static int | streamout_char (FILE *stream, int chr) |
|
static int | streamout_astring (FILE *stream, const char *string, size_t count) |
|
static int | streamout_wstring (FILE *stream, const wchar_t *string, size_t count) |
|
int __cdecl | streamout (FILE *stream, const TCHAR *format, va_list argptr) |
|
◆ BUFFER_SIZE
◆ get_exp
◆ MB_CUR_MAX
◆ round
◆ streamout_string
◆ USE_MULTISIZE
◆ va_arg_f
Value:
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition at line 57 of file streamout.c.
◆ va_arg_ffp
◆ va_arg_fu
Value:
static unsigned(__cdecl *hash_bstr)(bstr_t s)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition at line 62 of file streamout.c.
◆ STRING
◆ anonymous enum
Enumerator |
---|
FLAG_ALIGN_LEFT | |
FLAG_FORCE_SIGN | |
FLAG_FORCE_SIGNSP | |
FLAG_PAD_ZERO | |
FLAG_SPECIAL | |
FLAG_SHORT | |
FLAG_LONG | |
FLAG_WIDECHAR | |
FLAG_INT64 | |
FLAG_INTPTR | |
FLAG_LONGDOUBLE | |
Definition at line 35 of file streamout.c.
◆ format_float()
Definition at line 82 of file streamout.c.
90 static const TCHAR digits_l[] =
_T(
"0123456789abcdef0x");
91 static const TCHAR digits_u[] =
_T(
"0123456789ABCDEF0X");
93 static const TCHAR _infinity[] =
_T(
"#INF");
95 int exponent = 0,
sign;
96 long double fpval, fpval2;
110 sign = fpval < 0 ? -1 : 1;
118 if (exponent < -4 || exponent >=
precision)
goto case_e;
145 val32 = exponent >= 0 ? exponent : -exponent;
152 *--(*string) =
digits[val32 % 10];
157 *--(*string) = exponent >= 0 ?
_T(
'+') :
_T(
'-');
160 *--(*string) =
digits[0xe];
189 (*string) -=
sizeof(
_nan) /
sizeof(
TCHAR) - 1;
195 (*string) -=
sizeof(_infinity) /
sizeof(
TCHAR) - 1;
202 while (
padding-- > 0) *--(*string) =
_T(
'0');
206 while (num_digits-- > 0)
214 *--(*string) =
_T(
'.');
222 while ((
unsigned __int64)fpval2);
static size_t double int int int * sign
_Check_return_ __MINGW_NOTHROW _CRTIMP int __cdecl _isnan(_In_ double)
_TCHAR * _tcscpy(_TCHAR *to, const _TCHAR *from)
#define va_arg_ffp(argptr, flags)
float pow(float __x, int __y)
GLenum GLint GLint * precision
_Check_return_ __MINGW_NOTHROW _CRTIMP int __cdecl _finite(_In_ double)
static const int digits[]
Referenced by streamout().
◆ mbtowc()
◆ streamout()
Definition at line 326 of file streamout.c.
328 static const TCHAR digits_l[] =
_T(
"0123456789abcdef0x");
329 static const TCHAR digits_u[] =
_T(
"0123456789ABCDEF0X");
330 static const char *_nullstring =
"(null)";
336 size_t prefixlen,
len;
337 int written = 1, written_all = 0;
348 if (
chr ==
_T(
'\0'))
break;
351 if ((
chr !=
_T(
'%')) ||
356 written_all += written;
376 #ifdef _USER32_WSPRINTF 378 written_all += written;
381 fieldwidth =
va_arg(argptr,
int);
385 fieldwidth = -fieldwidth;
395 fieldwidth = fieldwidth * 10 + (
chr -
_T(
'0'));
407 #ifdef _USER32_WSPRINTF 409 written_all += written;
435 else if (
chr ==
_T(
'l'))
441 else if (
chr ==
_T(
'I'))
476 *
va_arg(argptr,
short*) = written_all;
478 *
va_arg(argptr,
int*) = written_all;
496 ((
wchar_t*)
string)[0] =
va_arg(argptr,
int);
497 ((
wchar_t*)
string)[1] =
_T(
'\0');
501 ((
char*)
string)[0] =
va_arg(argptr,
int);
502 ((
char*)
string)[1] =
_T(
'\0');
508 if (nt_string && (
string = nt_string->Buffer))
510 len = nt_string->Length;
533 string = (
TCHAR*)_nullstring;
544 #ifndef _USER32_WSPRINTF 604 #ifdef _USER32_WSPRINTF 639 prefixlen = prefix ?
_tcslen(prefix) : 0;
650 written_all += written;
658 if (written == -1)
return -1;
659 written_all += written;
667 written_all += written;
675 if (written == -1)
return -1;
676 written_all += written;
678 #if 0 && SUPPORT_FLOAT 683 written_all += written;
694 written_all += written;
700 if (written == -1)
return -1;
#define va_arg_fu(argptr, flags)
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
void format_float(TCHAR chr, unsigned int flags, int precision, TCHAR **string, const TCHAR **prefix, va_list *argptr)
#define va_arg_f(argptr, flags)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
size_t __cdecl _tcslen(const _TCHAR *str)
GLenum GLint GLint * precision
static int streamout_wstring(FILE *stream, const wchar_t *string, size_t count)
static int streamout_astring(FILE *stream, const char *string, size_t count)
static int streamout_char(FILE *stream, int chr)
static const int digits[]
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Referenced by _vscprintf(), KmtVSNPrintF(), vfprintf(), and vfprintf_s().
◆ streamout_astring()
Definition at line 252 of file streamout.c.
257 #if !defined(_USER32_WSPRINTF) GLuint GLuint GLsizei count
int mbtowc(wchar_t *wchar, const char *mbchar, size_t count)
static int streamout_char(FILE *stream, int chr)
Referenced by streamout().
◆ streamout_char()
static int streamout_char |
( |
FILE * |
stream, |
|
|
int |
chr |
|
) |
| |
|
static |
◆ streamout_wstring()
Definition at line 280 of file streamout.c.
285 #if defined(_UNICODE) && !defined(_USER32_WSPRINTF) 297 if (
mblen <= 0)
return written;
GLuint GLuint GLsizei count
int wctomb(char *mbchar, wchar_t wchar)
_Check_return_ int __cdecl mblen(_In_reads_bytes_opt_(_MaxCount) _Pre_opt_z_ const char *_Ch, _In_ size_t _MaxCount)
static int streamout_char(FILE *stream, int chr)
Referenced by streamout().
◆ wctomb()