aboutsummaryrefslogtreecommitdiff
path: root/contrib/ncurses/ncurses/tinfo/lib_kernel.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2002-05-21 05:30:25 +0000
committerPeter Wemm <peter@FreeBSD.org>2002-05-21 05:30:25 +0000
commit39f2269fcb4873fd97d70af944ec49f4230fadea (patch)
treebd986d58f5a6e348466b5362637ba93e6cd5bf8c /contrib/ncurses/ncurses/tinfo/lib_kernel.c
parent7e6a63408cfb0b48f0e41f77ed82f5d0ca60bda5 (diff)
downloadsrc-39f2269fcb4873fd97d70af944ec49f4230fadea.tar.gz
src-39f2269fcb4873fd97d70af944ec49f4230fadea.zip
Import ncurses-5.2-20020518 onto the vendor branch.
Obtained from: ftp://dickey.his.com/ncurses/
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=97049
Diffstat (limited to 'contrib/ncurses/ncurses/tinfo/lib_kernel.c')
-rw-r--r--contrib/ncurses/ncurses/tinfo/lib_kernel.c44
1 files changed, 36 insertions, 8 deletions
diff --git a/contrib/ncurses/ncurses/tinfo/lib_kernel.c b/contrib/ncurses/ncurses/tinfo/lib_kernel.c
index ab8e4db7d283..b4d3c7f45aca 100644
--- a/contrib/ncurses/ncurses/tinfo/lib_kernel.c
+++ b/contrib/ncurses/ncurses/tinfo/lib_kernel.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2000,2002 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 *
@@ -29,6 +29,7 @@
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 2002 *
****************************************************************************/
/*
@@ -47,7 +48,28 @@
#include <curses.priv.h>
#include <term.h> /* cur_term */
-MODULE_ID("$Id: lib_kernel.c,v 1.21 2000/12/10 02:55:07 tom Exp $")
+MODULE_ID("$Id: lib_kernel.c,v 1.22 2002/05/11 20:32:18 tom Exp $")
+
+static int
+_nc_vdisable(void)
+{
+ int value;
+#if defined(_POSIX_VDISABLE) && defined(HAVE_UNISTD_H)
+ value = _POSIX_VDISABLE;
+#endif
+#if defined(_PC_VDISABLE)
+ if (value == -1) {
+ value = fpathconf(0, _PC_VDISABLE);
+ if (value == -1) {
+ value = 0377;
+ }
+ }
+#elif defined(VDISABLE)
+ if (value == -1)
+ value = VDISABLE;
+#endif
+ return value;
+}
/*
* erasechar()
@@ -59,16 +81,19 @@ MODULE_ID("$Id: lib_kernel.c,v 1.21 2000/12/10 02:55:07 tom Exp $")
NCURSES_EXPORT(char)
erasechar(void)
{
+ int result = ERR;
T((T_CALLED("erasechar()")));
if (cur_term != 0) {
#ifdef TERMIOS
- returnCode(cur_term->Ottyb.c_cc[VERASE]);
+ result = cur_term->Ottyb.c_cc[VERASE];
+ if (result == _nc_vdisable())
+ result = ERR;
#else
- returnCode(cur_term->Ottyb.sg_erase);
+ result = cur_term->Ottyb.sg_erase;
#endif
}
- returnCode(ERR);
+ returnCode(result);
}
/*
@@ -81,16 +106,19 @@ erasechar(void)
NCURSES_EXPORT(char)
killchar(void)
{
+ int result = ERR;
T((T_CALLED("killchar()")));
if (cur_term != 0) {
#ifdef TERMIOS
- returnCode(cur_term->Ottyb.c_cc[VKILL]);
+ result = cur_term->Ottyb.c_cc[VKILL];
+ if (result == _nc_vdisable())
+ result = ERR;
#else
- returnCode(cur_term->Ottyb.sg_kill);
+ result = cur_term->Ottyb.sg_kill;
#endif
}
- returnCode(ERR);
+ returnCode(result);
}
/*