summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libw32c.h
blob: 758b854e9e08b1c82b13a74cba3d112e51a78ed0 (plain) (blame)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
*  Modified for Crawl Reference by $Author$ on $Date$
*/

#ifndef LIBW32C_H
#define LIBW32C_H

#define WIN_NUMBER_OF_LINES     25

#include <string>
// I think the following definition is all we need from STD namespace..
#ifdef __IBMCPP__			// Borland 5.01 doesn't seem to need this
typedef std::basic_string<char> string;
#endif

#include <stdarg.h>

void init_libw32c(void);
void deinit_libw32c(void);

void set_cursor_enabled(bool enabled);
bool is_cursor_enabled();

void clrscr(void);
void clear_to_end_of_line();
void gotoxy(int x, int y);
void textcolor(int c);
void textattr(int c);
void cprintf( const char *format, ... );
// void cprintf(const char *s);
void setStringInput(bool value);
bool setBuffering(bool value);
int getConsoleString(char *buf, int maxlen);
void print_timings(void);

void window(int x, int y, int lx, int ly);
int wherex(void);
int wherey(void);
void putch(char c);
int getch(void);
int getch_ck(void);
int key_to_command(int);
int getche(void);
int kbhit(void);
void delay(int ms);
void textbackground(int c);

void enable_smart_cursor(bool cursor);
bool is_smart_cursor_enabled();

inline void srandom(unsigned int seed) { srand(seed); }

#endif