summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libgui.h
diff options
context:
space:
mode:
authorSteven Noonan <steven@uplinklabs.net>2009-09-20 18:09:20 -0700
committerSteven Noonan <steven@uplinklabs.net>2009-09-23 11:34:36 -0700
commitab835374e85861b68703733b4a3bd8917d2a2d6b (patch)
tree04082d611ca320ce33e3781c2697e457d0a64c04 /crawl-ref/source/libgui.h
parent215b4e4720d358f72c755f7aec8c0cedd7e18102 (diff)
downloadcrawl-ref-ab835374e85861b68703733b4a3bd8917d2a2d6b.tar.gz
crawl-ref-ab835374e85861b68703733b4a3bd8917d2a2d6b.zip
libgui: fix declaration consistency
Lots of little things here. The forward declarations for some of these functions simply did not match the function definitions. - clrscr() was declared twice - cprintf(), putch(), putwch(), window(), clrscr() all returned 'void' instead of 'int'. - getch() and strlwr() were defined extern "C", but not declared as such. Also made libgui.cc functions behave like their ncurses equivalents, except that our functions always return the ncurses 'OK' (0) response. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Diffstat (limited to 'crawl-ref/source/libgui.h')
-rw-r--r--crawl-ref/source/libgui.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/crawl-ref/source/libgui.h b/crawl-ref/source/libgui.h
index 302d14f1e8..5b5e024f55 100644
--- a/crawl-ref/source/libgui.h
+++ b/crawl-ref/source/libgui.h
@@ -30,11 +30,10 @@ void gui_init_view_params(crawl_view_geometry &geom);
bool gui_get_mouse_grid_pos(coord_def &gc);
/* text display */
-void clrscr(void);
void textcolor(int color);
int wherex();
int wherey();
-void cprintf(const char *format,...);
+int cprintf(const char *format,...);
void clear_to_end_of_line(void);
void clear_to_end_of_screen(void);
int get_number_of_lines(void);
@@ -43,8 +42,8 @@ void get_input_line_gui(char *const buff, int len);
void _setcursortype(int curstype);
void textbackground(int bg);
void textcolor(int col);
-void putch(unsigned char chr);
-void putwch(unsigned chr);
+int putch(unsigned char chr);
+int putwch(unsigned chr);
void put_colour_ch(int colour, unsigned ch);
void writeWChar(unsigned char *ch);
@@ -55,11 +54,11 @@ inline void enable_smart_cursor(bool) { }
inline bool is_smart_cursor_enabled() { return false; }
-void window(int x1, int y1, int x2, int y2);
+int window(int x1, int y1, int x2, int y2);
-int getch();
+extern "C" int getch();
int getch_ck();
-void clrscr();
+int clrscr();
void message_out(int which_line, int colour, const char *s, int firstcol = 0, bool newline = true);
void cgotoxy(int x, int y, int region = GOTO_CRT);
void clear_message_window();
@@ -68,7 +67,7 @@ void update_screen();
int kbhit();
#ifdef UNIX
-char *strlwr(char *str);
+extern "C" char *strlwr(char *str);
int itoa(int value, char *strptr, int radix);
int stricmp(const char *str1, const char *str2);
#endif