ReactOS  0.4.15-dev-5097-g328cc41
printf_stubs.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS kernel-mode tests
3  * LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
4  * PURPOSE: Kernel-Mode Test Suite stub functions for any-IRQL vsnprintf
5  * COPYRIGHT: Copyright 2011-2018 Thomas Faber <thomas.faber@reactos.org>
6  */
7 
8 #undef wctomb
9 #include <stdarg.h>
10 #include <stdio.h>
11 #include <wchar.h>
12 
13 int __cdecl KmtWcToMb(char *mbchar, wchar_t wchar)
14 {
15  *mbchar = (char)wchar;
16  return 1;
17 }
18 
19 int __cdecl streamout(FILE *stream, const char *format, va_list argptr);
20 
21 int __cdecl KmtVSNPrintF(char *buffer, size_t count, const char *format, va_list argptr)
22 {
23  int result;
24  FILE stream;
25 
26  stream._base = (char *)buffer;
27  stream._ptr = stream._base;
28  stream._charbuf = 0;
29  stream._cnt = (int)count;
30  stream._bufsiz = 0;
31  stream._flag = _IOSTRG | _IOWRT;
32  stream._tmpfname = 0;
33 
34  result = streamout(&stream, format, argptr);
35 
36  /* Only zero terminate if there is enough space left */
37  if (stream._cnt) *(char *)stream._ptr = '\0';
38 
39  return result;
40 }
GLuint64EXT * result
Definition: glext.h:11304
#define __cdecl
Definition: accygwin.h:79
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint buffer
Definition: glext.h:5915
#define _IOSTRG
Definition: stdio.h:134
int __cdecl KmtWcToMb(char *mbchar, wchar_t wchar)
Definition: printf_stubs.c:13
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
unsigned char
Definition: typeof.h:29
char * va_list
Definition: acmsvcex.h:78
int __cdecl KmtVSNPrintF(char *buffer, size_t count, const char *format, va_list argptr)
Definition: printf_stubs.c:21
#define _IOWRT
Definition: stdio.h:125
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
int __cdecl streamout(FILE *stream, const char *format, va_list argptr)
Definition: streamout.c:326