#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "shlwapi.h"
#include "wine/debug.h"
Go to the source code of this file.
|
| WINE_DEFAULT_DEBUG_CHANNEL (string) |
|
static INT | WPRINTF_ParseFormatA (LPCSTR format, WPRINTF_FORMAT *res) |
|
static INT | WPRINTF_ParseFormatW (LPCWSTR format, WPRINTF_FORMAT *res) |
|
static UINT | WPRINTF_GetLen (WPRINTF_FORMAT *format, WPRINTF_DATA *arg, LPSTR number, UINT maxlen) |
|
INT WINAPI | wvnsprintfA (LPSTR buffer, INT maxlen, LPCSTR spec, __ms_va_list args) |
|
INT WINAPI | wvnsprintfW (LPWSTR buffer, INT maxlen, LPCWSTR spec, __ms_va_list args) |
|
int WINAPIV | wnsprintfA (LPSTR lpOut, int cchLimitIn, LPCSTR lpFmt,...) |
|
int WINAPIV | wnsprintfW (LPWSTR lpOut, int cchLimitIn, LPCWSTR lpFmt,...) |
|
◆ NO_SHLWAPI_REG
◆ WPRINTF_I64
◆ WPRINTF_INTPTR
◆ WPRINTF_LEFTALIGN
◆ WPRINTF_LONG
◆ WPRINTF_PREFIX_HEX
◆ WPRINTF_SHORT
◆ WPRINTF_UPPER_HEX
◆ WPRINTF_WIDE
◆ WPRINTF_ZEROPAD
◆ WPRINTF_TYPE
Enumerator |
---|
WPR_UNKNOWN | |
WPR_CHAR | |
WPR_WCHAR | |
WPR_STRING | |
WPR_WSTRING | |
WPR_SIGNED | |
WPR_UNSIGNED | |
WPR_HEXA | |
Definition at line 49 of file wsprintf.c.
◆ WINE_DEFAULT_DEBUG_CHANNEL()
WINE_DEFAULT_DEBUG_CHANNEL |
( |
string |
| ) |
|
◆ wnsprintfA()
Definition at line 547 of file wsprintf.c.
548{
551
556}
INT WINAPI wvnsprintfA(LPSTR buffer, INT maxlen, LPCSTR spec, __ms_va_list args)
#define __ms_va_end(list)
#define __ms_va_start(list, arg)
◆ wnsprintfW()
Definition at line 564 of file wsprintf.c.
565{
568
573}
INT WINAPI wvnsprintfW(LPWSTR buffer, INT maxlen, LPCWSTR spec, __ms_va_list args)
Referenced by confirm_delete_list().
◆ WPRINTF_GetLen()
Definition at line 247 of file wsprintf.c.
249{
251
255 {
258 return (
format->precision = 1);
262 if (!*(
arg->lpcstr_view +
len))
break;
263 if (
len > maxlen)
len = maxlen;
268 if (!*(
arg->lpcwstr_view +
len))
break;
269 if (
len > maxlen)
len = maxlen;
274 {
279
281 {
284 }
287
288 do
289 {
296 break;
297 }
298 default:
299 return 0;
300 }
301 if (
len > maxlen)
len = maxlen;
303 if (
format->precision > maxlen)
format->precision = maxlen;
308}
#define WPRINTF_UPPER_HEX
#define WPRINTF_PREFIX_HEX
static const WCHAR null_stringW[]
#define WPRINTF_LEFTALIGN
static const CHAR null_stringA[]
static const int digits[]
static unsigned int number
unsigned __int3264 UINT_PTR
Referenced by wvnsprintfA(), and wvnsprintfW().
◆ WPRINTF_ParseFormatA()
Definition at line 89 of file wsprintf.c.
90{
92
99 while ((*
p >=
'0') && (*
p <=
'9'))
100 {
101 res->width =
res->width * 10 + *
p -
'0';
103 }
105 {
107 while ((*
p >=
'0') && (*
p <=
'9'))
108 {
109 res->precision =
res->precision * 10 + *
p -
'0';
111 }
112 }
117 {
119 else if (
p[1] ==
'3' &&
p[2] ==
'2')
p += 3;
121 }
123 {
124 case 'c':
126 break;
127 case 'C':
129 break;
130 case 'd':
131 case 'i':
133 break;
134 case 's':
136 break;
137 case 'S':
139 break;
140 case 'u':
142 break;
143 case 'p':
144 res->width = 2 *
sizeof(
void *);
146
147 case 'X':
149
150 case 'x':
152 break;
153 default:
156 break;
157 }
159}
Referenced by wvnsprintfA().
◆ WPRINTF_ParseFormatW()
Definition at line 171 of file wsprintf.c.
172{
174
181 while ((*
p >=
'0') && (*
p <=
'9'))
182 {
183 res->width =
res->width * 10 + *
p -
'0';
185 }
187 {
189 while ((*
p >=
'0') && (*
p <=
'9'))
190 {
191 res->precision =
res->precision * 10 + *
p -
'0';
193 }
194 }
199 {
201 else if (
p[1] ==
'3' &&
p[2] ==
'2')
p += 3;
203 }
205 {
206 case 'c':
208 break;
209 case 'C':
211 break;
212 case 'd':
213 case 'i':
215 break;
216 case 's':
218 break;
219 case 'S':
221 break;
222 case 'u':
224 break;
225 case 'p':
226 res->width = 2 *
sizeof(
void *);
228
229 case 'X':
231
232 case 'x':
234 break;
235 default:
238 break;
239 }
241}
Referenced by wvnsprintfW().
◆ wvnsprintfA()
Definition at line 325 of file wsprintf.c.
326{
332
334
335 while (*spec && (maxlen > 1))
336 {
337 if (*spec !=
'%') { *
p++ = *spec++; maxlen--;
continue; }
338 spec++;
339 if (*spec ==
'%') { *
p++ = *spec++; maxlen--;
continue; }
341
343 {
346 break;
349 break;
352 break;
355 break;
362 break;
363 default:
365 break;
366 }
367
374 {
377 break;
380 break;
384 break;
386 {
389 }
390 break;
393 {
396 maxlen -= 2;
398 }
399
401
403 {
406 }
407
409 for (
i =
len;
i <
format.precision;
i++, maxlen--) *
p++ =
'0';
412 break;
414 continue;
415 }
420 }
424}
static INT WPRINTF_ParseFormatA(LPCSTR format, WPRINTF_FORMAT *res)
static UINT WPRINTF_GetLen(WPRINTF_FORMAT *format, WPRINTF_DATA *arg, LPSTR number, UINT maxlen)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
Referenced by wnsprintfA().
◆ wvnsprintfW()
Definition at line 432 of file wsprintf.c.
433{
439
441
442 while (*spec && (maxlen > 1))
443 {
444 if (*spec !=
'%') { *
p++ = *spec++; maxlen--;
continue; }
445 spec++;
446 if (*spec ==
'%') { *
p++ = *spec++; maxlen--;
continue; }
448
450 {
453 break;
456 break;
459 break;
462 break;
469 break;
470 default:
472 break;
473 }
474
481 {
484 break;
487 break;
489 {
492 }
493 break;
497 break;
500 {
503 maxlen -= 2;
505 }
506
508
510 {
513 }
514
516 for (
i =
len;
i <
format.precision;
i++, maxlen--) *
p++ =
'0';
518 break;
520 continue;
521 }
526 }
530}
static INT WPRINTF_ParseFormatW(LPCWSTR format, WPRINTF_FORMAT *res)
Referenced by wnsprintfW().
◆ null_stringA
◆ null_stringW