summaryrefslogtreecommitdiff
path: root/wince/stdio.c
blob: 877408d417b5fa4b5d9a1e2843b71076c0d0790b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/***************************************************************
  stdio.c
***************************************************************/

#include <windows.h>
#include "wince.h" /* for wce_mbtowc */


FILE *freopen(const char *filename, const char *mode, FILE *file)
{
	wchar_t *wfilename, *wmode;
	FILE *fp;

	wfilename = wce_mbtowc(filename);
	wmode     = wce_mbtowc(mode);

	fp = _wfreopen(wfilename, wmode, file);

	free(wfilename);
	free(wmode);

	return fp;
}

FILE *fdopen( int handle, const char *mode )
{
	wchar_t *wmode;
	FILE* fp;

	wmode = wce_mbtowc(mode);
	fp = _wfdopen( (void*)handle, wmode );

	free(wmode);
	return fp;
}