]> 4ch.mooo.com Git - 16.git/blob - src/lib/doslib/dos/winfcon.h
added a bunch of things~ and midi stuff~
[16.git] / src / lib / doslib / dos / winfcon.h
1 /* winfcon.h
2  *
3  * Fake console for Windows applications where a console is not available.
4  * (C) 2011-2012 Jonathan Campbell.
5  * Hackipedia DOS library.
6  *
7  * This code is licensed under the LGPL.
8  * <insert LGPL legal text here>
9  */
10
11 /* Windows 3.1 and earlier, even for Win32s: there is no system given console.
12  * We either have to draw and maintain our own window, or find some other way to printf() and display it. */
13 #if defined(TARGET_WINDOWS) && (TARGET_MSDOS == 16 || (TARGET_MSDOS == 32 && TARGET_WINDOWS == 31) || (defined(WIN386) && TARGET_MSDOS == 32))
14 # define WIN_STDOUT_CONSOLE
15 # define getch _win_getch
16 # define kbhit _win_kbhit
17 # define fprintf __XXX_TODO_fprintf
18 # define printf _win_printf
19 # define isatty _win_isatty
20 # define write _win_write
21 # define read _win_read
22
23 void _win_pump();
24 int _win_kbhit();
25 int _win_getch();
26 HWND _win_hwnd();
27 void _gdi_pause();
28 void _win_pump_wait();
29 void _win_putc(char c);
30 int _win_isatty(int fd);
31 int _win_read(int fd,void *buf,int sz);
32 size_t _win_printf(const char *fmt,...);
33 int _win_write(int fd,const void *buf,int sz);
34 int _cdecl main(int argc,char **argv,char **envp);
35 int PASCAL _win_main_con_entry(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow,int (_cdecl *_main_f)(int argc,char**,char**));
36
37 extern HINSTANCE _win_hInstance;
38
39 # ifdef WINFCON_STOCK_WIN_MAIN
40 int PASCAL WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow) {
41         return _win_main_con_entry(hInstance,hPrevInstance,lpCmdLine,nCmdShow,main);
42 }
43 # endif
44
45 #endif
46