-# $MirOS: contrib/code/jupp/Makefile.bsd-wrapper,v 1.10 2017/07/08 15:38:43 tg Exp $
+# $MirOS: contrib/code/jupp/Makefile.bsd-wrapper,v 1.9 2016/10/30 00:04:18 tg Exp $
#-
# make -f Makefile.bsd-wrapper CFPREFIX=/usr/mpkg sysconfjoesubdir=/joe
MAN= joe.1
INST_TARGET= INSTALL_MAN= install
-CLEANFILES+= .deps charmap charmaps i18n syntax joe.1 joe.txt{,~} jupp
+CLEANFILES+= .deps charmap charmaps syntax joe.1 joe.txt{,~} jupp
CFPREFIX?= /usr/local
.if ${CFPREFIX} == "/usr"
-$MirOS: contrib/code/jupp/NEWS,v 1.108 2017/07/09 01:03:53 tg Exp $
+$MirOS: contrib/code/jupp/NEWS,v 1.105 2017/01/11 22:36:43 tg Exp $
-------------------------------------------------------------------
-JOE-current
-
-- Fix <bsd/string.h> usage issue on Haiku
-- Make some signal handlers a bit more safe
-- Remove unused Unicode categorisations (~15K in the binary)
-- Update internationalisation data to Unicode 10.0.0
-- Partial fix for redrawing lines with combining characters
-
JOE 3.1jupp30
- Fix spelling mistakes, some found by lintian (thanks!)
- Disable setlocale for old cygwin32; use the current codepage instead
- Add JOECHARMAP override for locale/codepage-detected I/O charmap
- Display codes 128–159 in the CharTable help card properly
-- Avoid the Win32 console beeping on • by making it non-printable (WTF)
+– Avoid the Win32 console beeping on • by making it non-printable (WTF)
- Improve some documentation façets
- Add “-CYGhack” command line option; use it in right-click menu (WTF²)
- Do not force use of /usr/local in configure on Solaris
-F-keys:
-
- F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12
-MirBSD console ^[[11~^[[12~^[[13~^[[14~^[[15~ ^[[17~ ^[[18~ ^[[19~^[[20~^[[21~^[[23~^[[24~ also “ssh 3.2”, PuTTY, rxvt below
-xterm ^[OP ^[OQ ^[OR ^[OS ^[[15~ ^[[17~ ^[[18~ ^[[19~^[[20~^[[21~^[[23~^[[24~ also cygwin abusch, st izabera
-gnome-t. below - ^[OQ ^[OR ^[OS ^[[15~~^[[17~~^[[18~~^[[19~^[[20~ - ^[[23~^[[24~
-konsole ^[OP ^[OQ ^[OR ^[OS ^[[15~ ^[[17~ ^[[18~ ^[[19~^[[20~^[[21~ - ^[[24~ also yakuake
-linux console ^[[[A ^[[[B ^[[[C ^[[[D ^[[[E ^[[17~ ^[[18~ ^[[19~^[[20~^[[21~^[[23~^[[24~ also cygwin console below
-
-
Do something with these keys:
-------
Pgdn: \e[6~
Ins: \e[2~
Del: \7f
+F1: \e[11~
+F2: \e[12~
+F3: \e[13~
+F4: \e[14~
+F5: \e[15~
+F6: \e[17~
+F7: \e[18~
+F8: \e[19~
+F9: \e[20~
+F10: \e[21~
+F11: \e[23~
+F12: \e[24~
Ctrl-arrow: -
Alt-arrow: - (can set Alt=ESC mode, but doesn't work with arrow keys)
Pgdn: \e[6~
Ins: \e[2~
Del: \e[3~
+F1: \e[11~
+F2: \e[12~
+F3: \e[13~
+F4: \e[14~
+F5: \e[15~
+F6: \e[17~
+F7: \e[18~
+F8: \e[19~
+F9: \e[20~
+F10: \e[21~
+F11: \e[23~
+F12: \e[24~
Ctrl-arrow: \eOC \eOD \eOA \eOB
Ctrl-home: -
PgDn: \e[6~
Ins: \e[2~
Del: \e[3~
+F1: \eOP
+F2: \eOQ
+F3: \eOR
+F4: \eOS
+F5: \e[15~
+F6: \e[17~
+F7: \e[18~
+F8: \e[19~
+F9: \e[20~
+F10: \e[21~
+F11: \e[23~
+F12: \e[24~
Ctrl-arrow: \e[1;5C \e[1;5D \e[1;5A \e[1;5B
Ctrl-home: \e[1;5H
Ins: \e[2~
Del: \e[3~
+F1: \e[11~
+F2: \e[12~
+F3: \e[13~
+F4: \e[14~
+F5: \e[15~
+F6: \e[17~
+F7: \e[18~
+F8: \e[19~
+F9: \e[20~
+F10: \e[21~
+F11: \e[23~
+F12: \e[24~
+
Ctrl-arrow: \eOc \eOd \eOa \eOb
Ctrl-home: \e[7^
Ctrl-end: \e[8^
PgDn: \e[6~
Ins: \e[2~
Del: \e[3~
+F1: -
+F2: \eOQ
+F3: \eOR
+F4: \eOS
+F5: \e[15~~
+F6: \e[17~~
+F7: \e[18~~
+F8: \e[19~
+F9: \e[20~
+F10: -
+F11: \e[23~
+F12: \e[24~
Ctrl-arrow: \e[5C \e[5D \e[5A \e[5B
Ctrl-home: \eOH
PgDn: \e[6~
Ins: \e[2~
Del: \e[3~
+F1: \eOP
+F2: \eOQ
+F3: \eOR
+F4: \eOS
+F5: \e[15~
+F6: \e[17~
+F7: \e[18~
+F8: \e[19~
+F9: \e[20~
+F10: \e[21~
+F11: \e[23~
+F12: \e[24~
Ctrl-arrows: \e[C \e[D \e[A \e[B
Ctrl-home: \e[H
PgDn: \e[6~
Ins: \e[2~
Del: \e[3~
+F1: \e[[A
+F2: \e[[B
+F3: \e[[C
+F4: \e[[D
+F5: \e[[E
+F6: \e[17~
+F7: \e[18~
+F8: \e[19~
+F9: \e[20~
+F10: \e[21~
+F11: \e[23~
+F12: \e[24~
Ctrl-arrows: \e[C \e[D \e[A \e[B
Ctrl-home: \e[1~
PgDn: \e[6~
Ins: \e[2~
Del: \e[3~
+F1: \e[[A
+F2: \e[[B
+F3: \e[[C
+F4: \e[[D
+F5: \e[[E
+F6: \e[17~
+F7: \e[18~
+F8: \e[19~
+F9: \e[20~
+F10: \e[21~
+F11: \e[23~
+F12: \e[24~
Ctrl-arrows: -
Shift-arrows: -
back to start mode?
+
- save all files without asking thing for quick compile
- better parsing of compile messages
+
- continued search mode for jpico?
- smarter highlighter- need char and string storage.
Although, if merged, it must be disabled by default like mksh’s HISTFILE is:
18:48⎜«asarch» That would be for a wish list then: to keep the
⎜ list of all opened files with their last position
- Natureshadow agrees with me that this is a JOE antifeature
+ Natureshadow agrees with me that this is a JOE antifeature
Update documentation.
HTML-style thing for option selection?
+
Terminal handling:
Emit ESC c to reset terminal on startup?
labeled ftype that is switched to using the UI (command)
• switch from autoconf to mirtoconf2
• ANSI syntax highlighting; auto-turn it on in shell windows (‽)
- ⇒ would need to hide the ANSI chars, yet enable backspacing
-• handle combining characters in the scrn array somehow
+• proper redraw for lines that had combining characters in them
• add a soft line break flag: display as line-wrapped, do not
save any newlines introduced by that
• put all configuration files into /usr/share; use XDG dirs for
• rc.c: struct glopts.set (int*) violates the strict aliasing
rule as it’s treated as (unsigned char *) for type 2 (global
option string), consider a union instead (check local types!)
-• killjoe equivalent to not exit 0; consider elsewhere too…
- (hardcoded in main.c, maybe leave=2?)
-• !isatty(0), as in foo|xargs jupp (or use BSD xargs -o ?)
-• presentation mode (^KP, ^KN, ^QBKBQKKKK/) on some F-keys
• …
__________________________________________________________________
-$MirOS: contrib/code/jupp/TODO,v 1.36 2017/07/09 01:03:53 tg Exp $
+$MirOS: contrib/code/jupp/TODO,v 1.30 2017/01/11 22:04:31 tg Exp $
# serial 2
-# Check whether the underlying filesystem supports filenames
+# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
-/* $MirOS: contrib/code/jupp/bw.c,v 1.22 2017/07/09 01:15:51 tg Exp $ */
+/* $MirOS: contrib/code/jupp/bw.c,v 1.21 2016/10/08 19:28:53 tg Exp $ */
/*
* Edit buffer window generation
* Copyright
wid = 1;
}
- if (wid >= 0) {
+ if(wid>0) {
col += wid;
if (col == scr) {
--amnt;
jupp (3.1.30-2) UNRELEASED; urgency=medium
* Mention that the WordStar emulation only applies to non-document mode
- * Update to CVS snapshot, for testing
* Policy 4.0.1: joe-jupp is no longer Priority extra but optional
-- Thorsten Glaser <tg@mirbsd.de> Tue, 08 Aug 2017 17:44:30 +0200
#if 0
.if "0" == "1"
#endif
-/* $MirOS: contrib/code/jupp/i18n.c,v 1.23 2017/08/07 21:38:49 tg Exp $ */
+/* $MirOS: contrib/code/jupp/i18n.c,v 1.16 2017/01/11 00:34:03 tg Exp $ */
/*
* UNICODE/ISO-10646 functions for JOE
* Copyright
* (C) 1992 Joseph H. Allen
- * Copyright © 2014, 2017
- * mirabilos <m@mirbsd.org>
+ * Copyright © 2014 Thorsten Glaser
*
* This file is part of JOE (Joe's Own Editor)
*
#include "utf8.h"
#include "i18n.h"
-/* From: X11/xc/programs/xterm/wcwidth.c,v 1.10 */
+/* From: X11/xc/programs/xterm/wcwidth.c,v 1.9 */
struct mb_ucsrange {
unsigned int beg;
unsigned int val);
/*
- * Generated from the Unicode Character Database, Version 10.0.0, by
- * MirOS: contrib/code/Snippets/eawparse,v 1.10 2017/07/12 22:47:26 tg Exp $
+ * Generated from the Unicode Character Database, Version 9.0.0, by
+ * MirOS: contrib/code/Snippets/eawparse,v 1.3 2014/11/16 12:16:24 tg Exp $
*/
static const struct mb_ucsrange mb_ucs_combining[] = {
{ 0x0AC7, 0x0AC8 },
{ 0x0ACD, 0x0ACD },
{ 0x0AE2, 0x0AE3 },
- { 0x0AFA, 0x0AFF },
{ 0x0B01, 0x0B01 },
{ 0x0B3C, 0x0B3C },
{ 0x0B3F, 0x0B3F },
{ 0x0CC6, 0x0CC6 },
{ 0x0CCC, 0x0CCD },
{ 0x0CE2, 0x0CE3 },
- { 0x0D00, 0x0D01 },
- { 0x0D3B, 0x0D3C },
+ { 0x0D01, 0x0D01 },
{ 0x0D41, 0x0D44 },
{ 0x0D4D, 0x0D4D },
{ 0x0D62, 0x0D63 },
{ 0x1CED, 0x1CED },
{ 0x1CF4, 0x1CF4 },
{ 0x1CF8, 0x1CF9 },
- { 0x1DC0, 0x1DF9 },
+ { 0x1DC0, 0x1DF5 },
{ 0x1DFB, 0x1DFF },
{ 0x200B, 0x200F },
{ 0x202A, 0x202E },
{ 0x1171D, 0x1171F },
{ 0x11722, 0x11725 },
{ 0x11727, 0x1172B },
- { 0x11A01, 0x11A06 },
- { 0x11A09, 0x11A0A },
- { 0x11A33, 0x11A38 },
- { 0x11A3B, 0x11A3E },
- { 0x11A47, 0x11A47 },
- { 0x11A51, 0x11A56 },
- { 0x11A59, 0x11A5B },
- { 0x11A8A, 0x11A96 },
- { 0x11A98, 0x11A99 },
{ 0x11C30, 0x11C36 },
{ 0x11C38, 0x11C3D },
{ 0x11C3F, 0x11C3F },
{ 0x11CAA, 0x11CB0 },
{ 0x11CB2, 0x11CB3 },
{ 0x11CB5, 0x11CB6 },
- { 0x11D31, 0x11D36 },
- { 0x11D3A, 0x11D3A },
- { 0x11D3C, 0x11D3D },
- { 0x11D3F, 0x11D45 },
- { 0x11D47, 0x11D47 },
{ 0x16AF0, 0x16AF4 },
{ 0x16B30, 0x16B36 },
{ 0x16F8F, 0x16F92 },
{ 0x2B1B, 0x2B1C },
{ 0x2B50, 0x2B50 },
{ 0x2B55, 0x2B55 },
- { 0x2E80, 0x3029 },
- { 0x302E, 0x303E },
- { 0x3040, 0x3098 },
- { 0x309B, 0xA4CF },
+ { 0x2E80, 0x303E },
+ { 0x3040, 0xA4CF },
{ 0xA960, 0xA97F },
{ 0xAC00, 0xD7A3 },
{ 0xF900, 0xFAFF },
{ 0xFE10, 0xFE19 },
{ 0xFE30, 0xFE6F },
- { 0xFF01, 0xFF60 },
+ { 0xFF00, 0xFF60 },
{ 0xFFE0, 0xFFE6 },
- { 0x16FE0, 0x16FE1 },
+ { 0x16FE0, 0x16FE0 },
{ 0x17000, 0x187EC },
{ 0x18800, 0x18AF2 },
- { 0x1B000, 0x1B11E },
- { 0x1B170, 0x1B2FB },
+ { 0x1B000, 0x1B001 },
{ 0x1F004, 0x1F004 },
{ 0x1F0CF, 0x1F0CF },
{ 0x1F18E, 0x1F18E },
{ 0x1F210, 0x1F23B },
{ 0x1F240, 0x1F248 },
{ 0x1F250, 0x1F251 },
- { 0x1F260, 0x1F265 },
{ 0x1F300, 0x1F320 },
{ 0x1F32D, 0x1F335 },
{ 0x1F337, 0x1F37C },
{ 0x1F6CC, 0x1F6CC },
{ 0x1F6D0, 0x1F6D2 },
{ 0x1F6EB, 0x1F6EC },
- { 0x1F6F4, 0x1F6F8 },
- { 0x1F910, 0x1F93E },
- { 0x1F940, 0x1F94C },
- { 0x1F950, 0x1F96B },
- { 0x1F980, 0x1F997 },
+ { 0x1F6F4, 0x1F6F6 },
+ { 0x1F910, 0x1F91E },
+ { 0x1F920, 0x1F927 },
+ { 0x1F930, 0x1F930 },
+ { 0x1F933, 0x1F93E },
+ { 0x1F940, 0x1F94B },
+ { 0x1F950, 0x1F95E },
+ { 0x1F980, 0x1F991 },
{ 0x1F9C0, 0x1F9C0 },
- { 0x1F9D0, 0x1F9E6 },
{ 0x20000, 0x2FFFD },
{ 0x30000, 0x3FFFD }
};
/*XXX possibly more */
static const struct mb_ucsrange joe_ctrlchars[] = {
- { 0x0080, 0x009F },
{ 0x200B, 0x200F },
{ 0x2028, 0x202E },
{ 0x2060, 0x2063 },
{ 0x2066, 0x206F },
- { 0xD800, 0xDFFF },
{ 0xFDD0, 0xFDEF },
{ 0xFEFF, 0xFEFF },
- { 0xFFF9, 0xFFFB }
+ { 0xFFF9, 0xFFFB },
+ { 0xFFFE, 0xFFFF }
};
-/* returns column width of control character, 0 for regular */
-unsigned char unictrlbuf[11];
-int unictrl(unsigned int ucs)
-{
- *unictrlbuf = 0;
-
- /* ASCII control characters use one screen column */
- if (ucs < 32 || ucs == 0x7F)
- return (1);
-
- /* not a control or noncharacter? */
- if (mb_ucsbsearch(joe_ctrlchars, NELEM(joe_ctrlchars),
- ucs) == (size_t)-1 && (ucs & 0xFFFE) != 0xFFFE && ucs <= 0x10FFFF)
- return (0);
-
- return (joe_snprintf_1((char *)unictrlbuf, sizeof(unictrlbuf),
- "<%X>", ucs));
-}
-
int joe_wcwidth(int wide, unsigned int ucs)
{
#ifndef TEST
/* MAKE_ISW functions... */
-/* From: contrib/hosted/tg/jupptables,v 1.4 2017/07/08 14:53:45 tg Exp $ */
+/* From: contrib/hosted/tg/jupptables,v 1.1 2013/11/30 23:58:29 tg Exp $ */
-#ifdef TEST_I18N
static const struct mb_ucsrange data_wctype_upper[] = {
{ 0x0041, 0x005A },
{ 0x00C0, 0x00D6 },
};
MAKE_ISW(lower)
-#endif
+/* plus U+005F (UNDERSCORE) */
static const struct mb_ucsrange data_wctype_alpha[] = {
{ 0x0041, 0x005A },
{ 0x005F, 0x005F },
{ 0x0824, 0x0824 },
{ 0x0828, 0x0828 },
{ 0x0840, 0x0858 },
- { 0x0860, 0x086A },
{ 0x08A0, 0x08B4 },
{ 0x08B6, 0x08BD },
{ 0x0904, 0x0939 },
{ 0x09DC, 0x09DD },
{ 0x09DF, 0x09E1 },
{ 0x09F0, 0x09F1 },
- { 0x09FC, 0x09FC },
{ 0x0A05, 0x0A0A },
{ 0x0A0F, 0x0A10 },
{ 0x0A13, 0x0A28 },
{ 0x309D, 0x309F },
{ 0x30A1, 0x30FA },
{ 0x30FC, 0x30FF },
- { 0x3105, 0x312E },
+ { 0x3105, 0x312D },
{ 0x3131, 0x318E },
{ 0x31A0, 0x31BA },
{ 0x31F0, 0x31FF },
{ 0x3400, 0x4DB5 },
- { 0x4E00, 0x9FEA },
+ { 0x4E00, 0x9FD5 },
{ 0xA000, 0xA48C },
{ 0xA4D0, 0xA4FD },
{ 0xA500, 0xA60C },
{ 0x10280, 0x1029C },
{ 0x102A0, 0x102D0 },
{ 0x10300, 0x1031F },
- { 0x1032D, 0x10340 },
+ { 0x10330, 0x10340 },
{ 0x10342, 0x10349 },
{ 0x10350, 0x10375 },
{ 0x10380, 0x1039D },
{ 0x11700, 0x11719 },
{ 0x118A0, 0x118DF },
{ 0x118FF, 0x118FF },
- { 0x11A00, 0x11A00 },
- { 0x11A0B, 0x11A32 },
- { 0x11A3A, 0x11A3A },
- { 0x11A50, 0x11A50 },
- { 0x11A5C, 0x11A83 },
- { 0x11A86, 0x11A89 },
{ 0x11AC0, 0x11AF8 },
{ 0x11C00, 0x11C08 },
{ 0x11C0A, 0x11C2E },
{ 0x11C40, 0x11C40 },
{ 0x11C72, 0x11C8F },
- { 0x11D00, 0x11D06 },
- { 0x11D08, 0x11D09 },
- { 0x11D0B, 0x11D30 },
- { 0x11D46, 0x11D46 },
{ 0x12000, 0x12399 },
{ 0x12480, 0x12543 },
{ 0x13000, 0x1342E },
{ 0x16F00, 0x16F44 },
{ 0x16F50, 0x16F50 },
{ 0x16F93, 0x16F9F },
- { 0x16FE0, 0x16FE1 },
+ { 0x16FE0, 0x16FE0 },
{ 0x17000, 0x187EC },
{ 0x18800, 0x18AF2 },
- { 0x1B000, 0x1B11E },
- { 0x1B170, 0x1B2FB },
+ { 0x1B000, 0x1B001 },
{ 0x1BC00, 0x1BC6A },
{ 0x1BC70, 0x1BC7C },
{ 0x1BC80, 0x1BC88 },
{ 0x2A700, 0x2B734 },
{ 0x2B740, 0x2B81D },
{ 0x2B820, 0x2CEA1 },
- { 0x2CEB0, 0x2EBE0 },
{ 0x2F800, 0x2FA1D }
};
return ((c >= 0x30 && c <= 0x39) ? 1 : 0);
}
+/*
+ * plus ;WS;
+ * except U+2007 (<noBreak> FIGURE SPACE)
+ * plus U+200B (ZERO WIDTH SPACE)
+ * plus U+2029 (PARAGRAPH SEPARATOR)
+ */
static const struct mb_ucsrange data_wctype_space[] = {
{ 0x0009, 0x000D },
{ 0x0020, 0x0020 },
MAKE_ISW(space)
-#ifdef TEST_I18N
+/*
+ * plus U+2028 (LINE SEPARATOR)
+ * plus U+2029 (PARAGRAPH SEPARATOR)
+ */
static const struct mb_ucsrange data_wctype_cntrl[] = {
{ 0x0000, 0x001F },
{ 0x007F, 0x009F },
};
MAKE_ISW(cntrl)
-#endif
static const struct mb_ucsrange data_wctype_punct[] = {
{ 0x0021, 0x002F },
{ 0x09E2, 0x09E3 },
{ 0x09E6, 0x09EF },
{ 0x09F2, 0x09FB },
- { 0x09FD, 0x09FD },
{ 0x0A01, 0x0A03 },
{ 0x0A3C, 0x0A3C },
{ 0x0A3E, 0x0A42 },
{ 0x0ACB, 0x0ACD },
{ 0x0AE2, 0x0AE3 },
{ 0x0AE6, 0x0AF1 },
- { 0x0AFA, 0x0AFF },
{ 0x0B01, 0x0B03 },
{ 0x0B3C, 0x0B3C },
{ 0x0B3E, 0x0B44 },
{ 0x0CD5, 0x0CD6 },
{ 0x0CE2, 0x0CE3 },
{ 0x0CE6, 0x0CEF },
- { 0x0D00, 0x0D03 },
- { 0x0D3B, 0x0D3C },
+ { 0x0D01, 0x0D03 },
{ 0x0D3E, 0x0D44 },
{ 0x0D46, 0x0D48 },
{ 0x0D4A, 0x0D4D },
{ 0x1CD0, 0x1CE8 },
{ 0x1CED, 0x1CED },
{ 0x1CF2, 0x1CF4 },
- { 0x1CF7, 0x1CF9 },
- { 0x1DC0, 0x1DF9 },
+ { 0x1CF8, 0x1CF9 },
+ { 0x1DC0, 0x1DF5 },
{ 0x1DFB, 0x1DFF },
{ 0x1FBD, 0x1FBD },
{ 0x1FBF, 0x1FC1 },
{ 0x2066, 0x2070 },
{ 0x2074, 0x207E },
{ 0x2080, 0x208E },
- { 0x20A0, 0x20BF },
+ { 0x20A0, 0x20BE },
{ 0x20D0, 0x20F0 },
{ 0x2100, 0x2101 },
{ 0x2103, 0x2106 },
{ 0x214F, 0x215F },
{ 0x2180, 0x2182 },
{ 0x2185, 0x218B },
- { 0x2190, 0x2426 },
+ { 0x2190, 0x23FE },
+ { 0x2400, 0x2426 },
{ 0x2440, 0x244A },
{ 0x2460, 0x24B5 },
{ 0x24EA, 0x2B73 },
{ 0x2B76, 0x2B95 },
{ 0x2B98, 0x2BB9 },
{ 0x2BBD, 0x2BC8 },
- { 0x2BCA, 0x2BD2 },
+ { 0x2BCA, 0x2BD1 },
{ 0x2BEC, 0x2BEF },
{ 0x2CE5, 0x2CEA },
{ 0x2CEF, 0x2CF1 },
{ 0x2D70, 0x2D70 },
{ 0x2D7F, 0x2D7F },
{ 0x2DE0, 0x2E2E },
- { 0x2E30, 0x2E49 },
+ { 0x2E30, 0x2E44 },
{ 0x2E80, 0x2E99 },
{ 0x2E9B, 0x2EF3 },
{ 0x2F00, 0x2FD5 },
{ 0x1171D, 0x1172B },
{ 0x11730, 0x1173F },
{ 0x118E0, 0x118F2 },
- { 0x11A01, 0x11A0A },
- { 0x11A33, 0x11A39 },
- { 0x11A3B, 0x11A47 },
- { 0x11A51, 0x11A5B },
- { 0x11A8A, 0x11A9C },
- { 0x11A9E, 0x11AA2 },
{ 0x11C2F, 0x11C36 },
{ 0x11C38, 0x11C3F },
{ 0x11C41, 0x11C45 },
{ 0x11C70, 0x11C71 },
{ 0x11C92, 0x11CA7 },
{ 0x11CA9, 0x11CB6 },
- { 0x11D31, 0x11D36 },
- { 0x11D3A, 0x11D3A },
- { 0x11D3C, 0x11D3D },
- { 0x11D3F, 0x11D45 },
- { 0x11D47, 0x11D47 },
- { 0x11D50, 0x11D59 },
{ 0x12400, 0x1246E },
{ 0x12470, 0x12474 },
{ 0x16A60, 0x16A69 },
{ 0x1F210, 0x1F23B },
{ 0x1F240, 0x1F248 },
{ 0x1F250, 0x1F251 },
- { 0x1F260, 0x1F265 },
- { 0x1F300, 0x1F6D4 },
+ { 0x1F300, 0x1F6D2 },
{ 0x1F6E0, 0x1F6EC },
- { 0x1F6F0, 0x1F6F8 },
+ { 0x1F6F0, 0x1F6F6 },
{ 0x1F700, 0x1F773 },
{ 0x1F780, 0x1F7D4 },
{ 0x1F800, 0x1F80B },
{ 0x1F850, 0x1F859 },
{ 0x1F860, 0x1F887 },
{ 0x1F890, 0x1F8AD },
- { 0x1F900, 0x1F90B },
- { 0x1F910, 0x1F93E },
- { 0x1F940, 0x1F94C },
- { 0x1F950, 0x1F96B },
- { 0x1F980, 0x1F997 },
+ { 0x1F910, 0x1F91E },
+ { 0x1F920, 0x1F927 },
+ { 0x1F930, 0x1F930 },
+ { 0x1F933, 0x1F93E },
+ { 0x1F940, 0x1F94B },
+ { 0x1F950, 0x1F95E },
+ { 0x1F980, 0x1F991 },
{ 0x1F9C0, 0x1F9C0 },
- { 0x1F9D0, 0x1F9E6 },
{ 0xE0001, 0xE0001 },
{ 0xE0020, 0xE007F },
{ 0xE0100, 0xE01EF },
MAKE_ISW(punct)
-#ifdef TEST_I18N
static const struct mb_ucsrange data_wctype_graph[] = {
{ 0x0021, 0x007E },
{ 0x00A0, 0x0377 },
{ 0x0830, 0x083E },
{ 0x0840, 0x085B },
{ 0x085E, 0x085E },
- { 0x0860, 0x086A },
{ 0x08A0, 0x08B4 },
{ 0x08B6, 0x08BD },
{ 0x08D4, 0x0983 },
{ 0x09D7, 0x09D7 },
{ 0x09DC, 0x09DD },
{ 0x09DF, 0x09E3 },
- { 0x09E6, 0x09FD },
+ { 0x09E6, 0x09FB },
{ 0x0A01, 0x0A03 },
{ 0x0A05, 0x0A0A },
{ 0x0A0F, 0x0A10 },
{ 0x0AD0, 0x0AD0 },
{ 0x0AE0, 0x0AE3 },
{ 0x0AE6, 0x0AF1 },
- { 0x0AF9, 0x0AFF },
+ { 0x0AF9, 0x0AF9 },
{ 0x0B01, 0x0B03 },
{ 0x0B05, 0x0B0C },
{ 0x0B0F, 0x0B10 },
{ 0x0CE0, 0x0CE3 },
{ 0x0CE6, 0x0CEF },
{ 0x0CF1, 0x0CF2 },
- { 0x0D00, 0x0D03 },
+ { 0x0D01, 0x0D03 },
{ 0x0D05, 0x0D0C },
{ 0x0D0E, 0x0D10 },
- { 0x0D12, 0x0D44 },
+ { 0x0D12, 0x0D3A },
+ { 0x0D3D, 0x0D44 },
{ 0x0D46, 0x0D48 },
{ 0x0D4A, 0x0D4F },
{ 0x0D54, 0x0D63 },
{ 0x1C3B, 0x1C49 },
{ 0x1C4D, 0x1C88 },
{ 0x1CC0, 0x1CC7 },
- { 0x1CD0, 0x1CF9 },
- { 0x1D00, 0x1DF9 },
+ { 0x1CD0, 0x1CF6 },
+ { 0x1CF8, 0x1CF9 },
+ { 0x1D00, 0x1DF5 },
{ 0x1DFB, 0x1F15 },
{ 0x1F18, 0x1F1D },
{ 0x1F20, 0x1F45 },
{ 0x2066, 0x2071 },
{ 0x2074, 0x208E },
{ 0x2090, 0x209C },
- { 0x20A0, 0x20BF },
+ { 0x20A0, 0x20BE },
{ 0x20D0, 0x20F0 },
{ 0x2100, 0x218B },
- { 0x2190, 0x2426 },
+ { 0x2190, 0x23FE },
+ { 0x2400, 0x2426 },
{ 0x2440, 0x244A },
{ 0x2460, 0x2B73 },
{ 0x2B76, 0x2B95 },
{ 0x2B98, 0x2BB9 },
{ 0x2BBD, 0x2BC8 },
- { 0x2BCA, 0x2BD2 },
+ { 0x2BCA, 0x2BD1 },
{ 0x2BEC, 0x2BEF },
{ 0x2C00, 0x2C2E },
{ 0x2C30, 0x2C5E },
{ 0x2DC8, 0x2DCE },
{ 0x2DD0, 0x2DD6 },
{ 0x2DD8, 0x2DDE },
- { 0x2DE0, 0x2E49 },
+ { 0x2DE0, 0x2E44 },
{ 0x2E80, 0x2E99 },
{ 0x2E9B, 0x2EF3 },
{ 0x2F00, 0x2FD5 },
{ 0x3000, 0x303F },
{ 0x3041, 0x3096 },
{ 0x3099, 0x30FF },
- { 0x3105, 0x312E },
+ { 0x3105, 0x312D },
{ 0x3131, 0x318E },
{ 0x3190, 0x31BA },
{ 0x31C0, 0x31E3 },
{ 0x31F0, 0x321E },
{ 0x3220, 0x32FE },
{ 0x3300, 0x4DB5 },
- { 0x4DC0, 0x9FEA },
+ { 0x4DC0, 0x9FD5 },
{ 0xA000, 0xA48C },
{ 0xA490, 0xA4C6 },
{ 0xA4D0, 0xA62B },
{ 0x102A0, 0x102D0 },
{ 0x102E0, 0x102FB },
{ 0x10300, 0x10323 },
- { 0x1032D, 0x1034A },
+ { 0x10330, 0x1034A },
{ 0x10350, 0x1037A },
{ 0x10380, 0x1039D },
{ 0x1039F, 0x103C3 },
{ 0x11730, 0x1173F },
{ 0x118A0, 0x118F2 },
{ 0x118FF, 0x118FF },
- { 0x11A00, 0x11A47 },
- { 0x11A50, 0x11A83 },
- { 0x11A86, 0x11A9C },
- { 0x11A9E, 0x11AA2 },
{ 0x11AC0, 0x11AF8 },
{ 0x11C00, 0x11C08 },
{ 0x11C0A, 0x11C36 },
{ 0x11C70, 0x11C8F },
{ 0x11C92, 0x11CA7 },
{ 0x11CA9, 0x11CB6 },
- { 0x11D00, 0x11D06 },
- { 0x11D08, 0x11D09 },
- { 0x11D0B, 0x11D36 },
- { 0x11D3A, 0x11D3A },
- { 0x11D3C, 0x11D3D },
- { 0x11D3F, 0x11D47 },
- { 0x11D50, 0x11D59 },
{ 0x12000, 0x12399 },
{ 0x12400, 0x1246E },
{ 0x12470, 0x12474 },
{ 0x16F00, 0x16F44 },
{ 0x16F50, 0x16F7E },
{ 0x16F8F, 0x16F9F },
- { 0x16FE0, 0x16FE1 },
+ { 0x16FE0, 0x16FE0 },
{ 0x17000, 0x187EC },
{ 0x18800, 0x18AF2 },
- { 0x1B000, 0x1B11E },
- { 0x1B170, 0x1B2FB },
+ { 0x1B000, 0x1B001 },
{ 0x1BC00, 0x1BC6A },
{ 0x1BC70, 0x1BC7C },
{ 0x1BC80, 0x1BC88 },
{ 0x1F210, 0x1F23B },
{ 0x1F240, 0x1F248 },
{ 0x1F250, 0x1F251 },
- { 0x1F260, 0x1F265 },
- { 0x1F300, 0x1F6D4 },
+ { 0x1F300, 0x1F6D2 },
{ 0x1F6E0, 0x1F6EC },
- { 0x1F6F0, 0x1F6F8 },
+ { 0x1F6F0, 0x1F6F6 },
{ 0x1F700, 0x1F773 },
{ 0x1F780, 0x1F7D4 },
{ 0x1F800, 0x1F80B },
{ 0x1F850, 0x1F859 },
{ 0x1F860, 0x1F887 },
{ 0x1F890, 0x1F8AD },
- { 0x1F900, 0x1F90B },
- { 0x1F910, 0x1F93E },
- { 0x1F940, 0x1F94C },
- { 0x1F950, 0x1F96B },
- { 0x1F980, 0x1F997 },
+ { 0x1F910, 0x1F91E },
+ { 0x1F920, 0x1F927 },
+ { 0x1F930, 0x1F930 },
+ { 0x1F933, 0x1F93E },
+ { 0x1F940, 0x1F94B },
+ { 0x1F950, 0x1F95E },
+ { 0x1F980, 0x1F991 },
{ 0x1F9C0, 0x1F9C0 },
- { 0x1F9D0, 0x1F9E6 },
{ 0x20000, 0x2A6D6 },
{ 0x2A700, 0x2B734 },
{ 0x2B740, 0x2B81D },
{ 0x2B820, 0x2CEA1 },
- { 0x2CEB0, 0x2EBE0 },
{ 0x2F800, 0x2FA1D },
{ 0xE0001, 0xE0001 },
{ 0xE0020, 0xE007F },
};
MAKE_ISW(graph)
-#endif
static const struct mb_ucsrange data_wctype_print[] = {
{ 0x0020, 0x007E },
{ 0x0830, 0x083E },
{ 0x0840, 0x085B },
{ 0x085E, 0x085E },
- { 0x0860, 0x086A },
{ 0x08A0, 0x08B4 },
{ 0x08B6, 0x08BD },
{ 0x08D4, 0x0983 },
{ 0x09D7, 0x09D7 },
{ 0x09DC, 0x09DD },
{ 0x09DF, 0x09E3 },
- { 0x09E6, 0x09FD },
+ { 0x09E6, 0x09FB },
{ 0x0A01, 0x0A03 },
{ 0x0A05, 0x0A0A },
{ 0x0A0F, 0x0A10 },
{ 0x0AD0, 0x0AD0 },
{ 0x0AE0, 0x0AE3 },
{ 0x0AE6, 0x0AF1 },
- { 0x0AF9, 0x0AFF },
+ { 0x0AF9, 0x0AF9 },
{ 0x0B01, 0x0B03 },
{ 0x0B05, 0x0B0C },
{ 0x0B0F, 0x0B10 },
{ 0x0CE0, 0x0CE3 },
{ 0x0CE6, 0x0CEF },
{ 0x0CF1, 0x0CF2 },
- { 0x0D00, 0x0D03 },
+ { 0x0D01, 0x0D03 },
{ 0x0D05, 0x0D0C },
{ 0x0D0E, 0x0D10 },
- { 0x0D12, 0x0D44 },
+ { 0x0D12, 0x0D3A },
+ { 0x0D3D, 0x0D44 },
{ 0x0D46, 0x0D48 },
{ 0x0D4A, 0x0D4F },
{ 0x0D54, 0x0D63 },
{ 0x1C3B, 0x1C49 },
{ 0x1C4D, 0x1C88 },
{ 0x1CC0, 0x1CC7 },
- { 0x1CD0, 0x1CF9 },
- { 0x1D00, 0x1DF9 },
+ { 0x1CD0, 0x1CF6 },
+ { 0x1CF8, 0x1CF9 },
+ { 0x1D00, 0x1DF5 },
{ 0x1DFB, 0x1F15 },
{ 0x1F18, 0x1F1D },
{ 0x1F20, 0x1F45 },
{ 0x2066, 0x2071 },
{ 0x2074, 0x208E },
{ 0x2090, 0x209C },
- { 0x20A0, 0x20BF },
+ { 0x20A0, 0x20BE },
{ 0x20D0, 0x20F0 },
{ 0x2100, 0x218B },
- { 0x2190, 0x2426 },
+ { 0x2190, 0x23FE },
+ { 0x2400, 0x2426 },
{ 0x2440, 0x244A },
{ 0x2460, 0x2B73 },
{ 0x2B76, 0x2B95 },
{ 0x2B98, 0x2BB9 },
{ 0x2BBD, 0x2BC8 },
- { 0x2BCA, 0x2BD2 },
+ { 0x2BCA, 0x2BD1 },
{ 0x2BEC, 0x2BEF },
{ 0x2C00, 0x2C2E },
{ 0x2C30, 0x2C5E },
{ 0x2DC8, 0x2DCE },
{ 0x2DD0, 0x2DD6 },
{ 0x2DD8, 0x2DDE },
- { 0x2DE0, 0x2E49 },
+ { 0x2DE0, 0x2E44 },
{ 0x2E80, 0x2E99 },
{ 0x2E9B, 0x2EF3 },
{ 0x2F00, 0x2FD5 },
{ 0x3000, 0x303F },
{ 0x3041, 0x3096 },
{ 0x3099, 0x30FF },
- { 0x3105, 0x312E },
+ { 0x3105, 0x312D },
{ 0x3131, 0x318E },
{ 0x3190, 0x31BA },
{ 0x31C0, 0x31E3 },
{ 0x31F0, 0x321E },
{ 0x3220, 0x32FE },
{ 0x3300, 0x4DB5 },
- { 0x4DC0, 0x9FEA },
+ { 0x4DC0, 0x9FD5 },
{ 0xA000, 0xA48C },
{ 0xA490, 0xA4C6 },
{ 0xA4D0, 0xA62B },
{ 0x102A0, 0x102D0 },
{ 0x102E0, 0x102FB },
{ 0x10300, 0x10323 },
- { 0x1032D, 0x1034A },
+ { 0x10330, 0x1034A },
{ 0x10350, 0x1037A },
{ 0x10380, 0x1039D },
{ 0x1039F, 0x103C3 },
{ 0x11730, 0x1173F },
{ 0x118A0, 0x118F2 },
{ 0x118FF, 0x118FF },
- { 0x11A00, 0x11A47 },
- { 0x11A50, 0x11A83 },
- { 0x11A86, 0x11A9C },
- { 0x11A9E, 0x11AA2 },
{ 0x11AC0, 0x11AF8 },
{ 0x11C00, 0x11C08 },
{ 0x11C0A, 0x11C36 },
{ 0x11C70, 0x11C8F },
{ 0x11C92, 0x11CA7 },
{ 0x11CA9, 0x11CB6 },
- { 0x11D00, 0x11D06 },
- { 0x11D08, 0x11D09 },
- { 0x11D0B, 0x11D36 },
- { 0x11D3A, 0x11D3A },
- { 0x11D3C, 0x11D3D },
- { 0x11D3F, 0x11D47 },
- { 0x11D50, 0x11D59 },
{ 0x12000, 0x12399 },
{ 0x12400, 0x1246E },
{ 0x12470, 0x12474 },
{ 0x16F00, 0x16F44 },
{ 0x16F50, 0x16F7E },
{ 0x16F8F, 0x16F9F },
- { 0x16FE0, 0x16FE1 },
+ { 0x16FE0, 0x16FE0 },
{ 0x17000, 0x187EC },
{ 0x18800, 0x18AF2 },
- { 0x1B000, 0x1B11E },
- { 0x1B170, 0x1B2FB },
+ { 0x1B000, 0x1B001 },
{ 0x1BC00, 0x1BC6A },
{ 0x1BC70, 0x1BC7C },
{ 0x1BC80, 0x1BC88 },
{ 0x1F210, 0x1F23B },
{ 0x1F240, 0x1F248 },
{ 0x1F250, 0x1F251 },
- { 0x1F260, 0x1F265 },
- { 0x1F300, 0x1F6D4 },
+ { 0x1F300, 0x1F6D2 },
{ 0x1F6E0, 0x1F6EC },
- { 0x1F6F0, 0x1F6F8 },
+ { 0x1F6F0, 0x1F6F6 },
{ 0x1F700, 0x1F773 },
{ 0x1F780, 0x1F7D4 },
{ 0x1F800, 0x1F80B },
{ 0x1F850, 0x1F859 },
{ 0x1F860, 0x1F887 },
{ 0x1F890, 0x1F8AD },
- { 0x1F900, 0x1F90B },
- { 0x1F910, 0x1F93E },
- { 0x1F940, 0x1F94C },
- { 0x1F950, 0x1F96B },
- { 0x1F980, 0x1F997 },
+ { 0x1F910, 0x1F91E },
+ { 0x1F920, 0x1F927 },
+ { 0x1F930, 0x1F930 },
+ { 0x1F933, 0x1F93E },
+ { 0x1F940, 0x1F94B },
+ { 0x1F950, 0x1F95E },
+ { 0x1F980, 0x1F991 },
{ 0x1F9C0, 0x1F9C0 },
- { 0x1F9D0, 0x1F9E6 },
{ 0x20000, 0x2A6D6 },
{ 0x2A700, 0x2B734 },
{ 0x2B740, 0x2B81D },
{ 0x2B820, 0x2CEA1 },
- { 0x2CEB0, 0x2EBE0 },
{ 0x2F800, 0x2FA1D },
{ 0xE0001, 0xE0001 },
{ 0xE0020, 0xE007F },
MAKE_ISW(print)
-#ifdef TEST_I18N
static const struct mb_ucsrange data_wctype_xdigit[] = {
{ 0x0030, 0x0039 },
{ 0x0041, 0x0046 },
MAKE_ISW(xdigit)
+/*
+ * plus ;Zs;
+ * except U+00A0 (<noBreak> NON-BREAKING SPACE)
+ * except U+2007 (<noBreak> FIGURE SPACE)
+ * except U+202F (<noBreak> NARROW NO-BREAK SPACE)
+ * plus U+200B (ZERO WIDTH SPACE)
+ */
static const struct mb_ucsrange data_wctype_blank[] = {
{ 0x0009, 0x0009 },
{ 0x0020, 0x0020 },
};
MAKE_ISW(blank)
-#endif
/* Conversion functions */
}
#endif
+/* Return true if c is a control character which should not be displayed */
+int unictrl(unsigned int ucs)
+{
+ /* C0 Control characters are one column wide in JOE */
+ if (ucs < 32 || ucs == 0x7F)
+ return (1);
+
+ /* C1 control characters... */
+ if (ucs >= 0x80 && ucs < 0xA0)
+ return (4);
+
+ /* More control characters... */
+ if (mb_ucsbsearch(joe_ctrlchars, NELEM(joe_ctrlchars), ucs) != (size_t)-1)
+ return (6);
+
+ if ((ucs & 0xFFFE) == 0xFFFE)
+ return (ucs > 0xFFFFF ? 8 : 7);
+
+ return (0);
+}
+
#if 0
.endif
-/* $MirOS: contrib/code/jupp/i18n.h,v 1.8 2017/07/08 16:23:26 tg Exp $ */
+/* $MirOS: contrib/code/jupp/i18n.h,v 1.6 2014/07/25 21:41:49 tg Exp $ */
#ifndef _Ii18n
#define _Ii18n 1
#include "config.h"
#include "types.h"
-#ifdef TEST_I18N
int joe_iswupper PARAMS((struct charmap *,int c));
int joe_iswlower PARAMS((struct charmap *,int c));
-#endif
/* the following two include _ */
int joe_iswalpha PARAMS((struct charmap *,int c));
int joe_iswdigit PARAMS((struct charmap *,int c));
int joe_iswspace PARAMS((struct charmap *,int c));
-#ifdef TEST_I18N
int joe_iswcntrl PARAMS((struct charmap *,int c));
-#endif
int joe_iswpunct PARAMS((struct charmap *,int c));
-#ifdef TEST_I18N
int joe_iswgraph PARAMS((struct charmap *,int c));
-#endif
int joe_iswprint PARAMS((struct charmap *,int c));
-#ifdef TEST_I18N
int joe_iswxdigit PARAMS((struct charmap *,int c));
int joe_iswblank PARAMS((struct charmap *,int c));
-#endif
int joe_wcwidth PARAMS((int wide, unsigned int c));
/* Looking for wswidth? Take a look at scrn.c/txtwidth() */
int joe_towupper PARAMS((struct charmap *,int c));
int joe_towlower PARAMS((struct charmap *,int c));
-extern unsigned char unictrlbuf[11];
int unictrl PARAMS((unsigned int c));
#endif
-/* $MirOS: contrib/code/jupp/macro.c,v 1.8 2017/03/19 19:19:50 tg Exp $ */
+/* $MirOS: contrib/code/jupp/macro.c,v 1.7 2012/12/22 00:06:11 tg Exp $ */
/*
* Keyboard macros
* Copyright
if (notify)
*notify = 1;
num = calc(bw, s);
- if (merrf) {
- msgnw(bw->parent, merrt);
+ if (merr) {
+ msgnw(bw->parent, merr);
return -1;
}
arg = num;
-/* $MirOS: contrib/code/jupp/rc.c,v 1.23 2017/03/19 19:19:50 tg Exp $ */
+/* $MirOS: contrib/code/jupp/rc.c,v 1.22 2017/01/11 22:04:32 tg Exp $ */
/*
* *rc file parser
* Copyright
break;
}
v = calc(bw, s);
- if (merrf) {
- msgnw(bw->parent, merrt);
+ if (merr) {
+ msgnw(bw->parent, merr);
ret = -1;
} else if (v >= glopts[x].low && v <= glopts[x].high)
*glopts[x].set = v;
break;
}
v = calc(bw, s);
- if (merrf) {
- msgnw(bw->parent, merrt);
+ if (merr) {
+ msgnw(bw->parent, merr);
ret = -1;
} else if (v >= glopts[x].low && v <= glopts[x].high)
*(int *) ((unsigned char *) &bw->o + glopts[x].ofst) = v;
break;
}
v = calc(bw, s) - 1.0;
- if (merrf) {
- msgnw(bw->parent, merrt);
+ if (merr) {
+ msgnw(bw->parent, merr);
ret = -1;
} else if (v >= glopts[x].low && v <= glopts[x].high)
*(int *) ((unsigned char *) &bw->o + glopts[x].ofst) = v;
-/* $MirOS: contrib/code/jupp/scrn.c,v 1.25 2017/07/09 01:19:54 tg Exp $ */
+/* $MirOS: contrib/code/jupp/scrn.c,v 1.19 2017/01/10 23:59:33 tg Exp $ */
/*
* Device independant TTY interface for JOE
* Copyright
if(locale_map->type) {
/* UTF-8 char to UTF-8 terminal */
int wid;
+ int uni_ctrl = 0;
+ unsigned char buf[16];
- switch ((wid = unictrl(c))) {
- case 0:
- /* not a control character */
- wid = joe_wcwidth(1, c);
- break;
- case 1:
- c ^= 0x40;
- default:
+ /* Deal with control characters */
+ if (c<32) {
+ c = c + '@';
a ^= UNDERLINE;
- break;
+ } else if (c==127) {
+ c = '?';
+ a ^= UNDERLINE;
+ } else if (unictrl(c)) {
+ a ^= UNDERLINE;
+ uni_ctrl = 1;
}
if(*scrn==c && *attrf==a)
return;
+ wid = joe_wcwidth(1,c);
+
*scrn = c;
*attrf = a;
if(t->ins)
cpos(t, xx, yy);
if(t->attrib != a)
set_attr(t, a);
- if (*unictrlbuf) {
- ttputs(unictrlbuf);
+ if (uni_ctrl) {
+ joe_snprintf_1((char *)buf,16,"<%X>",c);
+ ttputs(buf);
} else {
- unsigned char buf[7];
-
utf8_encode(buf,c);
ttputs(buf);
- if (wid == 0 && xx > 0)
- attrf[-1] |= HAS_COMBINING;
}
t->x+=wid;
while (wid>1) {
t->x++;
} else {
/* Non UTF-8 char to UTF-8 terminal */
- unsigned char buf[7];
+ unsigned char buf[16];
int wid;
/* Deal with control characters */
if(*cs<32 || *cs>=127)
break;
- /* has a combining character attached? */
- if (*as & HAS_COMBINING)
- break;
-
if (*as != t->attrib)
set_attr(t, *as);
if (q > 0) {
int z, fu;
- for (z = x; z != t->co - 1 && ofst[z] == q; ++z)
- ;
+ for (z = x; z != t->co - 1 && ofst[z] == q; ++z) ;
while (s[x] == cs[x] && x < placex)
++x;
dodelchr(t, x, y, q);
} else {
int z, fu;
- for (z = x; z != t->co - 1 && ofst[z] == q; ++z)
- ;
+ for (z = x; z != t->co - 1 && ofst[z] == q; ++z) ;
while (s[x + q] == cs[x + q] && x - q < placex)
++x;
doinschr(t, x + q, y, s + x + q, a + x + q, -q);
doupscrl(t, y, z + q, q);
y = z - 1;
} else {
- for (r = y; r != t->li && (t->sary[r] < 0 || t->sary[r] == t->li); ++r)
- ;
+ for (r = y; r != t->li && (t->sary[r] < 0 || t->sary[r] == t->li); ++r) ;
p = r - 1;
do {
q = t->sary[p];
if (q && q != t->li) {
- for (z = p; t->sary[z] = 0, (z && t->sary[z - 1] == q); --z)
- ;
+ for (z = p; t->sary[z] = 0, (z && t->sary[z - 1] == q); --z) ;
dodnscrl(t, z + q, p + 1, -q);
p = z + 1;
}
for (x = top; x != top + amnt; ++x) {
t->updtab[x] = 1;
t->syntab[x] = -1;
- }
+ }
}
if (amnt > bot - top)
amnt = bot - top;
if (amnt == bot - top) {
msetI(t->updtab + top, 1, amnt);
msetI(t->syntab + top, -1, amnt);
- }
+ }
}
void nscrlup(SCRN *t, int top, int bot, int amnt)
for (x = bot - amnt; x != bot; ++x) {
t->updtab[x] = 1;
t->syntab[x] = -1;
- }
+ }
}
if (amnt > bot - top)
amnt = bot - top;
if (amnt == bot - top) {
msetI(t->updtab + bot - amnt, 1, amnt);
msetI(t->syntab + bot - amnt, -1, amnt);
- }
+ }
}
extern volatile int dostaupd;
wid = joe_wcwidth(1,c);
} else {
/* Byte mode: character is one column wide */
- wid = 1;
+ wid = 1 ;
}
- if (wid >= 0) {
+ if (wid>=0) {
if (col >= ofst) {
if (x + wid > last_col) {
/* Character crosses end of field, so fill balance of field with '>' characters instead */
++attr;
++x;
}
- } else /* if (wid >(=) 0) */ {
+ } else if(wid) {
/* Emit character */
outatr(locale_map, t, scrn, attr, x, y, c, my_atr);
x += wid;
}
} else
col += wid;
- }
+ }
}
/* Fill balance of field with spaces */
while (x < last_col) {
/* UTF-8 mode: decode character and determine its width */
c = utf8_decode(&sm,c);
if (c >= 0) {
- wid = joe_wcwidth(1, c);
+ wid = joe_wcwidth(1,c);
}
} else {
/* Byte mode: character is one column wide */
- wid = 1;
+ wid = 1 ;
}
- if (wid >= 0) {
+ if (wid>=0) {
if (col >= ofst) {
outatr(locale_map, t, scrn, attr, x, y, c, atr);
scrn += wid;
-/* $MirOS: contrib/code/jupp/scrn.h,v 1.5 2017/07/09 01:03:54 tg Exp $ */
+/* $MirOS: contrib/code/jupp/scrn.h,v 1.4 2012/12/30 17:10:58 tg Exp $ */
/*
* Device independant tty interface for JOE
* Copyright
#define FG_RED (14<<FG_SHIFT)
#define FG_BLACK (15<<FG_SHIFT)
-#define HAS_COMBINING 0x200000
-
void outatr PARAMS((struct charmap *map,SCRN *t,int *scrn,int *attrf,int xx,int yy,int c,int a));
#endif
-/* $MirOS: contrib/code/jupp/syntax.c,v 1.17 2017/07/08 16:15:12 tg Exp $ */
+/* $MirOS: contrib/code/jupp/syntax.c,v 1.16 2017/01/11 22:04:33 tg Exp $ */
/*
* Syntax highlighting DFA interpreter
* Copyright
#include "syntax.h"
static struct {
- unsigned char buf[7];
+ unsigned char buf[6];
unsigned char start;
unsigned char limit;
unsigned eaten : 1;
-/* $MirOS: contrib/code/jupp/tty.c,v 1.23 2017/03/19 19:19:51 tg Exp $ */
+/* $MirOS: contrib/code/jupp/tty.c,v 1.22 2016/10/30 02:38:35 tg Exp $ */
/*
* UNIX Tty and Process interface
* Copyright
signrm();
}
-static volatile sig_atomic_t winched = 0;
+static int winched = 0;
#ifdef SIGWINCH
/* Window size interrupt handler */
static RETSIGTYPE winchd(int unused)
{
- winched = 1;
+ ++winched;
REINSTALL_SIGHANDLER(SIGWINCH, winchd);
}
#endif
/* Second ticker */
-static volatile sig_atomic_t ticked = 0;
+int ticked = 0;
extern int dostaupd;
static RETSIGTYPE dotick(int unused)
{
/* Timer interrupt handler */
-static volatile sig_atomic_t yep;
+static int yep;
static RETSIGTYPE dosig(int unused)
{
yep = 1;
void mpxdied(MPX *m);
-static time_t last_time;
+long last_time;
int ttgetc(void)
{
int stat_;
- time_t new_time;
+ long new_time;
+
tickon();
- loop:
+ loop:
new_time = time(NULL);
if (new_time != last_time) {
last_time = new_time;
/* Shell dies signal handler. Puts pty in non-block mode so
* that read returns with <1 when all data from process has
* been read. */
-static volatile sig_atomic_t dead = 0;
+int dead = 0;
int death_fd;
static RETSIGTYPE death(int unused)
{
-/* $MirOS: contrib/code/jupp/tw.c,v 1.12 2017/03/19 18:53:02 tg Exp $ */
+/* $MirOS: contrib/code/jupp/tw.c,v 1.10 2017/01/10 19:16:28 tg Exp $ */
/*
* Text editing windows
* Copyright
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#ifdef HAVE_TIME_H
#include <time.h>
#endif
static unsigned char *stagen(unsigned char *stalin, BW *bw, unsigned char *s, int fill)
{
- unsigned char *cp, *cp2, uc;
unsigned char buf[80];
int x;
W *w = bw->parent;
- time_t tt;
int special_aA = 0;
- cp = s;
- while ((cp2 = strstr(cp, "%a")) != NULL) {
- cp2 += /* %a */ 2;
- if (cp2[1] == '%')
- ++cp2;
- if (cp2[0] == '%' && cp2[1] == 'A') {
- special_aA = 1;
- break;
+ {
+ unsigned char *cp = s, *cp2;
+
+ while ((cp2 = strstr(cp, "%a")) != NULL) {
+ cp2 += /* %a */ 2;
+ if (cp2[1] == '%')
+ ++cp2;
+ if (cp2[0] == '%' && cp2[1] == 'A') {
+ special_aA = 1;
+ break;
+ }
}
- }
- if (!special_aA) while ((cp2 = strstr(cp, "%A")) != NULL) {
- cp2 += /* %A */ 2;
- if (cp2[1] == '%')
- ++cp2;
- if (cp2[0] == '%' && cp2[1] == 'a') {
- special_aA = 1;
- break;
+ if (!special_aA) while ((cp2 = strstr(cp, "%A")) != NULL) {
+ cp2 += /* %A */ 2;
+ if (cp2[1] == '%')
+ ++cp2;
+ if (cp2[0] == '%' && cp2[1] == 'a') {
+ special_aA = 1;
+ break;
+ }
}
}
while (*s) {
if (*s == '%' && s[1]) {
switch (*++s) {
- case 'x':
- /* Context (but only if autoindent is enabled) */
- if (bw->o.autoindent) {
- cp = get_context(bw);
- stalin = vsncpy(sv(stalin), sz(cp));
+ case 'x': /* Context (but only if autoindent is enabled) */
+ {
+ if ( bw->o.autoindent) {
+ unsigned char *s_ = get_context(bw);
+ stalin = vsncpy(sv(stalin), sz(s_));
+ }
}
break;
case 'y':
- if (bw->o.syntax) {
- joe_snprintf_1((char *)buf, sizeof(buf), "(%s)", bw->o.syntax->name);
- stalin = vsncpy(sv(stalin), sz(buf));
+ {
+ if (bw->o.syntax) {
+ joe_snprintf_1((char *)buf, sizeof(buf), "(%s)", bw->o.syntax->name);
+ stalin = vsncpy(sv(stalin), sz(buf));
+ }
}
break;
case 't':
- tt = time(NULL);
- cp = (unsigned char *)ctime(&tt);
-
- x = (cp[11] - '0') * 10 + cp[12] - '0';
- if (x > 12)
- x -= 12;
- joe_snprintf_1((char *)buf, sizeof(buf), "%2.2d", x);
- if (buf[0] == '0')
- buf[0] = fill;
- stalin = vsncpy(sv(stalin), buf, 2);
- stalin = vsncpy(sv(stalin), cp + 13, 3);
+ {
+ time_t n = time(NULL);
+ int l;
+ unsigned char *d = (unsigned char *)ctime(&n);
+
+ l = (d[11] - '0') * 10 + d[12] - '0';
+ if (l > 12)
+ l -= 12;
+ joe_snprintf_1((char *)buf, sizeof(buf), "%2.2d", l);
+ if (buf[0] == '0')
+ buf[0] = fill;
+ stalin = vsncpy(sv(stalin), buf, 2);
+ stalin = vsncpy(sv(stalin), d + 13, 3);
+ }
break;
case 'u':
- tt = time(NULL);
- cp = (unsigned char *)ctime(&tt);
- stalin = vsncpy(sv(stalin), cp + 11, 5);
+ {
+ time_t n = time(NULL);
+ unsigned char *d = (unsigned char *)ctime(&n);
+
+ stalin = vsncpy(sv(stalin), d + 11, 5);
+ }
break;
case 'T':
if (bw->o.overtype)
else
stalin = vsadd(stalin, fill);
break;
- case 'n':
- if (!bw->b->name) {
- stalin = vsncpy(sv(stalin), sc("Unnamed"));
- break;
- }
- cp = bw->b->name;
+ case 'n': {
+ unsigned char fnc;
+ const unsigned char *fn = bw->b->name ? bw->b->name :
+ (const unsigned char *)"Unnamed";
+
escape_loop:
- switch ((uc = *cp++)) {
+ switch ((fnc = *fn++)) {
case '\\':
- stalin = vsadd(stalin, uc);
+ stalin = vsadd(stalin, fnc);
/* FALLTHROUGH */
default:
- stalin = vsadd(stalin, uc);
+ stalin = vsadd(stalin, fnc);
goto escape_loop;
case '\0':
break;
}
break;
+ }
case 'm':
if (bw->b->changed)
stalin = vsncpy(sv(stalin), sc("(Modified)"));
stalin = vsncpy(sv(stalin), sz(buf));
break;
case 'k':
- cp = buf;
- buf[0] = 0;
- if (w->kbd->x && w->kbd->seq[0])
- for (x = 0; x != w->kbd->x; ++x) {
- uc = w->kbd->seq[x] & 127;
-
- if (uc < 32) {
- cp[0] = '^';
- cp[1] = uc + '@';
- cp += 2;
- } else if (uc == 127) {
- cp[0] = '^';
- cp[1] = '?';
- cp += 2;
- } else {
- cp[0] = uc;
- cp += 1;
+ {
+ int i;
+ unsigned char *cpos_ = buf;
+
+ buf[0] = 0;
+ if (w->kbd->x && w->kbd->seq[0])
+ for (i = 0; i != w->kbd->x; ++i) {
+ int c = w->kbd->seq[i] & 127;
+
+ if (c < 32) {
+ cpos_[0] = '^';
+ cpos_[1] = c + '@';
+ cpos_ += 2;
+ } else if (c == 127) {
+ cpos_[0] = '^';
+ cpos_[1] = '?';
+ cpos_ += 2;
+ } else {
+ cpos_[0] = c;
+ cpos_ += 1;
+ }
}
- }
- *cp++ = fill;
- while (cp - buf < 4)
- *cp++ = fill;
- stalin = vsncpy(sv(stalin), buf, cp - buf);
+ *cpos_++ = fill;
+ while (cpos_ - buf < 4)
+ *cpos_++ = fill;
+ stalin = vsncpy(sv(stalin), buf, cpos_ - buf);
+ }
break;
case 'S':
if (bw->b->pid)
-/* $MirOS: contrib/code/jupp/uedit.c,v 1.17 2017/03/19 19:19:51 tg Exp $ */
+/* $MirOS: contrib/code/jupp/uedit.c,v 1.15 2017/01/11 22:56:49 tg Exp $ */
/*
* Basic user edit functions
* Copyright
#include "types.h"
#include <stdio.h>
-#include <string.h>
#ifdef HAVE_BSD_STRING_H
#include <bsd/string.h>
if (notify)
*notify = 1;
vsrm(s);
- if (num >= 1 && !merrf) {
+ if (num >= 1 && !merr) {
int tmp = mid;
if (num > bw->b->eof->line)
mid = tmp;
return 0;
} else {
- if (merrf)
- msgnw(bw->parent, merrt);
+ if (merr)
+ msgnw(bw->parent, merr);
else
msgnw(bw->parent, US "Invalid line number");
return -1;
if (notify)
*notify = 1;
vsrm(s);
- if (num >= 1 && !merrf) {
+ if (num >= 1 && !merr) {
int tmp = mid;
pcol(bw->cursor, num - 1), bw->cursor->xcol = piscol(bw->cursor);
mid = tmp;
return 0;
} else {
- if (merrf)
- msgnw(bw->parent, merrt);
+ if (merr)
+ msgnw(bw->parent, merr);
else
msgnw(bw->parent, US "Invalid column number");
return -1;
if (notify)
*notify = 1;
vsrm(s);
- if (num >= 0 && !merrf) {
+ if (num >= 0 && !merr) {
int tmp = mid;
pgoto(bw->cursor, num), bw->cursor->xcol = piscol(bw->cursor);
mid = tmp;
return 0;
} else {
- if (merrf)
- msgnw(bw->parent, merrt);
+ if (merr)
+ msgnw(bw->parent, merr);
else
msgnw(bw->parent, US "Invalid byte number");
return -1;
-/* $MirOS: contrib/code/jupp/umath.c,v 1.7 2017/03/19 19:19:51 tg Exp $ */
+/* $MirOS: contrib/code/jupp/umath.c,v 1.6 2012/12/30 17:12:37 tg Exp $ */
/*
* Math
* Copyright
#include "charmap.h"
#include "w.h"
-volatile sig_atomic_t merrf;
-const unsigned char *merrt;
+const unsigned char * volatile merr;
static char math_res[JOE_MSGBUFSIZE];
static char *math_exp;
static RETSIGTYPE fperr(int unused)
{
- if (!merrf)
- merrf = 2;
+ if (!merr) {
+ merr = US "Float point exception";
+ }
REINSTALL_SIGHANDLER(SIGFPE, fperr);
}
x = expr(0, &v);
if (*ptr == ')')
++ptr;
- else if (!merrf) {
- merrf = 1;
- merrt = US "Missing )";
+ else {
+ if (!merr)
+ merr = US "Missing )";
}
} else if (*ptr == '-') {
++ptr;
if (v) {
v->val = x;
v->set = 1;
- } else if (!merrf) {
- merrf = 1;
- merrt = US "Left side of = is not an l-value";
+ } else {
+ if (!merr)
+ merr = US "Left side of = is not an l-value";
}
goto loop;
}
v->val = tbw->w;
v->set = 1;
ptr = s;
- merrf = 0;
+ merr = 0;
up:
result = expr(0, &dumb);
- if (!merrf) {
+ if (!merr) {
while (*ptr == ' ' || *ptr == '\t') {
++ptr;
}
if (*ptr) {
goto up;
}
- } else if (*ptr && !merrf) {
- merrf = 1;
- merrt = US "Extra junk after end of expr";
+ } else if (*ptr) {
+ merr = US "Extra junk after end of expr";
}
}
- if (merrf) {
- if (merrf == 2)
- merrt = US "Float point exception";
+ if (merr) {
joe_snprintf_1(math_res, JOE_MSGBUFSIZE,
- "math_error{%s}", merrt);
+ "math_error{%s}", merr);
} else {
joe_imaxt ires = (joe_imaxt)result;
if (notify) {
*notify = 1;
}
- if (merrf) {
- msgnw(bw->parent, merrt);
+ if (merr) {
+ msgnw(bw->parent, merr);
return -1;
}
vsrm(s);
-/* $MirOS: contrib/code/jupp/umath.h,v 1.5 2017/03/19 19:19:51 tg Exp $ */
+/* $MirOS: contrib/code/jupp/umath.h,v 1.4 2012/12/30 17:12:37 tg Exp $ */
/*
* Math
* Copyright
#include "config.h"
#include "types.h"
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-
-extern volatile sig_atomic_t merrf;
-extern const unsigned char *merrt;
-
+extern const unsigned char * volatile merr;
double calc(BW *bw, unsigned char *s);
int umath(BW *bw);
int umathins(BW *bw);