to tar.gz package
(to make it proper .rpm package there's more to be done - this is
work of .rpm packager - he can insert a lot of useful but for joe
- unnecesary files - think of icons on the desktop etc.)
+ unnecessary files - think of icons on the desktop etc.)
Sun Oct 28 2001 Vitezslav Samel <samel@mail.cz>
* autoconf.ac: add AC_CANONICAL_(BUILD|HOST) to make
able to find patch :(
______________________________________________________________________
-$MirOS: contrib/code/jupp/ChangeLog,v 1.8 2014/10/23 16:27:25 tg Exp $
+$MirOS: contrib/code/jupp/ChangeLog,v 1.9 2016/11/06 20:14:44 tg Exp $
#!/bin/mksh
-# $MirOS: contrib/code/jupp/Make-w32.sh,v 1.7 2016/10/30 02:44:19 tg Exp $
+# $MirOS: contrib/code/jupp/Make-w32.sh,v 1.12 2017/01/10 20:23:23 tg Exp $
+
+nopkg=0
+debug=0
+contb=0
+while getopts "bgn" c; do
+ case $c {
+ (b) nopkg=1 ;;
+ (g) debug=1 ;;
+ (n) contb=1 ;;
+ (*) exit 1 ;;
+ }
+done
extrawarnings="-Wall -Wextra"
+(( debug )) && extrawarnings="$extrawarnings -g3"
extrawarnings="$extrawarnings -Wno-unused-parameter"
echo "N: gcc-3.4.4-999 does not support -Wno-missing-field-initializers"
echo "N: expect warnings about those, they are known, do not report them"
jtop=jwin31$jwin
typeset -u jWIN=$jwin
-rm -rf mkw32
-mkdir mkw32{,/{build,$jtop}}
+if (( contb )); then
+ [[ -s mkw32/build/Makefile ]]
+else
+ rm -rf mkw32
+ mkdir mkw32{,/{build,$jtop}}
+fi
cd mkw32/build
export CFLAGS='-Os -march=i486 -mtune=pentium-mmx'
export CPPFLAGS='-DJUPPRC_BUILTIN_NAME=\"jupp32rc\"'
-mksh ../../configure \
+(( contb )) || mksh ../../configure \
--prefix=c:/windows/system32 \
--sysconfdir=c:/windows/system32 \
--disable-dependency-tracking \
--disable-termidx \
--enable-win32reloc
make AM_CFLAGS="$extrawarnings"
+if (( nopkg )); then
+ ln -f joe.exe jupp.exe
+ ln -sf ../../jupprc .
+ exit 0
+fi
cp charmaps/* syntax/* ../$jtop/
cp jmacsrc joerc jpicorc jstarrc ../$jtop/
cp joe.exe ../$jtop/jupp32.exe
-/* $MirOS: contrib/code/jupp/builtin.c,v 1.4 2014/10/23 17:10:44 tg Exp $ */
+/* $MirOS: contrib/code/jupp/builtin.c,v 1.5 2017/01/10 19:16:27 tg Exp $ */
/*
* Built-in config files
* Copyright
#include "config.h"
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include "types.h"
#if 0
.if "0" == "1"
#endif
-/* $MirOS: contrib/code/jupp/charmap.c,v 1.16 2016/10/29 23:44:44 tg Exp $ */
+/* $MirOS: contrib/code/jupp/charmap.c,v 1.18 2017/01/10 22:38:33 tg Exp $ */
/*
* UNICODE/ISO-10646 conversion utilities
* Copyright
{ US "cyrillic", US "iso-8859-5" },
{ US "arabic", US "iso-8859-6" },
{ US "greek", US "iso-8859-7" },
- { US "hebrew", US "iso-8859-8" }, /* cp1255 on windows machines? */
+ { US "hebrew", US "iso-8859-8" },
{ US "latin5", US "iso-8859-9" },
{ US "turkish", US "iso-8859-9" },
{ US "latin6", US "iso-8859-10" },
{ US "latin7", US "iso-8859-13" },
{ US "latin8", US "iso-8859-14" },
{ US "latin9", US "iso-8859-15" },
+ { US "cp20127", US "ascii" },
+ { US "cp20866", US "koi8-r" },
+ { US "cp21866", US "koi8-u" },
+ { US "cp28591", US "iso-8859-1" },
+ { US "cp28592", US "iso-8859-2" },
+ { US "cp28593", US "iso-8859-3" },
+ { US "cp28594", US "iso-8859-4" },
+ { US "cp28595", US "iso-8859-5" },
+ { US "cp28596", US "iso-8859-6" },
+ { US "cp28597", US "iso-8859-7" },
+ { US "cp28598", US "iso-8859-8" },
+ { US "cp28599", US "iso-8859-9" },
+ { US "cp28603", US "iso-8859-13" },
+ { US "cp28605", US "iso-8859-15" },
+ { US "cp65001", US "utf-8" },
{ 0, 0 }
};
SRCS+= i18n.c path.c utf8.c utils.c va.c vs.c
NOMAN= Yes
CPPFLAGS+= -DTEST -DTEST_CHARMAP
-CPPFLAGS+= -DJUPP_WIN32RELOC=0 -DJOERC=\"/etc/joe\"
+CPPFLAGS+= -DJUPP_WIN32RELOC=0 -D'JOERC="/etc/joe"'
.include <bsd.own.mk>
-/* $MirOS: contrib/code/jupp/charmap.h,v 1.5 2014/06/26 17:51:14 tg Exp $ */
+/* $MirOS: contrib/code/jupp/charmap.h,v 1.6 2017/01/10 23:10:47 tg Exp $ */
/*
* Character sets
* Copyright
struct pair from_map[256 + 2]; /* Convert from unicode to byte */
- int from_size; /* No. paris in from_map */
+ int from_size; /* No. pairs in from_map */
unsigned char print_map[32]; /* Bit map of printable characters */
unsigned char alpha__map[32]; /* Bit map of alphabetic characters and _ */
-/* $MirOS: contrib/code/jupp/hash.c,v 1.2 2008/05/13 13:08:22 tg Exp $ */
+/* $MirOS: contrib/code/jupp/hash.c,v 1.3 2017/01/10 19:16:27 tg Exp $ */
/*
* Simple hash table
* Copyright
#include "config.h"
#include "types.h"
+#include <stdlib.h>
#include <string.h>
#include "hash.h"
-/* $MirOS: contrib/code/jupp/help.c,v 1.7 2012/12/30 19:27:13 tg Exp $ */
+/* $MirOS: contrib/code/jupp/help.c,v 1.10 2017/01/10 23:59:32 tg Exp $ */
/*
* Help system
* Copyright
#include "types.h"
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#ifdef HAVE_BSD_STRING_H
#include "utf8.h"
#include "w.h"
+extern void outatr_help(SCRN *,int *,int *,int,int,int,int);
+
#define NOT_ENOUGH_MEMORY -11
struct help *help_actual = NULL; /* actual help screen */
void help_display(SCREEN *t)
{
unsigned char *str;
- int y, x, c, z;
+ int y, x, z;
int atr = 0;
if (help_actual) {
case 0:
--x;
continue;
- default:
- c = *str++;
}
- } else {
- c = *str++;
}
- outatr(locale_map, t->t, t->t->scrn + x + y * t->w,
- t->t->attr + x + y * t->w, x, y, c, atr);
+ outatr_help(t->t,
+ t->t->scrn + x + y * t->w,
+ t->t->attr + x + y * t->w,
+ x, y, *str++, atr);
}
}
atr = 0;
#if 0
.if "0" == "1"
#endif
-/* $MirOS: contrib/code/jupp/i18n.c,v 1.15 2016/09/01 12:54:41 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
{ 0x1FDD, 0x1FEF },
{ 0x1FF2, 0x1FF4 },
{ 0x1FF6, 0x1FFE },
+#ifdef __CYGWIN__
+ /* WTF?! https://blogs.msdn.microsoft.com/oldnewthing/20070104-12/?p=28513 */
+ { 0x2000, 0x2021 },
+ { 0x2023, 0x2064 },
+#else
{ 0x2000, 0x2064 },
+#endif
{ 0x2066, 0x2071 },
{ 0x2074, 0x208E },
{ 0x2090, 0x209C },
- $MirOS: contrib/code/jupp/jmacsrc.in,v 1.22 2016/10/08 17:44:18 tg Exp $
+ $MirOS: contrib/code/jupp/jmacsrc.in,v 1.23 2017/01/11 00:41:17 tg Exp $
Initialization file for JOE
GNU-Emacs Joe
\i Help Screen turn off with ^J prev. screen ^[, \uCharacter Map\u \i
\i \i Dec Hex \u 0123 4567 89AB CDEF 0123 4567 89AB CDEF \u Hex Dec \i \i
\i \i | | \i \i
-\i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \i\u@ABC\u\i \i\uDEFG\u\i \i\uHIJK\u\i \i\uLMNO\u\i | 80 128 \i \i
-\i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \i\uPQRS\u\i \i\uTUVW\u\i \i\uXYZ[\u\i \i\u\\]^_\u\i | 90 144 \i \i
+\i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \80\81\82\83 \84\85\86\87 \88\89\8a\8b \8c\8d\8e\8f | 80 128 \i \i
+\i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \90\91\92\93 \94\95\96\97 \98\99\9a\9b \9c\9d\9e\9f | 90 144 \i \i
\i \i 32 20 | !"# $%&' ()*+ ,-./ ¡¢£ ¤¥¦§ ¨©ª« ¬®¯ | A0 160 \i \i
\i \i 48 30 | 0123 4567 89:; <=>? °±²³ ´µ¶· ¸¹º» ¼½¾¿ | B0 176 \i \i
\i \i 64 40 | @ABC DEFG HIJK LMNO ÀÁÂÃ ÄÅÆÇ ÈÉÊË ÌÍÎÏ | C0 192 \i \i
-.\" $MirOS: contrib/code/jupp/joe.1.in,v 1.18 2016/10/08 19:28:44 tg Exp $
+.\" $MirOS: contrib/code/jupp/joe.1.in,v 1.23 2017/01/11 19:26:53 tg Exp $
.\"-
.TH JOE 1
.SH Name
Although JOE is actually six different editors, it still requires only one
executable, but one with six different names. The name of the editor with
-an "rc" appended gives the name of JOE's initialization file, which
+an "rc" appended gives the name of JOE's initialisation file, which
determines the personality of the editor.
JUPP is free software; you can distribute it and/or modify it under the
terms of the GNU General Public License, Version 1, as published by the
-Free Software Foundation. (main.c contains more detailled exceptions.)
+Free Software Foundation. (main.c contains more detailed exceptions.)
I have no plans for turning JOE into a commercial or share-ware product.
See the source code for exact authorship and licencing information.
JOE is available over the Internet from \fBhttp://joe-editor.sf.net/\fR.
sections of files or devices. See the section \fBFilenames\fR below for
details.
+On cygwin32 systems, the special option \fB\-CYGhack\fR is replaced by
+anything that comes past it (and separating whitespace) on the command
+line as \fIone\fR option (to work around a Cygwin bug as it cannot
+correctly be passed a UNC pathname with spaces as one argument from
+Explorer \fIat all\fR).
+
Once you are in the editor, you can type in text and use special
control-character sequences to perform other editing tasks. To find out
what the control-character sequences are, read the rest of this man page or
is on. To page through other topics, hit ^[, and ^[. (that is, ESC , and
ESC .). Use \fB^K H\fR to dismiss the help window.
-You can customize the keyboard layout, the help screens and a number of
+You can customise the keyboard layout, the help screens and a number of
behavior defaults by copying JOE's initialisation file (@joeinitfile@)
to \fB.joerc\fR in your home directory and then by modifying it.
See the section \fBjoerc\fR below.
+The filename is actually \fB.\fIname\fBrc\fR where \fIname\fR is the
+\fBargv[0]\fR the editor is called with.
+
+Custom syntax files are loaded from \fB.joe/syntax/\fIname\fB.jsf\fR
+in your home directory and \fB.joe/charmaps/\fIname\fR holds custom
+charmaps (\fIname\fR here is the name of the syntax or charmap).
To have JOE used as your default editor for e-mail and News, you need to set
the \fBEDITOR\fR and \fBVISUAL\fR environment variables in your shell
-initialization file (\fB.cshrc\fR or \fB.profile\fR) to refer to JOE (the
+initialisation file (\fB.cshrc\fR or \fB.profile\fR) to refer to JOE (the
joe binary usually resides as \fB@joeresides@\fR).
There are a number of other obscure invocation parameters which may have to
directory instead of in each file's original directory.
.IP -baud\ nnn
-Set the baud rate for the purposes of terminal screen optimization. Joe
+Set the baud rate for the purposes of terminal screen optimisation. Joe
inserts delays for baud rates below 19200, which bypasses tty buffering so
that typeahead will interrupt the screen output. Scrolling commands will
not be used for 38400 baud. This is useful for X-terms and other console
Each of these options may be specified in the joerc file as well. In
addition, the NOXON, BAUD, LINES, COLUMNS and DOPADDING options may be
specified with environment variables.
-
-The JOETERM environment variable may be set to override the regular TERM
-environment variable for specifying your terminal type.
+See the section \fBEnvironment variables\fR below.
The following options may be specified before each filename on the command
line:
end in .c, .h or .p), JOE will automatically wrap the last word onto the
next line so that you don't have to hit \fBReturn\fR. This is called
word-wrap mode. Word-wrap can be turned on or off with the \fB^T W\fR
-command. JOE's initialization file is usually set up so that this mode is
+command. JOE's initialisation file is usually set up so that this mode is
automatically turned on for all non-program files. See the section below on
the \fBjoerc\fR file to change this and other defaults.
and you want to maintain the column position of the right side of the table.
When this occurs, you can put the editor in over-type mode with \fB^T T\fR.
When the editor is in this mode, the characters you type in replace existing
-characters, in the way an idealized typewriter would. Also, \fBBackspace\fR
+characters, in the way an idealised typewriter would. Also, \fBBackspace\fR
simply moves left instead of deleting the character to the left, when it's
not at the end or beginning of a line. Over-type mode is not the natural
way of dealing with text electronically, so you should go back to
The \fBxterm\-xfree86\fR terminal allows automatic entering and leaving
of the bracketed paste mode.
+The \fBJOETERM\fR environment variable may be set to override the regular
+\fBTERM\fR environment variable for specifying your terminal type.
+
+JOE uses two character maps for its operation: the terminal I/O character
+map, which determines how characters are sent to the terminal and whether
+the %a/%A message specifiers use Unicode, and the file encoding, which can
+be specified per file using the \fB\-encoding\fR option and changed with
+the \fB^T E\fR command, and which defaults to the terminal I/O character
+map, which, in turn, is determined from the current locale, if the system
+supports such, otherwise the \fBLC_ALL\fR, \fBLC_CTYPE\fR and \fBLANG\fR
+environment variables (if they contain a period, only the part after it
+and before an optional "at sign" is used); on cygwin32 before 1.7.2, the
+codepage is used instead if the POSIX locale environment variables are
+empty; the environment variable \fBJOECHARMAP\fR can be used to manually
+force one overriding all methods described above, and can be used together
+with \fB\-encoding\fR to specify a different default file character map.
+
JOE normally expects that flow control between the computer and your
terminal to use ^S/^Q handshaking (I.E., if the computer is sending
characters too fast for your terminal, your terminal sends ^S to stop the
hexadecimal (ex.: 0xFF). For example, use \fBjoe /dev/fd0,508,2\fR to edit
bytes 508 and 509 of the first floppy drive in Linux.
-.IP \fB-
+.IP \fB\-
Use this to get input from the standard input or to write output to the
standard output. For example, you can put joe in a pipe of commands:
\fBquota \-v | joe \- | mail root\fR, if you want to complain about your low
.SH The\ joerc file
\fB^T\fR options, the help screens and the key-sequence to editor command
-bindings are all defined in JOE's initialization file.
+bindings are all defined in JOE's initialisation file.
If you make a copy of this file (@joeinitcopy@) to \fB$HOME/.joerc\fR,
you can customise these settings to your liking.
-The syntax of the initialization file should be fairly obvious,
+The syntax of the initialisation file should be fairly obvious,
and there are further instruction in it.
.SH Acknowledgments
- $MirOS: contrib/code/jupp/joerc.in,v 1.23 2016/10/08 17:44:18 tg Exp $
+ $MirOS: contrib/code/jupp/joerc.in,v 1.24 2017/01/11 00:41:18 tg Exp $
Initialization file for JOE
Standard Joe
\i Help Screen turn off with ^J prev. screen ^[, \uCharacter Map\u \i
\i \i Dec Hex \u 0123 4567 89AB CDEF 0123 4567 89AB CDEF \u Hex Dec \i \i
\i \i | | \i \i
-\i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \i\u@ABC\u\i \i\uDEFG\u\i \i\uHIJK\u\i \i\uLMNO\u\i | 80 128 \i \i
-\i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \i\uPQRS\u\i \i\uTUVW\u\i \i\uXYZ[\u\i \i\u\\]^_\u\i | 90 144 \i \i
+\i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \80\81\82\83 \84\85\86\87 \88\89\8a\8b \8c\8d\8e\8f | 80 128 \i \i
+\i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \90\91\92\93 \94\95\96\97 \98\99\9a\9b \9c\9d\9e\9f | 90 144 \i \i
\i \i 32 20 | !"# $%&' ()*+ ,-./ ¡¢£ ¤¥¦§ ¨©ª« ¬®¯ | A0 160 \i \i
\i \i 48 30 | 0123 4567 89:; <=>? °±²³ ´µ¶· ¸¹º» ¼½¾¿ | B0 176 \i \i
\i \i 64 40 | @ABC DEFG HIJK LMNO ÀÁÂÃ ÄÅÆÇ ÈÉÊË ÌÍÎÏ | C0 192 \i \i
- $MirOS: contrib/code/jupp/jpicorc.in,v 1.22 2016/10/08 17:44:19 tg Exp $
+ $MirOS: contrib/code/jupp/jpicorc.in,v 1.23 2017/01/11 00:41:18 tg Exp $
Initialization file for JOE
Super Pico
\i Help Screen turn off with ^J prev. screen ^[, \uCharacter Map\u \i
\i \i Dec Hex \u 0123 4567 89AB CDEF 0123 4567 89AB CDEF \u Hex Dec \i \i
\i \i | | \i \i
-\i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \i\u@ABC\u\i \i\uDEFG\u\i \i\uHIJK\u\i \i\uLMNO\u\i | 80 128 \i \i
-\i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \i\uPQRS\u\i \i\uTUVW\u\i \i\uXYZ[\u\i \i\u\\]^_\u\i | 90 144 \i \i
+\i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \80\81\82\83 \84\85\86\87 \88\89\8a\8b \8c\8d\8e\8f | 80 128 \i \i
+\i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \90\91\92\93 \94\95\96\97 \98\99\9a\9b \9c\9d\9e\9f | 90 144 \i \i
\i \i 32 20 | !"# $%&' ()*+ ,-./ ¡¢£ ¤¥¦§ ¨©ª« ¬®¯ | A0 160 \i \i
\i \i 48 30 | 0123 4567 89:; <=>? °±²³ ´µ¶· ¸¹º» ¼½¾¿ | B0 176 \i \i
\i \i 64 40 | @ABC DEFG HIJK LMNO ÀÁÂÃ ÄÅÆÇ ÈÉÊË ÌÍÎÏ | C0 192 \i \i
- $MirOS: contrib/code/jupp/jstarrc.in,v 1.24 2016/10/08 17:44:19 tg Exp $
+ $MirOS: contrib/code/jupp/jstarrc.in,v 1.25 2017/01/11 00:41:18 tg Exp $
Initialization file for JOE
WordStar / Turbo-C Joe
\i Help Screen turn off with ^J prev. screen ^[, \uCharacter Map\u \i
\i \i Dec Hex \u 0123 4567 89AB CDEF 0123 4567 89AB CDEF \u Hex Dec \i \i
\i \i | | \i \i
-\i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \i\u@ABC\u\i \i\uDEFG\u\i \i\uHIJK\u\i \i\uLMNO\u\i | 80 128 \i \i
-\i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \i\uPQRS\u\i \i\uTUVW\u\i \i\uXYZ[\u\i \i\u\\]^_\u\i | 90 144 \i \i
+\i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \80\81\82\83 \84\85\86\87 \88\89\8a\8b \8c\8d\8e\8f | 80 128 \i \i
+\i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \90\91\92\93 \94\95\96\97 \98\99\9a\9b \9c\9d\9e\9f | 90 144 \i \i
\i \i 32 20 | !"# $%&' ()*+ ,-./ ¡¢£ ¤¥¦§ ¨©ª« ¬®¯ | A0 160 \i \i
\i \i 48 30 | 0123 4567 89:; <=>? °±²³ ´µ¶· ¸¹º» ¼½¾¿ | B0 176 \i \i
\i \i 64 40 | @ABC DEFG HIJK LMNO ÀÁÂÃ ÄÅÆÇ ÈÉÊË ÌÍÎÏ | C0 192 \i \i
- "jupp" resource file for Jupp3.1*nix (c) 1997-2016 Thorsten Glaser
+ "jupp" resource file for Jupp3.1*nix (c) 1997-2017 Thorsten Glaser
Provided that these terms and disclaimer and all copyright notices
are retained or reproduced in an accompanying document, permission
is granted to deal in this work without restriction, including un-
damage or existence of a defect, except proven that it results out
of said person's immediate fault when using the work as intended.
--asis
+ -asis
-assume_color
-baud 9600
-dopadding
\i \i go to \uhttp://sf.net/projects/joe-editor/\u for upstream bug reports. JUPP 2.8 \i \i
\i \i for DOS compiled by A. Totlis, packed with LHarc 2.13; JUPP 3.x for UNIX\d(R)\d \i \i
\i \i at \uhttp://mirbsd.de/jupp\u and by \bThorsten "\dmirabilos\d" Glaser <\utg@mirbsd.org\u>\b \i \i
-\i \i @(#) jupprc 2016-10-08; 3.1; autoCR-LF; UTF-8 via locale; per-file encoding \i \i
+\i \i @(#) jupprc 2017-01-11; 3.1; autoCR-LF; UTF-8 via locale; per-file encoding \i \i
}
#HOOK#3103 additional help screens
\i Help Screen turn off with ^J prev. screen ^[, \uCharacter Map\u \i
\i \i Dec Hex \u 0123 4567 89AB CDEF 0123 4567 89AB CDEF \u Hex Dec \i \i
\i \i | | \i \i
-\i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \i\u@ABC\u\i \i\uDEFG\u\i \i\uHIJK\u\i \i\uLMNO\u\i | 80 128 \i \i
-\i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \i\uPQRS\u\i \i\uTUVW\u\i \i\uXYZ[\u\i \i\u\\]^_\u\i | 90 144 \i \i
+\i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \80\81\82\83 \84\85\86\87 \88\89\8a\8b \8c\8d\8e\8f | 80 128 \i \i
+\i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \90\91\92\93 \94\95\96\97 \98\99\9a\9b \9c\9d\9e\9f | 90 144 \i \i
\i \i 32 20 | !"# $%&' ()*+ ,-./ ¡¢£ ¤¥¦§ ¨©ª« ¬®¯ | A0 160 \i \i
\i \i 48 30 | 0123 4567 89:; <=>? °±²³ ´µ¶· ¸¹º» ¼½¾¿ | B0 176 \i \i
\i \i 64 40 | @ABC DEFG HIJK LMNO ÀÁÂÃ ÄÅÆÇ ÈÉÊË ÌÍÎÏ | C0 192 \i \i
:main
:inherit windows
+:def freedroidz splitw,prevw,scratch,"nbc-Output",rtn,nextw,save,markk,bol,markb,prevw,prevw,blkcpy,nextw,nextw,rtn,prevw,eol,"'",bol,qrepl,"'",rtn,rtn,"'\\\\''",rtn,"r",backs,backs,backs,bol,"LC_ALL=C; export LC_ALL; fn='",eol,rtn,"p=--posix; sed $p -e q </dev/null >/dev/null 2>&1 || p=; fns=$(echo \"$fn\" | sed $p -e 's\ 1[^^]\ 1[&]\ 1g; s\ 1\\^\ 1\\\\^\ 1g'); (case $fn in",rtn,"*.nxc) ;;",rtn,"*) echo '==> Error: filename not *.nxc'; exit ;;",rtn,"esac",rtn,"echo \"Compiling $fn\"",rtn,"nbc -sm- -d \"$fn\" 2>&1; x=$?",rtn,"if test $x = 0; then echo '==> OK'; else echo '==> Error code:' $x; fi",rtn,") | tr '\\n' '\ 1' | sed $p -e 's!\ 1# *\\([^\ 1]*\\)\ 1File \"[^\"]*/\\('\"$fns\"'\\)\" ; line \\([0-9]*\\)\ 1!\ 1\\2:\\3: \\1\ 1!g' -e 's!\ 1#\\([^\ 1]*\\)\ 1File \"\\([^\"]*\\)\" ; line \\([0-9]*\\)\ 1!\ 1\\2:\\3: \\1\ 1!g' | tr '\ 1' '\\n'",rtn,nmark,filt,"sh",rtn,rtn,"Press ^KQ to close this window!",rtn,parserr
+:def docompile edit,rtn,filt,query,parserr
#HOOK#3105 main keybindings
bof,qrepl,"\\[",quote,"i",quote,"k",quote,"l",quote,"m ]\\+\\[",quote,"i",quote,"k",quote,"l",quote,"m ]\\$",rtn,rtn,rtn,"r",eof ^K ]
ffirst,"\\^\\[<>=]\\[<>=]\\[<>=]\\[<>=]\\[<>=]\\[<>=]\\[<>=]\\[ \\n]",rtn,rtn,ltarw ^Q =
-splitw,prevw,scratch,"nbc-Output",rtn,nextw,save,markk,bol,markb,prevw,prevw,blkcpy,nextw,nextw,rtn,prevw,eol,"'",bol,qrepl,"'",rtn,rtn,"'\\\\''",rtn,"r",backs,backs,backs,bol,"fn='",eol,rtn,"case $fn in",rtn,"*.nxc) ;;",rtn,"*) echo '==> Error: filename not *.nxc'; exit ;;",rtn,"esac",rtn,"nbc -d \"$fn\"; x=$?",rtn,"if test $x = 0; then echo '==> OK'; else echo '==> Error code:' $x; fi",rtn,nmark,filt,"sh",rtn,rtn,"Press ^KQ to close this window!",rtn ^K F
-splitw,prevw,scratch,"nbc-Output",rtn,nextw,save,markk,bol,markb,prevw,prevw,blkcpy,nextw,nextw,rtn,prevw,eol,"'",bol,qrepl,"'",rtn,rtn,"'\\\\''",rtn,"r",backs,backs,backs,bol,"fn='",eol,rtn,"case $fn in",rtn,"*.nxc) ;;",rtn,"*) echo '==> Error: filename not *.nxc'; exit ;;",rtn,"esac",rtn,"nbc -d \"$fn\"; x=$?",rtn,"if test $x = 0; then echo '==> OK'; else echo '==> Error code:' $x; fi",rtn,nmark,filt,"sh",rtn,rtn,"Press ^KQ to close this window!",rtn ^K f
-splitw,prevw,scratch,"nbc-Output",rtn,nextw,save,markk,bol,markb,prevw,prevw,blkcpy,nextw,nextw,rtn,prevw,eol,"'",bol,qrepl,"'",rtn,rtn,"'\\\\''",rtn,"r",backs,backs,backs,bol,"fn='",eol,rtn,"case $fn in",rtn,"*.nxc) ;;",rtn,"*) echo '==> Error: filename not *.nxc'; exit ;;",rtn,"esac",rtn,"nbc -d \"$fn\"; x=$?",rtn,"if test $x = 0; then echo '==> OK'; else echo '==> Error code:' $x; fi",rtn,nmark,filt,"sh",rtn,rtn,"Press ^KQ to close this window!",rtn ^K ^F
-edit,rtn,filt,query,parserr ^[ C
-edit,rtn,filt,query,parserr ^[ c
-helpcard,"Paste",rtn,keymap,"Paste",rtn ^[ P
-helpcard,"Paste",rtn,keymap,"Paste",rtn ^[ p
-helpcard,"Paste",rtn,keymap,"Paste",rtn ^[ [ 2 0 0 ~
-nop ^[ [ 2 0 1 ~
begin_marking,uparw,toggle_marking ^[ [ 1 ; 2 A
begin_marking,dnarw,toggle_marking ^[ [ 1 ; 2 B
begin_marking,rtarw,toggle_marking ^[ [ 1 ; 2 C
begin_marking,eol,toggle_marking ^[ [ 1 ; 2 F
begin_marking,bof,toggle_marking ^[ [ 1 ; 6 H
begin_marking,eof,toggle_marking ^[ [ 1 ; 6 F
+:def pastemain helpcard,"Paste",rtn,keymap,"Paste",rtn
+pastemain ^[ P
+pastemain ^[ p
+pastemain ^[ [ 2 0 0 ~
+nop ^[ [ 2 0 1 ~
backs ^?
backs ^H
backw ^[ o
nxterr ^[ M
nxterr ^[ m
open ^[ b
+docompile ^[ C
+docompile ^[ c
parserr ^[ E
parserr ^[ e
+freedroidz ^K F
+freedroidz ^K ^F
+freedroidz ^K f
pgdn .kN
pgdn ^C
pgdn ^[ [ 6 ~
:prompt
:inherit main
+:def pasteprompt keymap,"Pasteprompt",rtn,msg,"Entered bracketed paste mode",rtn
abort ^C
complete ^I
nop ^L
-keymap,"Pasteprompt",rtn,msg,"Entered bracketed paste mode",rtn ^[ P
-keymap,"Pasteprompt",rtn,msg,"Entered bracketed paste mode",rtn ^[ p
-keymap,"Pasteprompt",rtn,msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~
+pasteprompt ^[ P
+pasteprompt ^[ p
+pasteprompt ^[ [ 2 0 0 ~
:menu
:inherit windows
:cua
:inherit main
#HOOK#3106 extra keybindings in CUA mode
+:def pastecua helpcard,"Paste",rtn,keymap,"Pastecua",rtn
undo ^Z
blkdel,nmark ^X
copy ^C
yank ^V
-helpcard,"Paste",rtn,keymap,"Pastecua",rtn ^[ P
-helpcard,"Paste",rtn,keymap,"Pastecua",rtn ^[ p
-helpcard,"Paste",rtn,keymap,"Pastecua",rtn ^[ [ 2 0 0 ~
+pastecua ^[ P
+pastecua ^[ p
+pastecua ^[ [ 2 0 0 ~
-/* $MirOS: contrib/code/jupp/kbd.c,v 1.3 2013/10/23 18:46:59 tg Exp $ */
+/* $MirOS: contrib/code/jupp/kbd.c,v 1.4 2017/01/10 19:16:27 tg Exp $ */
/*
* Key-map handler
* Copyright
#include "config.h"
#include "types.h"
+#include <stdlib.h>
#include <string.h>
#include "macro.h"
-/* $MirOS: contrib/code/jupp/main.c,v 1.26 2016/10/29 23:44:45 tg Exp $ */
+/* $MirOS: contrib/code/jupp/main.c,v 1.27 2017/01/11 19:26:54 tg Exp $ */
-#define JUPP_IS_COPYRIGHT_C_BY "2016 mirabilos"
+#define JUPP_IS_COPYRIGHT_C_BY "2017 mirabilos"
/*-
* Copyright (c) 2004ff. Thorsten Glaser
const char null[] = "";
+#ifdef __CYGWIN__
+static unsigned char *cygwin32_cmdline(void);
+#endif
+
/* Make windows follow cursor */
void dofollows(void)
help_init(s);
for (c = 1; argv[c]; ++c) {
if (argv[c][0] == '-') {
+#ifdef __CYGWIN__
+ if (!strcmp(argv[c], "-CYGhack")) {
+ s = cygwin32_cmdline();
+ s = strstr(s, "-CYGhack");
+ if (s) {
+ s += /* strlen("-CYGhack") */ 8;
+ while (*s == ' ' || *s == '\t')
+ ++s;
+ argv[c] = s;
+ argv[c + 1] = NULL;
+ break;
+ }
+ }
+#endif
if (argv[c][1])
switch (glopt(argv[c] + 1, argv[c + 1], NULL, 1)) {
case 0:
fprintf(stderr, "\n%s\n", exmsg);
return 0;
}
+
+#ifdef __CYGWIN__
+#include <windows.h>
+
+/* return command line as passed to the .EXE (just like cygwin32’s dcrt0.cc) */
+static unsigned char *
+cygwin32_cmdline(void)
+{
+ char *cp;
+
+ cp = strdup(GetCommandLineA());
+ if (!AreFileApisANSI())
+ CharToOemA(cp, cp);
+ return ((unsigned char *)cp);
+}
+#endif
-/* $MirOS: contrib/code/jupp/menu.c,v 1.6 2013/08/19 18:25:44 tg Exp $ */
+/* $MirOS: contrib/code/jupp/menu.c,v 1.7 2017/01/10 19:16:27 tg Exp $ */
/*
* Menu selection window
* Copyright
#include "config.h"
#include "types.h"
+#include <stdlib.h>
#include <string.h>
#include "scrn.h"
-/* $MirOS: contrib/code/jupp/pw.c,v 1.6 2016/10/08 14:58:46 tg Exp $ */
+/* $MirOS: contrib/code/jupp/pw.c,v 1.7 2017/01/10 19:16:27 tg Exp $ */
/*
* Prompt windows
* Copyright
#include "config.h"
#include "types.h"
+#include <stdlib.h>
#include <string.h>
#include "b.h"
-/* $MirOS: contrib/code/jupp/queue.c,v 1.2 2008/05/13 13:08:24 tg Exp $ */
+/* $MirOS: contrib/code/jupp/queue.c,v 1.3 2017/01/10 19:16:27 tg Exp $ */
/*
* Doubly linked list primitives
* Copyright
#include "config.h"
#include "types.h"
+#include <stdlib.h>
+
#include "queue.h"
#include "utils.h"
-/* $MirOS: contrib/code/jupp/qw.c,v 1.4 2009/10/18 14:52:56 tg Exp $ */
+/* $MirOS: contrib/code/jupp/qw.c,v 1.5 2017/01/10 19:16:27 tg Exp $ */
/*
* Query windows
* Copyright
#include "config.h"
#include "types.h"
+#include <stdlib.h>
+
#include "utils.h"
#include "vs.h"
#include "charmap.h"
- $MirOS: contrib/code/jupp/rjoerc.in,v 1.22 2016/10/08 17:44:19 tg Exp $
+ $MirOS: contrib/code/jupp/rjoerc.in,v 1.23 2017/01/11 00:41:18 tg Exp $
Initialization file for JOE
Restricted access Joe
\i Help Screen turn off with ^J prev. screen ^[, \uCharacter Map\u \i
\i \i Dec Hex \u 0123 4567 89AB CDEF 0123 4567 89AB CDEF \u Hex Dec \i \i
\i \i | | \i \i
-\i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \i\u@ABC\u\i \i\uDEFG\u\i \i\uHIJK\u\i \i\uLMNO\u\i | 80 128 \i \i
-\i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \i\uPQRS\u\i \i\uTUVW\u\i \i\uXYZ[\u\i \i\u\\]^_\u\i | 90 144 \i \i
+\i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \80\81\82\83 \84\85\86\87 \88\89\8a\8b \8c\8d\8e\8f | 80 128 \i \i
+\i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \90\91\92\93 \94\95\96\97 \98\99\9a\9b \9c\9d\9e\9f | 90 144 \i \i
\i \i 32 20 | !"# $%&' ()*+ ,-./ ¡¢£ ¤¥¦§ ¨©ª« ¬®¯ | A0 160 \i \i
\i \i 48 30 | 0123 4567 89:; <=>? °±²³ ´µ¶· ¸¹º» ¼½¾¿ | B0 176 \i \i
\i \i 64 40 | @ABC DEFG HIJK LMNO ÀÁÂÃ ÄÅÆÇ ÈÉÊË ÌÍÎÏ | C0 192 \i \i
-/* $MirOS: contrib/code/jupp/scrn.c,v 1.13 2014/07/25 20:43:01 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
/* How to display characters (especially the control ones) */
/* here are characters ... */
-unsigned char xlatc[256] = {
+static const unsigned char xlatc[256] = {
64, 65, 66, 67, 68, 69, 70, 71, /* 8 */
72, 73, 74, 75, 76, 77, 78, 79, /* 16 */
80, 81, 82, 83, 84, 85, 86, 87, /* 24 */
112, 113, 114, 115, 116, 117, 118, 119, /* 248 */
120, 121, 122, 123, 124, 125, 126, 63 /* 256 */
};
-/* ... and here their attributes */
-unsigned xlata[256] = {
+/* ... and here their attributes */
+static const unsigned short xlata[256] = {
UNDERLINE, UNDERLINE, UNDERLINE, UNDERLINE, /* 4 */
UNDERLINE, UNDERLINE, UNDERLINE, UNDERLINE, /* 8 */
UNDERLINE, UNDERLINE, UNDERLINE, UNDERLINE, /* 12 */
/* Output character with attributes */
+void outatr_help(SCRN *t,int *scrn,int *attrf,int xx,int yy,int c,int a)
+{
+ /* kludge for help_display() only */
+ if (locale_map->type && !joe_isprint(locale_map,c)) {
+ a ^= xlata[c];
+ c = xlatc[c];
+ }
+ outatr(locale_map, t, scrn, attrf, xx, yy, c, a);
+}
+
void outatr(struct charmap *map,SCRN *t,int *scrn,int *attrf,int xx,int yy,int c,int a)
{
if(map->type)
return 0;
}
-/* As above but useable in insert mode */
-/* The cursor position must already be correct */
-
-static void outatri(SCRN *t, int x, int y, int c, int a)
-{
-/*
- if (c == -1)
- c = ' ';
- if (a != t->attrib)
- set_attr(t, a);
- if (t->haz && c == '~')
- c = '\\';
- utf8_putc(c);
- t->x+=joe_wcwidth(1,c);
-*/
- /* ++t->x; */
-}
-
static void out(unsigned char *t, unsigned char c)
{
ttputc(c);
SCRN *nopen(CAP *cap)
{
- SCRN *t = (SCRN *) joe_malloc(sizeof(SCRN));
+ SCRN *t = calloc(1, sizeof(SCRN));
int x, y;
ttopen();
t->os = 1;
if (t->os || getflag(t->cap,US "ul"))
t->ul = 1;
- else
- t->ul = 0;
t->xn = getflag(t->cap,US "xn");
t->am = getflag(t->cap,US "am");
t->cl = jgetstr(t->cap,US "cl");
t->cd = jgetstr(t->cap,US "cd");
- if (notite) {
- t->ti = NULL;
- t->te = NULL;
- } else {
+ if (!notite) {
t->ti = jgetstr(t->cap,US "ti");
t->te = jgetstr(t->cap,US "te");
}
t->Sf = jgetstr(t->cap,US "AF");
if (!t->Sf) t->Sf = jgetstr(t->cap,US "Sf");
- t->mb = NULL;
- t->md = NULL;
- t->mh = NULL;
- t->mr = NULL;
- t->avattr = 0;
if (!(t->me = jgetstr(t->cap,US "me")))
goto oops;
if ((t->mb = jgetstr(t->cap,US "mb")))
t->avattr |= DIM;
if ((t->mr = jgetstr(t->cap,US "mr")))
t->avattr |= INVERSE;
- oops:
+ oops:
if (assume_color) {
/* Install color support if it looks like an ansi terminal (it has bold which begins with ESC [) */
#ifndef TERMINFO
- if (!t->Sf && t->md && t->md[0]=='\\' && t->md[1]=='E' && t->md[2]=='[') {
+ if (!t->Sf && t->md && t->md[0]=='\\' && t->md[1]=='E' && t->md[2]=='[') {
t->ut = 1;
t->Sf =US "\\E[3%dm";
t->Sb =US "\\E[4%dm";
}
#else
- if (!t->Sf && t->md && t->md[0]=='\033' && t->md[1]=='[') {
+ if (!t->Sf && t->md && t->md[0]=='\033' && t->md[1]=='[') {
t->ut = 1;
t->Sf =US "\033[3%p1%dm";
t->Sb =US "\033[4%p1%dm";
#endif
}
- t->so = NULL;
- t->se = NULL;
if (getnum(t->cap,US "sg") <= 0 && !t->mr && jgetstr(t->cap,US "se")) {
if ((t->so = jgetstr(t->cap,US "so")) != NULL)
t->avattr |= INVERSE;
if (getflag(t->cap,US "xs") || getflag(t->cap,US "xt"))
t->so = NULL;
- t->us = NULL;
- t->ue = NULL;
if (getnum(t->cap,US "ug") <= 0 && jgetstr(t->cap,US "ue")) {
if ((t->us = jgetstr(t->cap,US "us")) != NULL)
t->avattr |= UNDERLINE;
t->IC = jgetstr(t->cap,US "IC");
t->ip = jgetstr(t->cap,US "ip");
t->mi = getflag(t->cap,US "mi");
- } else {
- t->dm = NULL;
- t->dc = NULL;
- t->DC = NULL;
- t->ed = NULL;
- t->im = NULL;
- t->ic = NULL;
- t->IC = NULL;
- t->ip = NULL;
- t->ei = NULL;
- t->mi = 1;
}
- t->bs = NULL;
if (jgetstr(t->cap,US "bc"))
t->bs = jgetstr(t->cap,US "bc");
else if (jgetstr(t->cap,US "le"))
if (getflag(t->cap,US "pt"))
t->ta =US "\11";
t->bt = jgetstr(t->cap,US "bt");
- if (getflag(t->cap,US "xt")) {
- t->ta = NULL;
- t->bt = NULL;
- }
-
- if (!usetabs) {
+ if (getflag(t->cap,US "xt") || !usetabs) {
t->ta = NULL;
t->bt = NULL;
}
#endif
fprintf(stderr,"Sorry, your terminal can't do absolute cursor positioning.\nIt's broken\n");
return NULL;
- ok:
+ ok:
/* Determine if we can scroll */
if (((t->sr || t->SR) && (t->sf || t->SF) && t->cs) || ((t->al || t->AL) && (t->dl || t->DL)))
t->scroll = 1;
- else {
- t->scroll = 0;
- if (baud < 38400)
- mid = 1;
- }
+ else if (baud < 38400)
+ mid = 1;
/* Determine if we can ins/del within lines */
if ((t->im || t->ic || t->IC) && (t->dc || t->DC))
t->insdel = 1;
- else
- t->insdel = 0;
/* Adjust for high baud rates */
if (baud >= 38400) {
texec(t->cap, t->cl, 1, 0, 0, 0, 0);
/* Initialize variable screen size dependant vars */
- t->scrn = NULL;
- t->attr = NULL;
- t->sary = NULL;
- t->updtab = NULL;
- t->syntab = NULL;
- t->compose = NULL;
- t->ofst = NULL;
- t->ary = NULL;
- t->htab = (struct hentry *) joe_malloc(256 * sizeof(struct hentry));
+ t->htab = calloc(256, sizeof(struct hentry));
nresize(t, t->co, t->li);
joe_free(t->ofst);
if (t->ary)
joe_free(t->ary);
- t->scrn = (int *) joe_malloc(t->li * t->co * sizeof(int));
- t->attr = (int *) joe_malloc(t->li * t->co * sizeof(int));
- t->sary = (int *) joe_calloc(t->li, sizeof(int));
- t->updtab = (int *) joe_malloc(t->li * sizeof(int));
- t->syntab = (int *) joe_malloc(t->li * sizeof(int));
- t->compose = (int *) joe_malloc(t->co * sizeof(int));
- t->ofst = (int *) joe_malloc(t->co * sizeof(int));
- t->ary = (struct hentry *) joe_malloc(t->co * sizeof(struct hentry));
+ t->scrn = calloc(t->li * t->co, sizeof(int));
+ t->attr = calloc(t->li * t->co, sizeof(int));
+ t->sary = calloc(t->li, sizeof(int));
+ t->updtab = calloc(t->li, sizeof(int));
+ t->syntab = calloc(t->li, sizeof(int));
+ t->compose = calloc(t->co, sizeof(int));
+ t->ofst = calloc(t->co, sizeof(int));
+ t->ary = calloc(t->co, sizeof(struct hentry));
nredraw(t);
}
texec(t->cap, t->ho, 1, 0, 0, 0, 0);
t->x = 0;
t->y = hy;
-doch:
+ doch:
+ /* FALLTHROUGH */
case 4:
texec(t->cap, t->ch, 1, x, 0, 0, 0);
t->x = x;
case 8:
texec(t->cap, t->cr, 1, 0, 0, 0, 0);
t->x = 0;
-docv:
+ docv:
+ /* FALLTHROUGH */
case 5:
texec(t->cap, t->cv, 1, y, 0, 0, 0);
t->y = y;
setins(t, x);
for (a = 0; a != n; ++a) {
texec(t->cap, t->ic, 1, x, 0, 0, 0);
- outatri(t, x + a, y, s[a], as[a]);
texec(t->cap, t->ip, 1, x, 0, 0, 0);
}
if (!t->mi)
clrins(t);
} else {
texec(t->cap, t->IC, 1, n, 0, 0, 0);
- for (a = 0; a != n; ++a)
- outatri(t, x + a, y, s[a], as[a]);
}
}
mmove(t->scrn + x + t->co * y + n, t->scrn + x + t->co * y, (t->co - (x + n)) * sizeof(int));
msetI(t->syntab + top, -1, bot - top);
return;
- done:
+ done:
mmove(t->scrn + top * t->co, t->scrn + (top + amnt) * t->co, (bot - top - amnt) * t->co * sizeof(int));
mmove(t->attr + top * t->co, t->attr + (top + amnt) * t->co, (bot - top - amnt) * t->co * sizeof(int));
msetI(t->updtab + top, 1, bot - top);
msetI(t->syntab + top, -1, bot - top);
return;
- done:
+ done:
mmove(t->scrn + (top + amnt) * t->co, t->scrn + top * t->co, (bot - top - amnt) * t->co * sizeof(int));
mmove(t->attr + (top + amnt) * t->co, t->attr + top * t->co, (bot - top - amnt) * t->co * sizeof(int));
; Right-Click this and choose "_I_nstall" to install jupp!\r
\r
-; © 2006, 2009, 2010, 2011, 2012, 2016\r
+; © 2006, 2009, 2010, 2011, 2012, 2016, 2017\r
; by mirabilos <m@mirbsd.org>\r
; see copying.txt and jupprc for legal\r
\r
[jupp.AddReg]\r
HKCR,"*\shell\jupp","",,"&jupp"\r
HKCR,"*\shell\jupp","Version",,"jupp 3.1.@jwin@ (i486)"\r
-HKCR,"*\shell\jupp\command","",,"%24%\Programme\jupp32\jupp32.exe ""%L"""\r
+HKCR,"*\shell\jupp\command","",,"%24%\Programme\jupp32\jupp32.exe -CYGhack %L"\r
\r
[fopenas.AddReg]\r
HKCR,"*\shell\fopenas","",,"&Load with..."\r
jcm.Copy=24,Programme\jupp32\charmaps\r
jsy.Copy=24,Programme\jupp32\syntax\r
\r
-; $MirOS: contrib/code/jupp/setup.inf,v 1.5 2016/10/30 02:44:19 tg Exp $\r
+; $MirOS: contrib/code/jupp/setup.inf,v 1.6 2017/01/11 19:26:54 tg Exp $\r
-/* $MirOS: contrib/code/jupp/syntax.c,v 1.13 2016/10/29 23:44:45 tg Exp $ */
+/* $MirOS: contrib/code/jupp/syntax.c,v 1.15 2017/01/10 20:55:03 tg Exp $ */
/*
* Syntax highlighting DFA interpreter
* Copyright
{
int c;
+ utfstate.first = 0;
if (!(utfstate.start < utfstate.limit)) {
if ((c = pgetb(p)) == NO_MORE_DATA)
return (NO_MORE_DATA);
utfstate.limit = utf8_encode(utfstate.buf,
to_uni(p->b->o.charmap, c));
utfstate.start = 0;
+ utfstate.first = 1;
}
return (utfstate.buf[utfstate.start++]);
}
return state;
}
-/* Create empty command */
-
-static struct high_cmd *
-mkcmd(void)
-{
- struct high_cmd *cmd = malloc(sizeof(struct high_cmd));
- cmd->noeat = 0;
- cmd->recolor = 0;
- cmd->start_buffering = 0;
- cmd->stop_buffering = 0;
- cmd->new_state = 0;
- cmd->keywords = 0;
- cmd->ignore = 0;
- return cmd;
-}
-
/* Load syntax file */
struct high_syntax *syntax_list;
return 0;
/* Create new one */
- syntax = malloc(sizeof(struct high_syntax));
+ syntax = calloc(1, sizeof(struct high_syntax));
syntax->name = (const unsigned char *)strdup((const char *)name);
syntax->next = syntax_list;
syntax_list = syntax;
- syntax->nstates = 0;
- syntax->color = 0;
syntax->states = malloc(sizeof(struct high_state *)*(syntax->szstates=64));
syntax->sync_lines = 120;
- syntax->default_cmd.noeat = 0;
- syntax->default_cmd.recolor = 0;
- syntax->default_cmd.start_buffering = 0;
- syntax->default_cmd.new_state = 0;
- syntax->default_cmd.keywords = 0;
memset(clist, 0, sizeof(clist));
break;
/* If it doesn't exist, create it */
if(!color) {
- color = malloc(sizeof(struct high_color));
+ color = calloc(1, sizeof(struct high_color));
color->name = (unsigned char *)strdup((char *)bf);
- color->color = 0;
color->next = syntax->color;
syntax->color = color;
} else {
}
}
/* Create command */
- cmd = mkcmd();
+ cmd = calloc(1, sizeof(struct high_cmd));
parse_ws(&p,'#');
if(!parse_ident(&p,bf,255)) {
int z;
if (cmd->ignore)
joe_strtolower(bf);
if(!parse_ident(&p,bf1,255)) {
- struct high_cmd *kw_cmd=mkcmd();
+ struct high_cmd *kw_cmd = calloc(1, sizeof(struct high_cmd));
kw_cmd->noeat=1;
kw_cmd->new_state = find_state(syntax,bf1);
if(!cmd->keywords)
-/* $MirOS: contrib/code/jupp/tab.c,v 1.5 2016/10/08 14:58:46 tg Exp $ */
+/* $MirOS: contrib/code/jupp/tab.c,v 1.6 2017/01/10 19:16:28 tg Exp $ */
/*
* File selection menu
* Copyright
#include <sys/stat.h>
#endif
+#include <stdlib.h>
+
#include "b.h"
#include "blocks.h"
#include "menu.h"
-/* $MirOS: contrib/code/jupp/tw.c,v 1.9 2016/10/08 16:42:00 tg Exp $ */
+/* $MirOS: contrib/code/jupp/tw.c,v 1.10 2017/01/10 19:16:28 tg Exp $ */
/*
* Text editing windows
* Copyright
#include "types.h"
#include <stdio.h>
+#include <stdlib.h>
#ifdef HAVE_TIME_H
#include <time.h>
#endif
-/* $MirOS: contrib/code/jupp/uisrch.c,v 1.6 2010/04/08 15:31:05 tg Exp $ */
+/* $MirOS: contrib/code/jupp/uisrch.c,v 1.7 2017/01/10 19:16:28 tg Exp $ */
/*
* Incremental search
* Copyright
#include "config.h"
#include "types.h"
+#include <stdlib.h>
+
#include "b.h"
#include "bw.h"
#include "main.h"
-/* $MirOS: contrib/code/jupp/usearch.c,v 1.6 2012/12/22 00:06:15 tg Exp $ */
+/* $MirOS: contrib/code/jupp/usearch.c,v 1.9 2017/01/10 19:16:28 tg Exp $ */
/*
* Search & Replace system
* Copyright
#include "types.h"
#include <stdio.h>
+#include <stdlib.h>
#include "b.h"
#include "bw.h"
static int restrict_to_block(BW *bw, SRCH *srch)
{
- if (!srch->valid || !srch->block_restrict)
+ if (!srch->block_restrict)
return 0;
bw->cursor->xcol = piscol(bw->cursor);
if (srch->backwards)
else {
SRCH *srch = globalsrch;
- globalsrch = 0;
+ globalsrch = NULL;
srch->addr = bw->cursor->byte;
if (!srch->wrap_p || srch->wrap_p->b!=bw->b) {
prm(srch->wrap_p);
srch->wrap_p->owner = &srch->wrap_p;
srch->wrap_flag = 0;
}
+ srch->valid = 0;
return dopfnext(bw, setmark(srch), NULL);
}
}
-/* $MirOS: contrib/code/jupp/utf8.c,v 1.12 2014/10/23 17:10:45 tg Exp $ */
+/* $MirOS: contrib/code/jupp/utf8.c,v 1.18 2017/01/10 23:21:56 tg Exp $ */
/*
* UTF-8 Utilities
* Copyright
* (C) 2004 Joseph H. Allen
- * (c) 2004, 2006 Thorsten Glaser
+ * (c) 2004, 2006, 2011, 2013, 2014, 2017 Thorsten Glaser
*
* This file is part of JOE (Joe's Own Editor)
*/
#include <stdlib.h>
#endif
+#ifdef __CYGWIN__
+#include <cygwin/version.h>
+#endif
+
#ifdef __MirBSD__
#include <sys/param.h>
#endif
+#undef USE_CODEPAGE
#undef USE_LOCALE
#if defined(HAVE_SETLOCALE) && defined(HAVE_NL_LANGINFO)
#define USE_LOCALE
#endif
+/* Cygwin before 1.7.2 did not have locale support */
+#if defined(CYGWIN_VERSION_API_MAJOR) && (CYGWIN_VERSION_API_MAJOR < 1) && \
+ defined(CYGWIN_VERSION_API_MINOR) && (CYGWIN_VERSION_API_MINOR < 222)
+#define USE_CODEPAGE
+#undef USE_LOCALE
+#endif
+
/* OpenBSD, ekkoBSD and old MirOS do not have real locale support */
#if defined(__OpenBSD__) && (!defined(MirBSD) || (MirBSD < 0x09A0))
#undef USE_LOCALE
#undef USE_LOCALE
#endif
+#ifdef USE_LOCALE
+#undef USE_CODEPAGE
+#endif
+
#include "rc.h"
#include "utf8.h"
#include "charmap.h"
/* Initialize locale for JOE */
-unsigned char *codeset; /* Codeset of terminal */
+#ifdef USE_CODEPAGE
+static unsigned int cygwin32_get_cp(void);
+#endif
struct charmap *locale_map;
/* Character map of terminal */
void
joe_locale(void)
{
-#if !defined(USE_LOCALE)
- unsigned char *s, *t;
-
+ unsigned char *s;
- s=(unsigned char *)getenv("LC_ALL");
- if (!s) {
- s=(unsigned char *)getenv("LC_CTYPE");
+ s=(unsigned char *)getenv("JOECHARMAP");
+ locale_map = find_charmap(s);
+#if !defined(USE_LOCALE)
+ if (!locale_map) {
+ s=(unsigned char *)getenv("LC_ALL");
if (!s) {
- s=(unsigned char *)getenv("LANG");
+ s=(unsigned char *)getenv("LC_CTYPE");
+ if (!s) {
+ s=(unsigned char *)getenv("LANG");
+ }
}
+#ifdef USE_CODEPAGE
+ /* if LC_* are unset, use codepage */
+ if (!s) {
+ char buf[16];
+
+ joe_snprintf_1(buf, sizeof(buf), "cp%u", cygwin32_get_cp());
+ locale_map = find_charmap(buf);
+ }
+#endif
}
#endif
#ifdef USE_LOCALE
- setlocale(LC_ALL,"");
- codeset = (unsigned char *)strdup(nl_langinfo(CODESET));
+ if (!locale_map) {
+ setlocale(LC_ALL,"");
+ s = (unsigned char *)strdup(nl_langinfo(CODESET));
- locale_map = find_charmap(codeset);
+ locale_map = find_charmap(s);
+ }
#else
- if (s == NULL) {
- locale_map = NULL;
- } else {
- if ((t = strrchr(s, '.')) != NULL)
- locale_map = find_charmap(++t);
- if (locale_map == NULL)
+ if (!locale_map && s) {
+ unsigned char *t, *tt;
+
+ if ((t = strrchr(s, '.')) != NULL) {
+ if ((tt = strchr(++t, '@')) != NULL)
+ *tt = '\0';
+ locale_map = find_charmap(t);
+ }
+ if (!locale_map)
locale_map = find_charmap(s);
}
#endif
else
return c;
}
+
+#ifdef USE_CODEPAGE
+#include <windows.h>
+
+/*
+ * Mirror get_cp() in winsup/cygwin/miscfuncs.cc as used by
+ * dev_console::str_to_con() in winsup/cygwin/fhandler_console.cc
+ */
+static unsigned int
+cygwin32_get_cp(void)
+{
+ return (AreFileApisANSI() ? GetACP() : GetOEMCP());
+}
+#endif
-/* $MirOS: contrib/code/jupp/utils.c,v 1.3 2008/05/13 13:08:31 tg Exp $ */
+/* $MirOS: contrib/code/jupp/utils.c,v 1.4 2017/01/10 19:05:17 tg Exp $ */
/*
* Various utilities
* Copyright
#include "blocks.h"
#include "utils.h"
-
-#if 0
-int joe_ispunct(int wide,struct charmap *map,int c)
-{
- if (joe_isspace(c))
- return 0;
-
- if (c=='_')
- return 1;
-
- if (isalnum_(wide,map,c))
- return 0;
-
- return joe_isprint(wide,map,c);
-}
-#endif
-
/*
* return minimum/maximum of two numbers
*/
return a < b ? a : b;
}
-#if 0
-/*
- * Characters which are considered as word characters
- * _ is considered as word character because is often used
- * in the names of C/C++ functions
- */
-int isalnum_(int wide,struct charmap *map,int c)
-{
- /* Fast... */
- if (c>='0' && c<='9' ||
- c>='a' && c<='z' ||
- c>='A' && c<='Z' ||
- c=='_')
- return 1;
- else if(c<128)
- return 0;
-
- /* Slow... */
- if (wide)
- return joe_iswalpha(c);
- else
- return joe_iswalpha(to_uni(map,c));
-}
-
-int isalpha_(int wide,struct charmap *map,int c)
-{
- /* Fast... */
- if (c>='a' && c<='z' ||
- c>='A' && c<='Z' ||
- c=='_')
- return 1;
- else if(c<128)
- return 0;
-
- /* Slow... */
- if (wide)
- return joe_iswalpha(c);
- else
- return joe_iswalpha(to_uni(map,c));
-}
-#endif
-
/* Versions of 'read' and 'write' which automatically retry when interrupted */
ssize_t joe_read(int fd, void *buf, size_t size)
{
return rt;
}
-/* wrappers to *alloc routines */
-void *joe_malloc(size_t size)
-{
- return malloc(size);
-}
-
-void *joe_calloc(size_t nmemb, size_t size)
-{
- return calloc(nmemb, size);
-}
-
-void *joe_realloc(void *ptr, size_t size)
-{
- return realloc(ptr, size);
-}
-
-void joe_free(void *ptr)
-{
- free(ptr);
-}
-
-
#ifndef SIG_ERR
#define SIG_ERR ((sighandler_t) -1)
#endif
-/* $MirOS: contrib/code/jupp/utils.h,v 1.3 2008/05/13 13:08:31 tg Exp $ */
+/* $MirOS: contrib/code/jupp/utils.h,v 1.4 2017/01/10 19:05:17 tg Exp $ */
/*
* Various utilities
- *
+ *
* Copyright
* (C) 1992 Joseph H. Allen
* (C) 2001 Marek 'Marx' Grac
#endif
/*
- * Functions which return minimum/maximum of two numbers
+ * Functions which return minimum/maximum of two numbers
*/
unsigned int uns_min PARAMS((unsigned int a, unsigned int b));
signed int int_min PARAMS((signed int a, int signed b));
ssize_t joe_write PARAMS((int fd, void *buf, size_t siz));
/* wrappers to *alloc routines */
-void *joe_malloc PARAMS((size_t size));
-void *joe_calloc PARAMS((size_t nmemb, size_t size));
-void *joe_realloc PARAMS((void *ptr, size_t size));
-void joe_free PARAMS((void *ptr));
+#define joe_malloc malloc
+#define joe_calloc calloc
+#define joe_realloc realloc
+#define joe_free free
#ifndef HAVE_SIGHANDLER_T
typedef RETSIGTYPE (*sighandler_t)(int);
-/* $MirOS: contrib/code/jupp/vs.c,v 1.8 2016/10/30 00:19:57 tg Exp $ */
+/* $MirOS: contrib/code/jupp/vs.c,v 1.9 2017/01/10 19:16:28 tg Exp $ */
/*
* Variable length strings
* Copyright
#include "config.h"
#include "types.h"
+#include <stdlib.h>
+
#include "blocks.h"
#include "utils.h"
#include "vs.h"