summaryrefslogtreecommitdiffstats
path: root/contrib/nvi/common/key.h
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2014-08-15 19:06:59 +0000
committeremaste <emaste@FreeBSD.org>2014-08-15 19:06:59 +0000
commitdc9f54ca59ea1a35306a07880d431cd1cf644a79 (patch)
tree968ef805337807b7ffa4aa77e36cb7fafe5c2b3f /contrib/nvi/common/key.h
parent28c99f4366718cbf51d5b9827d250ef24b82296c (diff)
downloadFreeBSD-src-dc9f54ca59ea1a35306a07880d431cd1cf644a79.zip
FreeBSD-src-dc9f54ca59ea1a35306a07880d431cd1cf644a79.tar.gz
MFC r259088: Vendor import nvi-2.1.2-c80f493b038 a multikey mapping fix
PR: bin/182463
Diffstat (limited to 'contrib/nvi/common/key.h')
-rw-r--r--contrib/nvi/common/key.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/contrib/nvi/common/key.h b/contrib/nvi/common/key.h
index 3eeca12..43cef77 100644
--- a/contrib/nvi/common/key.h
+++ b/contrib/nvi/common/key.h
@@ -6,7 +6,7 @@
*
* See the LICENSE file for redistribution information.
*
- * $Id: key.h,v 10.55 2012/10/07 01:31:17 zy Exp $
+ * $Id: key.h,v 10.56 2013/11/13 12:15:27 zy Exp $
*/
#include "multibyte.h"
@@ -23,8 +23,9 @@
#define INPUT2INT5(sp,cw,n,nlen,w,wlen) \
sp->conv.input2int(sp, n, nlen, &(cw), &wlen, &w)
#define CONST
+#define INTISWIDE(c) (wctob(c) == EOF)
#define CHAR_WIDTH(sp, ch) wcwidth(ch)
-#define INTISWIDE(c) (wctob(c) == EOF)
+#define CAN_PRINT(sp, ch) (CHAR_WIDTH(sp, ch) > 0)
#else
#define FILE2INT5(sp,buf,n,nlen,w,wlen) \
(w = n, wlen = nlen, 0)
@@ -36,9 +37,10 @@
(n = w, nlen = wlen, 0)
#define INPUT2INT5(sp,buf,n,nlen,w,wlen) \
(w = n, wlen = nlen, 0)
-#define CONST const
-#define INTISWIDE(c) 0
+#define CONST const
+#define INTISWIDE(c) 0
#define CHAR_WIDTH(sp, ch) 1
+#define CAN_PRINT(sp, ch) isprint(ch)
#endif
#define FILE2INT(sp,n,nlen,w,wlen) \
FILE2INT5(sp,sp->cw,n,nlen,w,wlen)
OpenPOWER on IntegriCloud