comparison pwplib/win32con.c @ 56:5d819ba6891c

More cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 27 May 2010 22:48:37 +0300
parents 72d1c04c788b
children
comparison
equal deleted inserted replaced
55:77f40a3c0095 56:5d819ba6891c
1 #include "config.h" 1 #include "config.h"
2 2
3 #ifdef DRIVE_WIN32 3 #ifdef DRIVE_WIN32
4 4
5 #include "pwplib.h" 5 #include "pwplib.h"
6 6 #include <stdarg.h>
7 #include <windows.h> 7 #include <windows.h>
8 8
9 /******************** vcsa code ********************/ 9 /******************** vcsa code ********************/
10 10
11 struct{ 11 struct{
12 HANDLE hstdout; 12 HANDLE hstdout;
13 COORD size; 13 COORD size;
14 14
15 CHAR_INFO*buf; 15 CHAR_INFO*buf;
16 }pwp_win32; 16 } pwp_win32;
17 17
18 /********************************************************/ 18 /********************************************************/
19 19
20 void pwpwrite(char*z) 20 void pwpwrite(char *fmt, ...)
21 { 21 {
22 /* fprintf(stderr,"%s\n",z); */ 22 /* fprintf(stderr,"%s\n",z); */
23 } 23 }
24 24
25 void win32con_dump_attr() 25 static void win32con_dump_attr(void)
26 { 26 {
27 u8*s=pwplib_buf; 27 u8*s=pwplib_buf;
28 CHAR_INFO*d=pwp_win32.buf; 28 CHAR_INFO*d=pwp_win32.buf;
29 int i=80*50; 29 int i=80*50;
30 30
43 WriteConsoleOutput(pwp_win32.hstdout,pwp_win32.buf, 43 WriteConsoleOutput(pwp_win32.hstdout,pwp_win32.buf,
44 bufsize,bufcoord,&writerect); 44 bufsize,bufcoord,&writerect);
45 } 45 }
46 } 46 }
47 47
48 int win32con_probe() 48 static int win32con_probe(void)
49 { 49 {
50 if(GetStdHandle(STD_OUTPUT_HANDLE) != INVALID_HANDLE_VALUE) 50 if(GetStdHandle(STD_OUTPUT_HANDLE) != INVALID_HANDLE_VALUE)
51 return 1; else return 0; 51 return 1; else return 0;
52 } 52 }
53 53
54 int win32con_init() 54 int win32con_init(void)
55 { 55 {
56 AllocConsole(); 56 AllocConsole();
57 57
58 pwp_win32.hstdout = GetStdHandle(STD_OUTPUT_HANDLE); 58 pwp_win32.hstdout = GetStdHandle(STD_OUTPUT_HANDLE);
59 59