summaryrefslogtreecommitdiffstats
path: root/lib/libcurses/tinfo/lib_kernel.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2001-01-22 18:01:32 +0000
committermillert <millert@openbsd.org>2001-01-22 18:01:32 +0000
commit84af20cee44481ef9eb2070c76702603863c1a4c (patch)
treeb232b1727be5b5b1854432f2b87c149f7522cb9d /lib/libcurses/tinfo/lib_kernel.c
parentfix memory leaks in SSH2 key exchange; ok markus@ (diff)
downloadwireguard-openbsd-84af20cee44481ef9eb2070c76702603863c1a4c.tar.xz
wireguard-openbsd-84af20cee44481ef9eb2070c76702603863c1a4c.zip
Update to ncurses-5.2-20010114
Diffstat (limited to 'lib/libcurses/tinfo/lib_kernel.c')
-rw-r--r--lib/libcurses/tinfo/lib_kernel.c74
1 files changed, 35 insertions, 39 deletions
diff --git a/lib/libcurses/tinfo/lib_kernel.c b/lib/libcurses/tinfo/lib_kernel.c
index 16cb06afe9d..730ba1551fd 100644
--- a/lib/libcurses/tinfo/lib_kernel.c
+++ b/lib/libcurses/tinfo/lib_kernel.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: lib_kernel.c,v 1.1 1999/01/18 19:10:17 millert Exp $ */
+/* $OpenBSD: lib_kernel.c,v 1.2 2001/01/22 18:01:52 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -33,7 +33,6 @@
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
****************************************************************************/
-
/*
* lib_kernel.c
*
@@ -48,9 +47,9 @@
*/
#include <curses.priv.h>
-#include <term.h> /* cur_term */
+#include <term.h> /* cur_term */
-MODULE_ID("$From: lib_kernel.c,v 1.19 1998/12/20 00:18:45 tom Exp $")
+MODULE_ID("$From: lib_kernel.c,v 1.21 2000/12/10 02:55:07 tom Exp $")
/*
* erasechar()
@@ -59,23 +58,21 @@ MODULE_ID("$From: lib_kernel.c,v 1.19 1998/12/20 00:18:45 tom Exp $")
*
*/
-char
+NCURSES_EXPORT(char)
erasechar(void)
{
- T((T_CALLED("erasechar()")));
+ T((T_CALLED("erasechar()")));
- if (cur_term != 0) {
+ if (cur_term != 0) {
#ifdef TERMIOS
- returnCode(cur_term->Ottyb.c_cc[VERASE]);
+ returnCode(cur_term->Ottyb.c_cc[VERASE]);
#else
- returnCode(cur_term->Ottyb.sg_erase);
+ returnCode(cur_term->Ottyb.sg_erase);
#endif
- }
- returnCode(ERR);
+ }
+ returnCode(ERR);
}
-
-
/*
* killchar()
*
@@ -83,23 +80,21 @@ erasechar(void)
*
*/
-char
+NCURSES_EXPORT(char)
killchar(void)
{
- T((T_CALLED("killchar()")));
+ T((T_CALLED("killchar()")));
- if (cur_term != 0) {
+ if (cur_term != 0) {
#ifdef TERMIOS
- returnCode(cur_term->Ottyb.c_cc[VKILL]);
+ returnCode(cur_term->Ottyb.c_cc[VKILL]);
#else
- returnCode(cur_term->Ottyb.sg_kill);
+ returnCode(cur_term->Ottyb.sg_kill);
#endif
- }
- returnCode(ERR);
+ }
+ returnCode(ERR);
}
-
-
/*
* flushinp()
*
@@ -107,26 +102,27 @@ killchar(void)
*
*/
-int flushinp(void)
+NCURSES_EXPORT(int)
+flushinp(void)
{
- T((T_CALLED("flushinp()")));
+ T((T_CALLED("flushinp()")));
- if (cur_term != 0) {
+ if (cur_term != 0) {
#ifdef TERMIOS
- tcflush(cur_term->Filedes, TCIFLUSH);
+ tcflush(cur_term->Filedes, TCIFLUSH);
#else
- errno = 0;
- do {
- ioctl(cur_term->Filedes, TIOCFLUSH, 0);
- } while
- (errno == EINTR);
+ errno = 0;
+ do {
+ ioctl(cur_term->Filedes, TIOCFLUSH, 0);
+ } while
+ (errno == EINTR);
#endif
- if (SP) {
- SP->_fifohead = -1;
- SP->_fifotail = 0;
- SP->_fifopeek = 0;
- }
- returnCode(OK);
+ if (SP) {
+ SP->_fifohead = -1;
+ SP->_fifotail = 0;
+ SP->_fifopeek = 0;
}
- returnCode(ERR);
+ returnCode(OK);
+ }
+ returnCode(ERR);
}