ReactOS 0.4.16-dev-303-g11d5cb8
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
13int __cdecl KmtWcToMb(char *mbchar, wchar_t wchar)
14{
15 *mbchar = (char)wchar;
16 return 1;
17}
18
19int __cdecl streamout(FILE *stream, const char *format, va_list argptr);
20
21int __cdecl KmtVSNPrintF(char *buffer, size_t count, const char *format, va_list argptr)
22{
23 int result;
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}
#define __cdecl
Definition: accygwin.h:79
char * va_list
Definition: acmsvcex.h:78
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
unsigned char
Definition: typeof.h:29
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint buffer
Definition: glext.h:5915
GLuint64EXT * result
Definition: glext.h:11304
#define _IOWRT
Definition: stdio.h:125
#define _IOSTRG
Definition: stdio.h:134
#define KmtVSNPrintF
Definition: kmt_test_user.h:35
int __cdecl streamout(FILE *stream, const char *format, va_list argptr)
Definition: streamout.c:326
int __cdecl KmtWcToMb(char *mbchar, wchar_t wchar)
Definition: printf_stubs.c:13
Definition: format.c:58
Definition: parse.h:23