-$MirOS: contrib/code/jupp/NEWS,v 1.110 2017/08/09 01:00:22 tg Exp $
+$MirOS: contrib/code/jupp/NEWS,v 1.111 2017/12/03 03:26:18 tg Exp $
-------------------------------------------------------------------
jupp-current
+- Harmonise help rendering in jupprc (also for 2.8, 3.7, (NEW) 4.4)
+- Update internationalisation data to Unicode 10.0.0 with bugfixes
+- Don’t limit JOE_FILENAME
+- Optionally be NOMMU-safe: use vfork(), disable stuff needing fork()
+- Let ^K] also remove whitespace at EOF
+- Major code cleanup and a lot of warning fixes
+- Improve syntax highlighting (conf, c, all dark blue-using ones)
+- Don’t use sscanf(3) any more (dietlibc complains about bloat)
+- Add way to disable use of the FPU (including Math), for klibc
+- Make assume_color[sic!] actually work
+- Recognise libncursesw for tgetflag(3); add --disable-terminfo
+
JOE 3.1jupp31
- Fix <bsd/string.h> usage issue on Haiku
# serial 2
-# Check whether the underlying file-system supports filenames
+# Check whether the underlying filesystem supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
#include "config.h"
#include "types.h"
-__RCSID("$MirOS: contrib/code/jupp/b.c,v 1.20 2017/12/03 02:36:00 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/b.c,v 1.23 2017/12/06 16:37:40 tg Exp $");
#include <unistd.h>
#include <sys/stat.h>
int d = prgetc(q);
prm(q);
- if (joe_isalnum_(p->b->o.charmap,c) && (!joe_isalnum_(p->b->o.charmap,d) || pisbof(p)))
+ if (joe_isalnux(p->b->o.charmap,c) && (!joe_isalnux(p->b->o.charmap,d) || pisbof(p)))
return 1;
else
return 0;
int c = prgetc(q);
prm(q);
- if (joe_isalnum_(p->b->o.charmap,c) && (!joe_isalnum_(p->b->o.charmap,d) || piseof(p)))
+ if (joe_isalnux(p->b->o.charmap,c) && (!joe_isalnux(p->b->o.charmap,d) || piseof(p)))
return 1;
else
return 0;
*skip = 0;
*amnt = LONG_MAX;
- for (x = sLEN(n) - 1; x > 0 && ((n[x] >= '0' && n[x] <= '9') || n[x] == 'x' || n[x] == 'X'); --x) ;
+ for (x = sLEN(n) - 1; x > 0 && ((n[x] >= '0' && n[x] <= '9') || (n[x] | 0x20) == 'x'); --x)
+ /* nothing */;
if (n[x] == ',') {
void *vp;
n[x] = 0;
*skip = ustol(n + x + 1, &vp, USTOL_EOS);
- for (--x; x > 0 && ((n[x] >= '0' && n[x] <= '9') || n[x] == 'x' || n[x] == 'X'); --x) ;
+ for (--x; x > 0 && ((n[x] >= '0' && n[x] <= '9') || (n[x] | 0x20) == 'x'); --x)
+ /* nothing */;
if (n[x] == ',') {
n[x] = 0;
if (vp != NULL)
*skip = ustol(n + x + 1, NULL, USTOL_EOS);
}
}
-#ifndef __MSDOS__
if (n[0] == '~') {
for (x = 1; n[x] && n[x] != '/'; ++x) ;
if (n[x] == '/') {
}
}
}
-#endif
return n;
}
n = parsens(s, &skip, &amnt);
/* Open file or stream */
-#ifndef __MSDOS__
if (n[0] == '!') {
nescape(maint->t);
ttclsn();
fi = popen((char *)(n + 1), "r");
} else
-#endif
if (!strcmp(n, "-"))
fi = stdin;
else {
/* Close stream */
err:
-#ifndef __MSDOS__
if (s[0] == '!')
pclose(fi);
- else
-#endif
- if (strcmp(n, "-"))
+ else if (strcmp(n, "-"))
fclose(fi);
opnerr:
if (amnt < size)
size = amnt;
-#ifndef __MSDOS__
if (s[0] == '!') {
nescape(maint->t);
ttclsn();
f = popen((char *)(s + 1), "w");
- } else
-#endif
- if (s[0] == '>' && s[1] == '>')
+ } else if (s[0] == '>' && s[1] == '>')
f = fopen((char *)(s + 2), "a");
else if (!strcmp(s, "-")) {
nescape(maint->t);
}
err:
-#ifndef __MSDOS__
if (s[0] == '!')
pclose(f);
- else
-#endif
- if (strcmp(s, "-"))
+ else if (strcmp(s, "-"))
fclose(f);
else
fflush(f);
#include "config.h"
#include "types.h"
-__RCSID("$MirOS: contrib/code/jupp/bw.c,v 1.25 2017/12/02 04:32:38 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/bw.c,v 1.26 2017/12/04 22:15:38 tg Exp $");
#include <string.h>
#ifdef HAVE_STDLIB_H
do {
outatr(utf8_map, t, screen + x, attr + x, x, y, tach, c1|atr);
tach = tach1;
- if (ifhave)
+ if (have)
goto bye;
if (++x == w)
goto eosl;
} else
--idx;
- if (ifhave)
+ if (have)
goto bye;
if (x >= w)
goto eosl;
strlcpy((char *)buf, " ",12);
for (z = 0; buf[z]; ++z) {
outatr(w->b->o.charmap, t, screen + z, attr + z, z, y, buf[z], 0);
- if (ifhave)
+ if (have)
return;
comp[z] = buf[z];
}
y = w->cursor->line - w->top->line + w->y;
attr = t->attr + y*w->t->w;
for (screen = t->scrn + y * w->t->w; y != bot; ++y, (screen += w->t->w), (attr += w->t->w)) {
- if (ifhave && !linums)
+ if (have && !linums)
break;
if (linums)
gennum(w, screen, attr, t, y, t->compose);
y = w->y;
attr = t->attr + w->y * w->t->w;
for (screen = t->scrn + w->y * w->t->w; y != w->y + w->cursor->line - w->top->line; ++y, (screen += w->t->w), (attr += w->t->w)) {
- if (ifhave && !linums)
+ if (have && !linums)
break;
if (linums)
gennum(w, screen, attr, t, y, t->compose);
#include "config.h"
#include "types.h"
-__RCSID("$MirOS: contrib/code/jupp/charmap.c,v 1.23 2017/12/03 02:36:00 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/charmap.c,v 1.24 2017/12/04 21:53:33 tg Exp $");
#include <stdlib.h>
#include <string.h>
if (c < 0 || c > 255)
return (0);
return (((map->print_map[ofst] & bitn) != 0) &&
- ((map->alnum__map[ofst] & bitn) == 0));
+ ((map->alnux_map[ofst] & bitn) == 0));
}
int
}
int
-byte_isalpha_(struct charmap *map, int c)
+byte_isalphx(struct charmap *map, int c)
{
int ofst = (c >> 3);
int bitn = (1 << (c & 7));
if (c < 0 || c > 255)
return (0);
- return ((map->alpha__map[ofst] & bitn) != 0);
+ return ((map->alphx_map[ofst] & bitn) != 0);
}
int
-byte_isalnum_(struct charmap *map, int c)
+byte_isalnux(struct charmap *map, int c)
{
int ofst = (c >> 3);
int bitn = (1 << (c & 7));
if (c < 0 || c > 255)
return (0);
- return ((map->alnum__map[ofst] & bitn) != 0);
+ return ((map->alnux_map[ofst] & bitn) != 0);
}
int
map->is_punct = byte_ispunct;
map->is_print = byte_isprint;
map->is_space = byte_isspace;
- map->is_alpha_ = byte_isalpha_;
- map->is_alnum_ = byte_isalnum_;
+ map->is_alphx = byte_isalphx;
+ map->is_alnux = byte_isalnux;
map->to_lower = byte_tolower;
map->to_upper = byte_toupper;
map->to_uni = to_uni;
for (x = 0; x != 32; ++x) {
map->print_map[x] = 0;
- map->alpha__map[x] = 0;
- map->alnum__map[x] = 0;
+ map->alphx_map[x] = 0;
+ map->alnux_map[x] = 0;
}
for (x = 0; x != 256; ++x) {
if (joe_iswprint(NULL, c))
set_bit(map->print_map, x);
if (joe_iswalpha(NULL, c)) {
- set_bit(map->alpha__map, x);
- set_bit(map->alnum__map, x);
+ set_bit(map->alphx_map, x);
+ set_bit(map->alnux_map, x);
}
y = joe_towlower(NULL, c);
/* Set underbar <U+005F> */
if ((c = from_uni(map, 0x5F)) != -1) {
- set_bit(map->alpha__map, c);
- set_bit(map->alnum__map, c);
+ set_bit(map->alphx_map, c);
+ set_bit(map->alnux_map, c);
}
/* Put digits into alnum map */
for (x = 0x30; x != 0x3A; ++x) {
if ((c = from_uni(map, x)) != -1)
- set_bit(map->alnum__map, c);
+ set_bit(map->alnux_map, c);
}
map->next = charmaps;
map->is_punct = joe_iswpunct;
map->is_print = joe_iswprint;
map->is_space = joe_iswspace;
- map->is_alpha_ = joe_iswalpha;
- map->is_alnum_ = joe_iswalnum;
+ map->is_alphx = joe_iswalpha;
+ map->is_alnux = joe_iswalnum;
map->to_lower = joe_towlower;
map->to_upper = joe_towupper;
map->next = charmaps;
#define _Icharmap 1
#ifdef EXTERN
-__IDSTRING(rcsid_charmap_h, "$MirOS: contrib/code/jupp/charmap.h,v 1.9 2017/12/02 17:00:48 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/charmap.h,v 1.10 2017/12/04 21:53:34 tg Exp $");
#endif
/* For sorted from_map entries */
int (*is_punct)(struct charmap *map,int c);
int (*is_print)(struct charmap *map,int c);
int (*is_space)(struct charmap *map,int c);
- int (*is_alpha_)(struct charmap *map,int c);
- int (*is_alnum_)(struct charmap *map,int c);
+ int (*is_alphx)(struct charmap *map,int c);
+ int (*is_alnux)(struct charmap *map,int c);
/* Character conversion functions */
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 _ */
- unsigned char alnum__map[32]; /* Bit map of alphanumeric characters and _ */
+ unsigned char alphx_map[32]; /* Bit map of alphabetic characters and _ */
+ unsigned char alnux_map[32]; /* Bit map of alphanumeric characters and _ */
};
/* Predicates */
#define joe_ispunct(map,c) ((map)->is_punct((map),(c)))
#define joe_isprint(map,c) ((map)->is_print((map),(c)))
#define joe_isspace(map,c) ((map)->is_space((map),(c)))
-#define joe_isalpha_(map,c) ((map)->is_alpha_((map),(c)))
-#define joe_isalnum_(map,c) ((map)->is_alnum_((map),(c)))
+#define joe_isalphx(map,c) ((map)->is_alphx((map),(c)))
+#define joe_isalnux(map,c) ((map)->is_alnux((map),(c)))
int joe_isblank PARAMS((struct charmap *map,int c));
int joe_isspace_eof PARAMS((struct charmap *map,int c));
#endif
#define NO_MORE_DATA EOF
-#if defined __MSDOS__ && SIZEOF_INT == 2 /* real mode ms-dos compilers */
-#if SIZEOF_VOID_P == 4 /* real mode ms-dos compilers with 'far' memory model or something like that */
-#define physical(a) (((unsigned long)(a)&0xFFFF)+(((unsigned long)(a)&0xFFFF0000)>>12))
-#define normalize(a) ((void *)(((unsigned long)(a)&0xFFFF000F)+(((unsigned long)(a)&0x0000FFF0)<<12)))
-#else
-#define physical(a) ((unsigned long)(a))
-#define normalize(a) (a)
-#endif /* sizeof(void *) == 4 */
-
-#define SEGSIZ 1024
-#define PGSIZE 1024
-#define LPGSIZE 10
-#define ILIMIT (PGSIZE*96L)
-#define HTSIZE 128
-
-#else /* not real mode ms-dos */
-
-#define physical(a) ((unsigned long)(a))
-#define normalize(a) (a)
#ifdef PAGE_SIZE
#define PGSIZE PAGE_SIZE
#else
#define ILIMIT (PGSIZE*1024)
#define HTSIZE 2048
-#endif /* real mode ms-dos */
-
#if !defined(__GNUC__) && !defined(__attribute__)
#define __attribute__(p) /* nothing */
#endif
-#define ATTR_UNUSED __attribute__((__unused__))
-
#ifdef HAVE_GCC_ATTRIBUTE_BOUNDED
#define ATTR_BOUNDED(p) __attribute__((__bounded__ p))
#else
#endif
#ifdef EXTERN
-__IDSTRING(rcsid_config_h, "$MirOS: contrib/code/jupp/config.h,v 1.11 2017/12/03 02:36:01 tg Exp $");
+__IDSTRING(rcsid_config_h, "$MirOS: contrib/code/jupp/config.h,v 1.12 2017/12/04 22:15:38 tg Exp $");
#endif
#endif /* ifndef _JOE_CONFIG_H */
-# $MirOS: contrib/code/jupp/configure.ac,v 1.62 2017/12/03 01:11:49 tg Exp $
+# $MirOS: contrib/code/jupp/configure.ac,v 1.63 2017/12/04 21:46:21 tg Exp $
#-
# Process this file with autoconf to produce a configure script.
[ --disable-terminfo disable use of terminfo functions],
terminfo=$enableval, terminfo=yes)
+AC_ARG_ENABLE(selinux,
+[ --disable-selinux disable SELinux context copying],
+ selinux=$enableval, selinux=yes)
+
AC_ARG_ENABLE([search_libs],
[ --disable-search-libs do not search in any external libraries],
search_libs=$enableval, search_libs=yes)
AC_SEARCH_LIBS(tgetflag, $search_libs_term, AC_DEFINE_UNQUOTED(TERMINFO, 1, [If we have newer terminfo/termcap capabilities]))
fi
AC_SEARCH_LIBS(snprintf, $search_libs_snprintf, AC_DEFINE_UNQUOTED(HAVE_SNPRINTF, 1, [If we have snprintf]))
-AC_SEARCH_LIBS(is_selinux_enabled, $search_libs_selinux, AC_DEFINE_UNQUOTED(HAVE_SELINUX_FUN, 1, [We have SELinux functions]))
+if test x"$selinux" = x"no"; then
+ echo "DISabling looking for SELinux support"
+else
+ AC_SEARCH_LIBS(is_selinux_enabled, $search_libs_selinux, AC_DEFINE_UNQUOTED(HAVE_SELINUX_FUN, 1, [We have SELinux functions]))
+fi
# other conditionals
AC_HEADER_TIME
-if test "$ac_cv_header_selinux_selinux_h" = "yes" -a "$ac_cv_header_selinux_context_h" = "yes" ; then
- echo "Enabling SELinux context copying!"
- AC_DEFINE(HAVE_SELINUX_HDR, 1, [We have SELinux headers])
-fi
-
# Checks for typedefs, structures, and compiler characteristics.
AC_C_PROTOTYPES
#HOOK#3102 filename matching
{Basic
-\i Help Screen turn off with ^J more help with ESC . (^[.) \i
+\i Help Screen turn off with ^J more help with Esc+. (^[.) \i
\i \i\u\bCURSOR\b\u \u\bGOTO\b\u \u\bBLOCK\b\u \u\bDELETE\b\u \u\bMISC\b\u \u\bEXIT\b\u \i \i
\i \i^S left ^D right ^R prev. screen ^KV move ^G char ^B reformat ^KX save \i \i
\i \i^E up ^X down ^C next screen ^KC copy ^Y line ^V overtype ^KQ abort \i \i
\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 2017-11-31; 3.1; autoCR-LF; UTF-8 via locale; per-file encoding \i \i
+\i \i @(#) jupprc 2017-12-06; 3.1; autoCR-LF; UTF-8 via locale; per-file encoding \i \i
}
#HOOK#3103 additional help screens
: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 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,"; p=--posix; sed $p -e q </dev/null >/dev/null 2>&1 || p=; r=$(sed $p -e 's\ 1[^^]\ 1[&]\ 1g; s\ 1\\^\ 1\\\\^\ 1g' <<EOF",rtn,"$fn",rtn,"EOF",rtn,"); (case $fn in *.nxc) ;; *) echo '==> Error: filename not *.nxc'; exit ;; esac; echo \"Compiling $fn\"; nbc -sm- -d \"$fn\" 2>&1; x=$?; if test $x = 0; then echo '==> OK'; else echo '==> Error code:' $x; fi) | tr '\\n' '\ 1' | sed $p -e 's!\ 1# *\\([^\ 1]*\\)\ 1File \"[^\"]*/\\('\"$r\"'\\)\" ; 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
+:def fixwhitespace eof," ",bof,"a",qrepl,"\\[",quote,"i",quote,"k",quote,"l",quote,"m ]\\+\\[",quote,"i",quote,"k",quote,"l",quote,"m ]\\$",rtn,rtn,rtn,"r",eof,rtn,ffirst,"\\^\\[^\\n]",rtn,"b",rtn,eol,markb,bof,delch,eof,markk,blkdel,ffirst,"\\?",rtn,"b",rtn,eol,rtn
+:def conflictmarker ffirst,"\\^\\[<>=]\\[<>=]\\[<>=]\\[<>=]\\[<>=]\\[<>=]\\[<>=]\\[ \\n]",rtn,rtn,ltarw
+:def pastemain helpcard,"Paste",rtn,keymap,"Paste",rtn
#HOOK#3105 main keybindings
-eof," ",bof,qrepl,"\\[",quote,"i",quote,"k",quote,"l",quote,"m ]\\+\\[",quote,"i",quote,"k",quote,"l",quote,"m ]\\$",rtn,rtn,rtn,"r",eof,ffirst,"\\[^\\n]",rtn,"b",rtn,rtarw,rtn,markb,rtn,eof,markk,blkdel ^K ]
-ffirst,"\\^\\[<>=]\\[<>=]\\[<>=]\\[<>=]\\[<>=]\\[<>=]\\[<>=]\\[ \\n]",rtn,rtn,ltarw ^Q =
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 ~
+fixwhitespace ^K ]
+conflictmarker ^Q =
backs ^?
backs ^H
backw ^[ o
#include "config.h"
#include "types.h"
-__RCSID("$MirOS: contrib/code/jupp/kbd.c,v 1.5 2017/12/02 02:07:28 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/kbd.c,v 1.6 2017/12/04 22:15:38 tg Exp $");
#include <stdlib.h>
#include <string.h>
for (x = 0; seq[x] && seq[x] != ' '; ++x) ;
c = seq[x];
seq[x] = 0;
-#ifdef __MSDOS__
- if (!strcmp(seq + 1, "ku")) {
- capseq = "\0H";
- seql = 2;
- } else if (!strcmp(seq + 1, "kd")) {
- capseq = "\0P";
- seql = 2;
- } else if (!strcmp(seq + 1, "kl")) {
- capseq = "\0K";
- seql = 2;
- } else if (!strcmp(seq + 1, "kr")) {
- capseq = "\0M";
- seql = 2;
- } else if (!strcmp(seq + 1, "kI")) {
- capseq = "\0R";
- seql = 2;
- } else if (!strcmp(seq + 1, "kD")) {
- capseq = "\0S";
- seql = 2;
- } else if (!strcmp(seq + 1, "kh")) {
- capseq = "\0G";
- seql = 2;
- } else if (!strcmp(seq + 1, "kH")) {
- capseq = "\0O";
- seql = 2;
- } else if (!strcmp(seq + 1, "kP")) {
- capseq = "\0I";
- seql = 2;
- } else if (!strcmp(seq + 1, "kN")) {
- capseq = "\0Q";
- seql = 2;
- } else if (!strcmp(seq + 1, "k1")) {
- capseq = "\0;";
- seql = 2;
- } else if (!strcmp(seq + 1, "k2")) {
- capseq = "\0<";
- seql = 2;
- } else if (!strcmp(seq + 1, "k3")) {
- capseq = "\0=";
- seql = 2;
- } else if (!strcmp(seq + 1, "k4")) {
- capseq = "\0>";
- seql = 2;
- } else if (!strcmp(seq + 1, "k5")) {
- capseq = "\0?";
- seql = 2;
- } else if (!strcmp(seq + 1, "k6")) {
- capseq = "\0@";
- seql = 2;
- } else if (!strcmp(seq + 1, "k7")) {
- capseq = "\0A";
- seql = 2;
- } else if (!strcmp(seq + 1, "k8")) {
- capseq = "\0B";
- seql = 2;
- } else if (!strcmp(seq + 1, "k9")) {
- capseq = "\0C";
- seql = 2;
- } else if (!strcmp(seq + 1, "k0")) {
- capseq = "\0D";
- seql = 2;
- }
- seq[x] = c;
- if (seql) {
- for (seq += x; *seq == ' '; ++seq) ;
- }
-#else
s = jgetstr(cap, seq + 1);
seq[x] = c;
if (s && (s = tcompile(cap, s, 0, 0, 0, 0))
capseq = s;
seql = sLEN(s);
for (seq += x; *seq == ' '; ++seq) ;
- }
-#endif
- else {
+ } else {
*err = -2;
return kmap;
}
#include "config.h"
#include "types.h"
-__RCSID("$MirOS: contrib/code/jupp/macro.c,v 1.11 2017/12/02 04:32:40 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/macro.c,v 1.12 2017/12/06 16:37:40 tg Exp $");
#include <string.h>
#ifdef HAVE_STDLIB_H
buf[x] = 9;
break;
case 'x':
- c = 0;
- if (buf[x + 1] >= '0' && buf[x + 1] <= '9')
- c = c * 16 + buf[++x] - '0';
- else if ((buf[x + 1] >= 'a' && buf[x + 1] <= 'f') || (buf[x + 1] >= 'A' && buf[x + 1] <= 'F'))
- c = c * 16 + (buf[++x] & 0xF) + 9;
- if (buf[x + 1] >= '0' && buf[x + 1] <= '9')
- c = c * 16 + buf[++x] - '0';
- else if ((buf[x + 1] >= 'a' && buf[x + 1] <= 'f') || (buf[x + 1] >= 'A' && buf[x + 1] <= 'F'))
- c = c * 16 + (buf[++x] & 0xF) + 9;
- buf[x] = c;
+ x += 1 + ustoc_hex(buf + x + 1, &c, USTOC_MAX);
break;
case '0':
case '1':
case '7':
case '8':
case '9':
- c = buf[x] - '0';
- if (buf[x + 1] >= '0' && buf[x + 1] <= '7')
- c = c * 8 + buf[++x] - '0';
- if (buf[x + 1] >= '0' && buf[x + 1] <= '7')
- c = c * 8 + buf[++x] - '0';
- buf[x] = c;
+ x += ustoc_oct(buf + x, &c, USTOC_MAX);
break;
}
}
#include "config.h"
#include "types.h"
-__RCSID("$MirOS: contrib/code/jupp/path.c,v 1.13 2017/12/02 02:07:29 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/path.c,v 1.14 2017/12/04 22:15:38 tg Exp $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#define skip_drive_letter(path) do_if_drive_letter((path), (path) += 2)
#ifndef _PATH_TMP
-# ifdef __MSDOS__
-# define _PATH_TMP ""
-# else
# define _PATH_TMP "/tmp/"
-# endif
#endif
#if !defined(PATH_MAX) && !defined(HAVE_GET_CURRENT_DIR_NAME)
return 0;
}
/********************************************************************/
-#ifdef __MSDOS__
-#include <dos.h>
-#include <dir.h>
-
-struct direct {
- unsigned char d_name[16];
-} direc;
-int dirstate = 0;
-struct ffblk ffblk;
-unsigned char *dirpath = NULL;
-
-void *opendir(unsigned char *path)
-{
- dirstate = 0;
- return &direc;
-}
-
-void closedir()
-{
-}
-
-struct direct *readdir()
-{
- int x;
-
- if (dirstate) {
- if (findnext(&ffblk))
- return NULL;
- } else {
- if (findfirst("*.*", &ffblk, FA_DIREC))
- return NULL;
- dirstate = 1;
- }
-
- strcpy(direc.d_name, ffblk.ff_name);
- for (x = 0; direc.d_name[x]; ++x)
- direc.d_name[x] = tolower(direc.d_name[x]);
- return &direc;
-}
-#endif
-/********************************************************************/
unsigned char **rexpnd(unsigned char *word)
{
void *dir;
int chpwd(const unsigned char *path)
{
-#ifdef __MSDOS__
- unsigned char buf[256];
- int x;
-
- if (!path)
- return 0;
- if ((path[0]) && (path[1] == ':')) {
- if (_chdrive(path[0] & 0x1F))
- return -1;
- path += 2;
- }
- if (!path[0])
- return 0;
- strcpy(buf, path);
- x = strlen(buf);
- while (x > 1) {
- --x;
- if ((buf[x] == '/') || (buf[x] == '\\'))
- buf[x] = 0;
- else
- break;
- }
- return chdir(buf);
-#else
if ((!path) || (!path[0]))
return 0;
return chdir((char *)path);
-#endif
}
/* The pwd function */
#include "config.h"
#include "types.h"
-__RCSID("$MirOS: contrib/code/jupp/rc.c,v 1.29 2017/12/03 02:36:02 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/rc.c,v 1.30 2017/12/04 22:15:38 tg Exp $");
#include <string.h>
#ifdef HAVE_STDLIB_H
0, /* read only */
0, /* french spacing */
0, /* spaces */
-#ifdef __MSDOS__
- 1, /* crlf */
-#else
0, /* crlf */
-#endif
0, /* Highlight */
NULL, /* Syntax name */
NULL, /* Syntax */
0, /* read only */
0, /* french spacing */
0, /* spaces */
-#ifdef __MSDOS__
- 1, /* crlf */
-#else
0, /* crlf */
-#endif
0, /* Highlight */
NULL, /* Syntax name */
NULL, /* Syntax */
int err = 0; /* Set to 1 if there was a syntax error */
strlcpy((char *)buf, (char *)name, 1024);
-#ifdef __MSDOS__
- fd = jfopen((char *)buf, "rt");
-#else
fd = jfopen((char *)buf, "r");
-#endif
if (!fd)
return -1; /* Return if we couldn't open the rc file */
#include "config.h"
#include "types.h"
-__RCSID("$MirOS: contrib/code/jupp/regex.c,v 1.7 2017/12/02 04:32:41 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/regex.c,v 1.9 2017/12/06 16:38:46 tg Exp $");
#include "b.h"
#include "charmap.h"
+#include "utils.h"
#include "vs.h"
-int escape(int utf8_,unsigned char **a, int *b)
+int escape(int isutf8,unsigned char **a, int *b)
{
int c;
unsigned char *s = *a;
- int l = *b;
+ int l = *b, z;
if (*s == '\\' && l >= 2) {
++s; --l;
case '5':
case '6':
case '7':
- c = *s - '0';
- ++s; --l;
- if (l > 0 && *s >= '0' && *s <= '7') {
- c = c * 8 + s[1] - '0';
- ++s; --l;
- }
- if (l > 0 && *s >= '0' && *s <= '7') {
- c = c * 8 + s[1] - '0';
- ++s; --l;
- }
+ z = ustoc_oct(s, &c, l);
+ s += z;
+ l -= z;
break;
case 'x':
case 'X':
- c = 0;
- ++s; --l;
- if (l > 0 && *s >= '0' && *s <= '9') {
- c = c * 16 + *s - '0';
- ++s; --l;
- } else if (l > 0 && *s >= 'A' && *s <= 'F') {
- c = c * 16 + *s - 'A' + 10;
- ++s; --l;
- } else if (l > 0 && *s >= 'a' && *s <= 'f') {
- c = c * 16 + *s - 'a' + 10;
- ++s; --l;
- }
-
- if (l > 0 && *s >= '0' && *s <= '9') {
- c = c * 16 + *s - '0';
- ++s; --l;
- } else if (l > 0 && *s >= 'A' && *s <= 'F') {
- c = c * 16 + *s - 'A' + 10;
- ++s; --l;
- } else if (l > 0 && *s >= 'a' && *s <= 'f') {
- c = c * 16 + *s - 'a' + 10;
- ++s; --l;
- }
+ z = ustoc_hex(s, &c, l);
+ s += z;
+ l -= z;
break;
default:
- if (utf8_)
+ if (isutf8)
c = utf8_decode_fwrd(&s, &l);
else {
c = *s++;
}
break;
}
- } else if (utf8_) {
+ } else if (isutf8) {
c = utf8_decode_fwrd(&s,&l);
} else {
c = *s++;
return c;
}
-static int brack(int utf8_,unsigned char **a, int *la, int c)
+static int brack(int isutf8,unsigned char **a, int *la, int c)
{
int inverse = 0;
int flag = 0;
} else {
int cl, cr;
- cl = escape(utf8_, &s, &l);
+ cl = escape(isutf8, &s, &l);
if (l >= 2 && s[0] == '-' && s[1] != ']') {
--l;
++s;
- cr = escape(utf8_, &s, &l);
+ cr = escape(isutf8, &s, &l);
if (c >= cl && c <= cr)
flag = 1;
} else if (c == cl)
return flag;
}
-static void savec(int utf8_,unsigned char **pieces, int n, int c)
+static void savec(int isutf8,unsigned char **pieces, int n, int c)
{
unsigned char buf[16];
int len;
unsigned char *s = NULL;
- if (utf8_)
+ if (isutf8)
len = utf8_encode(buf,c);
else {
buf[0] = c;
goto skip;
case '{':
to = '}';
-skip:
+ skip:
do {
s = skip_special(p);
} while (s != to && s != NO_MORE_DATA);
int c, d;
P *q = pdup(p);
P *o = NULL;
- int utf8_ = p->b->o.charmap->type;
+ int isutf8 = p->b->o.charmap->type;
struct charmap *map = p->b->o.charmap;
struct utf8_sm sm;
utf8_init(&sm);
while (len) {
- if (utf8_) {
+ if (isutf8) {
do {
c = utf8_decode(&sm,*regex++);
--len;
d = pgetc(p);
if (d == NO_MORE_DATA)
goto fail;
- savec(utf8_, pieces, n++, d);
+ savec(isutf8, pieces, n++, d);
break;
case 'n':
case 'r':
case '9':
regex -= 2;
len += 2;
- if (pgetc(p) != escape(utf8_, ®ex, &len))
+ if (pgetc(p) != escape(isutf8, ®ex, &len))
goto fail;
break;
case '*':
d = pgetc(p);
if (d == NO_MORE_DATA)
goto fail;
- if (!brack(utf8_, ®ex, &len, d))
+ if (!brack(isutf8, ®ex, &len, d))
goto fail;
- savec(utf8_, pieces, n++, d);
+ savec(isutf8, pieces, n++, d);
break;
case '+':
{
if (regex[1] == '[') {
regex += 2;
len -= 2;
- brack(utf8_, ®ex, &len, 0);
+ brack(isutf8, ®ex, &len, 0);
} else {
- d = escape(utf8_, ®ex, &len);
+ d = escape(isutf8, ®ex, &len);
if (icase)
d = joe_tolower(map,d);
}
- } else if (utf8_) {
+ } else if (isutf8) {
if ((d = utf8_decode_fwrd(®ex, &len)) < 0)
goto done;
else if (icase)
if (oregex[1] == '[') {
tregex += 2;
tlen -= 2;
- match = brack(utf8_, &tregex, &tlen, c);
+ match = brack(isutf8, &tregex, &tlen, c);
} else
match = (d == c);
} else {
match = (c == d);
}
} while (c != NO_MORE_DATA && match);
-
- done:
+ done:
if (r) {
pset(p, r);
prm(r);
}
}
}
-succeed:
+ succeed:
if (o)
prm(o);
prm(q);
return 1;
-fail:
+ fail:
if (o)
prm(o);
pset(p, q);
#include "config.h"
#include "types.h"
-__RCSID("$MirOS: contrib/code/jupp/scrn.c,v 1.30 2017/12/02 04:49:46 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/scrn.c,v 1.31 2017/12/04 22:15:39 tg Exp $");
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
for (y = 0; y != t->li; ++y) {
q = t->sary[y];
- if (ifhave)
+ if (have)
return;
if (q && q != t->li) {
if (q > 0) {
#define _JOE_SCRN_H 1
#ifdef EXTERN
-__IDSTRING(rcsid_scrn_h, "$MirOS: contrib/code/jupp/scrn.h,v 1.7 2017/12/02 17:00:50 tg Exp $");
+__IDSTRING(rcsid_scrn_h, "$MirOS: contrib/code/jupp/scrn.h,v 1.8 2017/12/04 22:15:39 tg Exp $");
#endif
#include "tty.h" /* ttputc() */
/* Character attribute bits */
-#ifdef __MSDOS__
-
-#define INVERSE 1
-#define UNDERLINE 2
-#define BOLD 4
-#define BLINK 8
-#define DIM 16
-extern unsigned atab[];
-
-#define outatr(t,scrn,attr,x,y,c,a) do { \
- (t); \
- (x); \
- (y); \
- *(scrn) = ((unsigned)(c) | atab[a]); \
-} while(0)
-
-#else
-
#define INVERSE 256
#define UNDERLINE 512
#define BOLD 1024
void outatr PARAMS((struct charmap *map,SCRN *t,int *scrn,int *attrf,int xx,int yy,int c,int a));
-#endif
-
/*
* translate character and its attribute into something printable
*/
#include "config.h"
-__RCSID("$MirOS: contrib/code/jupp/selinux.c,v 1.8 2017/12/02 02:07:31 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/selinux.c,v 1.10 2017/12/04 21:46:21 tg Exp $");
-#if defined(HAVE_SELINUX_HDR) && defined(HAVE_SELINUX_FUN)
+#if defined(HAVE_SELINUX_CONTEXT_H) && defined(HAVE_SELINUX_SELINUX_H) && \
+ defined(HAVE_SELINUX_FUN)
#define WITH_SELINUX
#else
#undef WITH_SELINUX
}
if (getfilecon(to_file, &to_context) < 0) {
-#ifdef _
- MSG_PUTS(_("\nCould not get security context for "));
- msg_outtrans(to_file);
- msg_putchar('\n');
-#else
warn("Could not get security context for %s",
to_file);
-#endif
freecon(from_context);
return 1;
}
-# $MirOS: contrib/code/jupp/syntax/c.jsf.in,v 1.8 2017/12/02 05:38:05 tg Exp $
+# $MirOS: contrib/code/jupp/syntax/c.jsf.in,v 1.9 2017/12/02 22:24:07 tg Exp $
#-
# JOE syntax highlight file for C and C++
=Idle
=Bad bold red
=Preproc yellow
+=PpCond red
=Define bold blue
=Comment green
=IncLocal cyan
:preident Preproc
* preproc noeat strings
"define" predef
+ "elif" preif
+ "if" preif
+ "ifdef" predef
+ "ifndef" predef
"include" preinc
+ "undef" predef
done
"a-z" preident
* prebad
"\n" reset
-
:predef Preproc
* predef
" \t" predef_ws
* idle noeat
"a-zA-Z0-9_" predef_ident
+:preif Preproc
+ * preif
+ " \t" preif_ws
+ "\n" reset
+
+:preif_ws Preproc
+ * preif_cond recolor=-1
+ " \t" preif_ws
+
+:preif_cond PpCond
+ * preif_cond
+ "\\" preif_cont
+ "/" preif_slash
+ "\n" reset
+
+:preif_slash Preproc
+ * preif_cond noeat
+ "*" comment recolor=-2
+ "/" line_comment recolor=-2
+
+:preif_cont PpCond
+ * preif_cond
:preproc Preproc
* preproc
#include "config.h"
#include "types.h"
-__RCSID("$MirOS: contrib/code/jupp/termcap.c,v 1.17 2017/12/03 02:36:02 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/termcap.c,v 1.18 2017/12/06 16:37:40 tg Exp $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
static unsigned char escape(unsigned char **s)
{
unsigned char c = *(*s)++;
+ int i;
if (c == '^' && **s)
if (**s != '?')
case '5':
case '6':
case '7':
- c -= '0';
- if (**s >= '0' && **s <= '7')
- c = (c << 3) + *((*s)++) - '0';
- if (**s >= '0' && **s <= '7')
- c = (c << 3) + *((*s)++) - '0';
- return c;
+ (*s)--;
+ *s += ustoc_oct(*s, &i, USTOC_MAX);
+ return i;
case 'e':
case 'E':
return 27;
#define _JOE_TTY_H 1
#ifdef EXTERN_CMD_C
-__IDSTRING(rcsid_tty_h, "$MirOS: contrib/code/jupp/tty.h,v 1.10 2017/12/02 17:00:50 tg Exp $");
+__IDSTRING(rcsid_tty_h, "$MirOS: contrib/code/jupp/tty.h,v 1.11 2017/12/04 22:15:39 tg Exp $");
#endif
/* void ttopen(void); Open the tty (attached to stdin) for use inside of JOE
extern int have;
extern int leave;
-#ifdef __MSDOS__
-#define ifhave bioskey(1)
-#else
-#define ifhave have
-#endif
-
/* void ttsig(int n); Signal handler you provide. This is called if the
* editor gets a hangup signal, termination signal or if the input closes.
* It is called with 'n' set to the number of the caught signal or 0 if the
* input closed.
*/
-RETSIGTYPE ttsig PARAMS((int sig))
-#ifdef __GNUC__
- __attribute__((__noreturn__))
-#endif
- ;
+RETSIGTYPE ttsig PARAMS((int sig)) __attribute__((__noreturn__));
/* void ttgtsz(int *x,int *y); Get size of screen from ttsize/winsize
* structure */
#define _JOE_TYPES_H
#ifdef EXTERN
-__IDSTRING(rcsid_types_h, "$MirOS: contrib/code/jupp/types.h,v 1.18 2017/12/02 18:33:25 tg Exp $");
+__IDSTRING(rcsid_types_h, "$MirOS: contrib/code/jupp/types.h,v 1.19 2017/12/04 22:15:39 tg Exp $");
#endif
/* Prefix to make string constants unsigned */
};
/* Each terminal has one of these */
-
-#ifdef __MSDOS__
-
-struct scrn {
- int li; /* Height of screen */
- int co; /* Width of screen */
- short *scrn; /* Buffer */
- int scroll;
- int insdel;
- int *updtab; /* Lines which need to be updated */
- /* HIGHLIGHT_STATE *syntab; */ /* Syntax highlight state at start of each line */
- int *syntab;
- int *compose;
- int *sary;
-};
-
-#else
struct scrn {
CAP *cap; /* Termcap/Terminfo data */
struct hentry *htab;
struct hentry *ary;
};
-#endif
struct sortentry {
#include "config.h"
#include "types.h"
-__RCSID("$MirOS: contrib/code/jupp/ublock.c,v 1.19 2017/12/02 18:50:03 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/ublock.c,v 1.20 2017/12/04 22:15:39 tg Exp $");
#include <unistd.h>
#ifdef HAVE_STDLIB_H
int ufilt(BW *bw)
{
-#ifdef __MSDOS__
- msgnw(bw->parent, "Sorry, no sub-processes in DOS (yet)");
- return -1;
-#else
switch (checkmark(bw)) {
case 0:
if (wmkpw(bw->parent, US "Command to filter block through (^C to abort): ", &filthist, dofilt, NULL, NULL, utypebw, NULL, NULL, locale_map))
msgnw(bw->parent, US "No block");
return -1;
}
-#endif
}
/* Force region to lower case */
#include "config.h"
#include "types.h"
-__RCSID("$MirOS: contrib/code/jupp/uedit.c,v 1.21 2017/12/03 02:36:03 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/uedit.c,v 1.23 2017/12/04 22:15:40 tg Exp $");
#include <string.h>
struct charmap *map=bw->b->o.charmap;
int c = prgetc(p);
- if (joe_isalnum_(map,c)) {
- while (joe_isalnum_(map,(c=prgetc(p))))
+ if (joe_isalnux(map,c)) {
+ while (joe_isalnux(map,(c=prgetc(p))))
/* Do nothing */;
if (c != NO_MORE_DATA)
pgetc(p);
} else if (joe_isspace(map,c) || joe_ispunct(map,c)) {
while ((c=prgetc(p)), (joe_isspace(map,c) || joe_ispunct(map,c)))
/* Do nothing */;
- while(joe_isalnum_(map,(c=prgetc(p))))
+ while(joe_isalnux(map,(c=prgetc(p))))
/* Do nothing */;
if (c != NO_MORE_DATA)
pgetc(p);
int c = brch(p);
int rtn = -1;
- if (joe_isalnum_(map,c)) {
+ if (joe_isalnux(map,c)) {
rtn = 0;
- while (joe_isalnum_(map,(c = brch(p))))
+ while (joe_isalnux(map,(c = brch(p))))
pgetc(p);
} else if (joe_isspace(map,c) || joe_ispunct(map,c)) {
while (joe_isspace(map, (c = brch(p))) || joe_ispunct(map,c))
pgetc(p);
- while (joe_isalnum_(map,(c = brch(p)))) {
+ while (joe_isalnux(map,(c = brch(p)))) {
rtn = 0;
pgetc(p);
}
struct charmap *map=bw->b->o.charmap;
int c = brch(p);
- if (joe_isalnum_(map,c))
- while (joe_isalnum_(map,(c = brch(p))))
+ if (joe_isalnux(map,c))
+ while (joe_isalnux(map,(c = brch(p))))
pgetc(p);
else if (joe_isspace(map,c))
while (joe_isspace(map,(c = brch(p))))
int c = prgetc(bw->cursor);
struct charmap *map=bw->b->o.charmap;
- if (joe_isalnum_(map,c)) {
- while (joe_isalnum_(map,(c = prgetc(bw->cursor))))
+ if (joe_isalnux(map,c)) {
+ while (joe_isalnux(map,(c = prgetc(bw->cursor))))
/* do nothing */;
if (c != NO_MORE_DATA)
pgetc(bw->cursor);
}
bw->cursor->xcol = piscol(bw->cursor);
-#ifndef __MSDOS__
if (x < 0 || x >= bw->w)
simple = 0;
if (bw->cursor->line < bw->top->line || bw->cursor->line >= bw->top->line + bw->h)
atr = INVERSE;
outatr(bw->b->o.charmap, t, screen + x, attr + x, x, y, no_decode == 2 ? 0xFFFD : k, atr);
}
-#endif
}
return 0;
}
#include "config.h"
#include "types.h"
-__RCSID("$MirOS: contrib/code/jupp/uerror.c,v 1.7 2017/12/03 02:36:03 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/uerror.c,v 1.8 2017/12/04 21:53:34 tg Exp $");
#include "b.h"
#include "bw.h"
do {
/* Skip to first word */
- for (x = y; s[x] && !(joe_isalnum_(map,s[x]) || s[x] == '.' || s[x] == '/'); ++x) ;
+ for (x = y; s[x] && !(joe_isalnux(map,s[x]) || s[x] == '.' || s[x] == '/'); ++x) ;
/* Skip to end of first word */
- for (y = x; joe_isalnum_(map,s[y]) || s[y] == '.' || s[y] == '/'; ++y)
+ for (y = x; joe_isalnux(map,s[y]) || s[y] == '.' || s[y] == '/'; ++y)
if (s[y] == '.')
flg = 1;
} while (!flg && x!=y);
#include "config.h"
#include "types.h"
-__RCSID("$MirOS: contrib/code/jupp/usearch.c,v 1.12 2017/12/02 18:50:04 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/usearch.c,v 1.15 2017/12/04 22:00:43 tg Exp $");
#include <stdlib.h>
idx = 0;
while ((c=pgetc(p))!=NO_MORE_DATA)
if (idx) {
- if (joe_isalnum_(b->o.charmap, c)) {
+ if (joe_isalnux(b->o.charmap, c)) {
if (idx!=MAX_WORD_SIZE)
buf[idx++] = c;
} else {
}
} else {
start=p->byte-1;
- if (joe_isalpha_(b->o.charmap, c))
+ if (joe_isalphx(b->o.charmap, c))
buf[idx++] = c;
}
prm(p);
for (t = h->tab[idx];t;t=t->next)
list = vaadd(list, t->name);
if (list)
- vasort(list,sLEN(list));
+ vasort(list,sLEN(list));
htrm(h);
if (!piseol(bw->cursor)) {
c = brch(bw->cursor);
- if (joe_isalnum_(bw->b->o.charmap,c))
+ if (joe_isalnux(bw->b->o.charmap,c))
return;
}
p = pdup(bw->cursor);
do
c = prgetc(p);
- while (joe_isalnum_(bw->b->o.charmap,c));
+ while (joe_isalnux(bw->b->o.charmap,c));
if (c!=NO_MORE_DATA)
pgetc(p);
if (!piseol(bw->cursor)) {
c = brch(bw->cursor);
- if (joe_isalnum_(bw->b->o.charmap,c))
+ if (joe_isalnux(bw->b->o.charmap,c))
return -1;
}
p = pdup(bw->cursor);
do
c = prgetc(p);
- while (joe_isalnum_(bw->b->o.charmap,c));
+ while (joe_isalnux(bw->b->o.charmap,c));
if (c!=NO_MORE_DATA)
pgetc(p);
for (x = 0; x != sLEN(pattern) && pattern[x] != '\\' && (pattern[x]<128 || !p->b->o.charmap->type); ++x)
if (srch->ignore)
pattern[x] = joe_tolower(p->b->o.charmap,pattern[x]);
- wrapped:
+ wrapped:
while (srch->ignore ? pifind(start, pattern, x) : pfind(start, pattern, x)) {
pset(end, start);
pfwrd(end, (long) x);
if (srch->ignore)
pattern[x] = joe_tolower(p->b->o.charmap,pattern[x]);
- wrapped:
+ wrapped:
while (pbkwd(start, 1L)
&& (srch->ignore ? prifind(start, pattern, x) : prfind(start, pattern, x))) {
pset(end, start);
len -= x;
s += x;
} else if (len >= 2) {
- if (((s[1] >= 'a' && s[1] <= 'z') || (s[1] >= 'A' && s[1] <= 'Z'))
- && srch->pieces[(s[1] & 0x1f) - 1]) {
+ if (((s[1] >= 'a' && s[1] <= 'z') || (s[1] >= 'A' && s[1] <= 'Z')) &&
+ srch->pieces[(s[1] & 0x1f) - 1]) {
binsm(p, sv(srch->pieces[(s[1] & 0x1f) - 1]));
pfwrd(p, (long) sLEN(srch->pieces[(s[1] & 0x1f) - 1]));
s += 2;
srch->ignore = icase;
for (x = 0; s[x]; ++x) {
- switch (s[x]) {
+ switch (s[x] | 0x20) {
case 'r':
- case 'R':
srch->replace = 1;
break;
case 'b':
- case 'B':
srch->backwards = 1;
break;
case 'i':
- case 'I':
srch->ignore = 1;
break;
case 's':
- case 'S':
srch->ignore = 0;
break;
case 'k':
- case 'K':
srch->block_restrict = 1;
break;
case '0':
static int dopfrepl(BW *bw, int c, SRCH *srch, int *notify)
{
srch->addr = bw->cursor->byte;
- if (c == 'N' || c == 'n')
+ if ((c | 0x20) == 'n')
return dopfnext(bw, srch, notify);
- else if (c == 'Y' || c == 'y' || c == ' ' || c == 'L' || c == 'l') {
+ else if ((c | 0x20) == 'y' || (c | 0x20) == 'l' || c == ' ') {
srch->recs.link.prev->yn = 1;
/* why do I return -1 on 'L' here? */
- return ((doreplace(bw, srch) || c == 'L' || c == 'l') ?
+ return ((doreplace(bw, srch) || (c | 0x20) == 'l') ?
pfsave(bw, srch) : dopfnext(bw, srch, notify));
- } else if (c == 'R' || c == 'r') {
+ } else if ((c | 0x20) == 'r') {
if (doreplace(bw, srch))
return -1;
srch->rest = 1;
return dopfnext(bw, srch, notify);
- } else if (c == 8 || c == 127 || c == 'b' || c == 'B') {
+ } else if (c == 8 || c == 127 || (c | 0x20) == 'b') {
goback(srch, bw);
goback(srch, bw);
return dopfnext(bw, srch, notify);
{
P *sta;
- next:
+ next:
if (srch->repeat != -1) {
if (!srch->repeat)
return 0;
else
--srch->repeat;
}
- again:if (srch->backwards)
+ again:
+ if (srch->backwards)
sta = searchb(bw, srch, bw->cursor);
else
sta = searchf(bw, srch, bw->cursor);
smode = 2; /* We have started a search mode */
if (srch->replace)
visit(srch, bw, 0);
-again: switch (fnext(bw, srch)) {
+ again:
+ switch (fnext(bw, srch)) {
case 0:
break;
case 1:
-bye: if (!srch->flg && !srch->rest) {
+ bye:
+ if (!srch->flg && !srch->rest) {
if (srch->valid && srch->block_restrict)
msgnw(bw->parent, US "Not found (search restricted to marked block)");
else
int pfnext(BW *bw)
{
- if (!globalsrch) /* Query for search string if there isn't any */
+ SRCH *srch;
+
+ if (!globalsrch) {
+ /* Query for search string if there isn't any */
return pffirst(bw);
- else {
- SRCH *srch = globalsrch;
+ }
- globalsrch = NULL;
- srch->addr = bw->cursor->byte;
- if (!srch->wrap_p || srch->wrap_p->b!=bw->b) {
- prm(srch->wrap_p);
- srch->wrap_p = pdup(bw->cursor);
- srch->wrap_p->owner = &srch->wrap_p;
- srch->wrap_flag = 0;
- }
- srch->valid = 0;
- return dopfnext(bw, setmark(srch), NULL);
+ srch = globalsrch;
+ globalsrch = NULL;
+ srch->addr = bw->cursor->byte;
+ if (!srch->wrap_p || srch->wrap_p->b!=bw->b) {
+ prm(srch->wrap_p);
+ srch->wrap_p = pdup(bw->cursor);
+ srch->wrap_p->owner = &srch->wrap_p;
+ srch->wrap_flag = 0;
}
+ srch->valid = 0;
+ return dopfnext(bw, setmark(srch), NULL);
}
#include "config.h"
#include "types.h"
-__RCSID("$MirOS: contrib/code/jupp/utag.c,v 1.6 2017/12/03 02:36:03 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/utag.c,v 1.7 2017/12/04 21:53:35 tg Exp $");
#include "b.h"
#include "bw.h"
BW *pbw;
pbw = wmkpw(bw->parent, US "Tag search: ", &taghist, dotag, NULL, NULL, cmplt, NULL, NULL, locale_map);
- if (pbw && joe_isalnum_(bw->b->o.charmap,brch(bw->cursor))) {
+ if (pbw && joe_isalnux(bw->b->o.charmap,brch(bw->cursor))) {
P *p = pdup(bw->cursor);
P *q = pdup(p);
int c;
- while (joe_isalnum_(bw->b->o.charmap,(c = prgetc(p))))
+ while (joe_isalnux(bw->b->o.charmap,(c = prgetc(p))))
/* do nothing */;
if (c != NO_MORE_DATA) {
pgetc(p);
}
pset(q, p);
- while (joe_isalnum_(bw->b->o.charmap,(c = pgetc(q))))
+ while (joe_isalnux(bw->b->o.charmap,(c = pgetc(q))))
/* do nothing */;
if (c != NO_MORE_DATA) {
prgetc(q);
*/
#include "config.h"
-__RCSID("$MirOS: contrib/code/jupp/utils.c,v 1.7 2017/12/02 04:32:43 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/utils.c,v 1.8 2017/12/04 21:53:35 tg Exp $");
#include <errno.h>
#ifdef HAVE_UNISTD_H
int parse_ident(unsigned char **pp, unsigned char *buf, int len)
{
unsigned char *p = *pp;
- if (joe_isalpha_(locale_map,*p)) {
- while(len && joe_isalnum_(locale_map,*p))
+ if (joe_isalphx(locale_map,*p)) {
+ while(len && joe_isalnux(locale_map,*p))
*buf++= *p++, --len;
*buf=0;
- while(joe_isalnum_(locale_map,*p))
+ while(joe_isalnux(locale_map,*p))
++p;
*pp = p;
return 0;
unsigned char *p = *pp;
while(*kw && *kw==*p)
++kw, ++p;
- if(!*kw && !joe_isalnum_(locale_map,*p)) {
+ if(!*kw && !joe_isalnux(locale_map,*p)) {
*pp = p;
return 0;
} else
#include "config.h"
#include "types.h"
-__RCSID("$MirOS: contrib/code/jupp/vfile.c,v 1.11 2017/12/02 18:50:04 tg Exp $");
+__RCSID("$MirOS: contrib/code/jupp/vfile.c,v 1.12 2017/12/04 22:15:40 tg Exp $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
{
unsigned char *z = (unsigned char *) joe_malloc(align + size);
- return z + align - physical(z) % align;
+ return z + (align - ((size_t)z % align));
}
unsigned char *vlock(VFILE *vfile, unsigned long addr)
if (!vheaders) {
vheaders = (VPAGE **) joe_malloc((vheadsz = INC) * sizeof(VPAGE *));
vbase = vp->data;
- } else if (physical(vp->data) < physical(vbase)) {
+ } else if ((size_t)vp->data < (size_t)vbase) {
VPAGE **t = vheaders;
- int amnt = (physical(vbase) - physical(vp->data)) >> LPGSIZE;
+ int amnt = (((size_t)vbase) - ((size_t)vp->data)) >> LPGSIZE;
vheaders = (VPAGE **) joe_malloc((amnt + vheadsz) * sizeof(VPAGE *));
mmove(vheaders + amnt, t, vheadsz * sizeof(VPAGE *));
vheadsz += amnt;
vbase = vp->data;
joe_free(t);
- } else if (((physical(vp->data + PGSIZE * INC) - physical(vbase)) >> LPGSIZE) > (unsigned long)vheadsz) {
+ } else if (((((size_t)vp->data + PGSIZE * INC) - ((size_t)vbase)) >> LPGSIZE) > (unsigned long)vheadsz) {
vheaders = (VPAGE **)
- joe_realloc(vheaders, (vheadsz = (((physical(vp->data + PGSIZE * INC) - physical(vbase)) >> LPGSIZE))) * sizeof(VPAGE *));
+ joe_realloc(vheaders, (vheadsz = (((((size_t)vp->data + PGSIZE * INC) - ((size_t)vbase)) >> LPGSIZE))) * sizeof(VPAGE *));
}
for (q = 1; q != INC; ++q) {
vp[q].next = freepages;
#define _JOE_VFILE_H 1
#ifdef EXTERN
-__IDSTRING(rcsid_vfile_h, "$MirOS: contrib/code/jupp/vfile.h,v 1.5 2017/12/02 17:00:52 tg Exp $");
+__IDSTRING(rcsid_vfile_h, "$MirOS: contrib/code/jupp/vfile.h,v 1.6 2017/12/04 22:15:40 tg Exp $");
#endif
/* Additions:
* Return address of page header for given page
*/
-#define vheader(p) (vheaders[(physical((unsigned char *)(p))-physical(vbase))>>LPGSIZE])
+#define vheader(p) (vheaders[(((size_t)(unsigned char *)(p))-((size_t)vbase))>>LPGSIZE])
/* void vchanged(char *);
*