path: root/tty.h
diff options
authorpowwow@askgustav.com <powwow@askgustav.com>2019-03-18 23:05:26 (GMT)
committerSteve Slaven <bpk@hoopajoo.net>2019-04-23 20:37:05 (GMT)
commit304a722c426f47a461dc88c4493f800c0690b29b (patch)
tree151b974354c0c7ec4e89649a949db32f11b56442 /tty.h
parent7db984561ef8fd0ff9165288324dbc81516113f0 (diff)
remove some non-ANSI C support
Diffstat (limited to 'tty.h')
1 files changed, 29 insertions, 32 deletions
diff --git a/tty.h b/tty.h
index 24a3162..a4965b6 100644
--- a/tty.h
+++ b/tty.h
@@ -10,31 +10,28 @@ extern char *tty_clreoln, *tty_clreoscr, *tty_begoln,
*tty_modenorm, *tty_modenormbackup,
*tty_modeinv, *tty_modestandon, *tty_modestandoff;
-void tty_bootstrap __P ((void));
-void tty_start __P ((void));
-void tty_quit __P ((void));
-void tty_special_keys __P ((void));
-void tty_sig_winch_bottomhalf __P ((void));
-void tty_add_walk_binds __P ((void));
-void tty_add_initial_binds __P ((void));
-void tty_gotoxy __P ((int col, int line));
-void tty_gotoxy_opt __P ((int fromcol, int fromline, int tocol, int toline));
-void input_delete_nofollow_chars __P ((int n));
-void input_overtype_follow __P ((char c));
-void input_insert_follow_chars __P ((char *str, int n));
-void input_moveto __P ((int new_pos));
-#ifndef USE_LOCALE
-#define tty_puts(s) fputs((s), stdout)
-/* printf("%s", (s)); would be as good */
-#define tty_putc(c) putc((unsigned char)(c), stdout)
-#define tty_printf printf
+void tty_bootstrap(void);
+void tty_start(void);
+void tty_quit(void);
+void tty_special_keys(void);
+void tty_sig_winch_bottomhalf(void);
+void tty_add_walk_binds(void);
+void tty_add_initial_binds(void);
+void tty_gotoxy(int col, int line);
+void tty_gotoxy_opt(int fromcol, int fromline, int tocol, int toline);
+void input_delete_nofollow_chars(int n);
+void input_overtype_follow(char c);
+void input_insert_follow_chars(char *str, int n);
+void input_moveto(int new_pos);
+#ifndef USE_LOCALE
+#define tty_puts(s) fputs((s), stdout)
+#define tty_putc(c) fputc((unsigned char)(c), stdout)
+#define tty_printf(...) printf(__VA_ARGS__)
#define tty_read(buf, cnt) read(tty_read_fd, (buf), (cnt))
-#define tty_gets(s,size) fgets((s), (size), stdin)
+#define tty_gets(s, size) fgets((s), (size), stdin)
#define tty_flush() fflush(stdout)
#define tty_raw_write(s,size) do { tty_flush(); write(1, (s), (size)); } while (0)
@@ -47,14 +44,14 @@ void input_moveto __P ((int new_pos));
#define PRINTF_FUNCTION(string, first)
-void tty_puts __P ((const char *s));
-void tty_putc __P ((char c));
-int tty_printf __P ((const char *format, ...)) PRINTF_FUNCTION(1, 2);
-int tty_read __P ((char *buf, size_t count));
-void tty_gets __P ((char *s, int size));
-void tty_flush __P ((void));
-void tty_raw_write __P ((char *data, size_t len));
-int tty_has_chars __P ((void));
+void tty_puts(const char *s);
+void tty_putc(char c);
+int tty_printf(const char *format, ...) PRINTF_FUNCTION(1, 2);
+int tty_read(char *buf, size_t count);
+void tty_gets(char *s, int size);
+void tty_flush(void);
+void tty_raw_write(char *data, size_t len);
+int tty_has_chars(void);
#endif /* USE_LOCALE */