From: mirabilos Date: Sat, 2 Dec 2017 22:10:10 +0000 (+0100) Subject: update from MirBSD CVS X-Git-Tag: jupp-3_1_32~6 X-Git-Url: https://evolvis.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=alioth%2Fjupp.git;a=commitdiff_plain;h=9599499b4c33e1430e553e6b80d55e4d9fcb526c update from MirBSD CVS --- diff --git a/HINTS b/HINTS index ea1eecb..396db99 100644 --- a/HINTS +++ b/HINTS @@ -10,7 +10,6 @@ http://article.gmane.org/gmane.os.miros.cvs/11607 for details. Disable the following warnings; the code doesn't cope with it: -Wno-pointer-sign -Wno-unused-parameter --Wno-missing-field-initializers -Wno-old-style-definition -Wno-strict-prototypes -Wno-cast-qual -Wno-missing-prototypes -Wno-missing-declarations @@ -135,4 +134,4 @@ will not insert. - Search, incremental search, and search & replace all operate as usual. ___________________________________________________________________ -$MirOS: contrib/code/jupp/HINTS,v 1.10 2017/01/11 22:04:31 tg Exp $ +$MirOS: contrib/code/jupp/HINTS,v 1.11 2017/12/02 18:50:01 tg Exp $ diff --git a/Make-w32.sh b/Make-w32.sh index 74a2d79..cb14ea6 100644 --- a/Make-w32.sh +++ b/Make-w32.sh @@ -1,5 +1,5 @@ #!/bin/mksh -# $MirOS: contrib/code/jupp/Make-w32.sh,v 1.14 2017/01/11 21:23:52 tg Exp $ +# $MirOS: contrib/code/jupp/Make-w32.sh,v 1.18 2017/12/02 18:53:37 tg Exp $ usage() { print -ru2 "Usage: $0 [-bCgn]" @@ -25,8 +25,6 @@ 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" extrawarnings="$extrawarnings -Wno-old-style-definition -Wno-strict-prototypes" extrawarnings="$extrawarnings -Wno-cast-qual" extrawarnings="$extrawarnings -Wno-missing-prototypes -Wno-missing-declarations" @@ -50,9 +48,10 @@ typeset -u jWIN=$jwin if (( contb )); then [[ -s mkw32/build/Makefile ]] else - rm -rf mkw32 + rm -rf mkw32 JWIN31$jWIN.* mkdir mkw32{,/{build,$jtop}} fi +date >>JWIN31$jWIN.log cd mkw32/build export CFLAGS='-Os -march=i486 -mtune=pentium-mmx' export CPPFLAGS='-DJUPPRC_BUILTIN_NAME=\"jupp32rc\"' @@ -60,13 +59,12 @@ export CPPFLAGS='-DJUPPRC_BUILTIN_NAME=\"jupp32rc\"' --prefix=c:/windows/system32 \ --sysconfdir=c:/windows/system32 \ --disable-dependency-tracking \ - --disable-curses \ - --disable-termcap \ + --disable-terminfo \ --disable-search-libs \ --disable-getpwnam \ --disable-termidx \ - --enable-win32reloc -make AM_CFLAGS="$extrawarnings" + --enable-win32reloc | tee -a ../../JWIN31$jWIN.log +make AM_CFLAGS="$extrawarnings" | tee -a ../../JWIN31$jWIN.log if (( nopkg )); then ln -f joe.exe jupp.exe ln -sf ../../jupprc . @@ -103,5 +101,5 @@ chmod 444 * cd .. zip -D -X -9 -k ../JWIN31$jWIN.ZIP $jtop/* cd .. -ls -l JWIN31$jWIN.ZIP +ls -l JWIN31$jWIN.* (( nocln )) || rm -rf mkw32 diff --git a/Makefile.bsd-wrapper b/Makefile.bsd-wrapper index af8644c..2db076e 100644 --- a/Makefile.bsd-wrapper +++ b/Makefile.bsd-wrapper @@ -1,4 +1,4 @@ -# $MirOS: contrib/code/jupp/Makefile.bsd-wrapper,v 1.11 2017/12/02 04:33:47 tg Exp $ +# $MirOS: contrib/code/jupp/Makefile.bsd-wrapper,v 1.12 2017/12/02 18:50:01 tg Exp $ #- # make -f Makefile.bsd-wrapper CFPREFIX=/usr/mpkg sysconfjoesubdir=/joe @@ -31,7 +31,6 @@ FSFISLIB= No .ifdef __CRAZY COPTS+= -Wno-unused-parameter \ - -Wno-missing-field-initializers \ -Wno-old-style-definition -Wno-strict-prototypes \ -Wno-cast-qual \ -Wno-missing-prototypes -Wno-missing-declarations diff --git a/TODO b/TODO index e36c215..ba7c2a5 100644 --- a/TODO +++ b/TODO @@ -261,7 +261,7 @@ jstar missing sequences ESC $ insert math result money formatted ESC m Memorandum ESC s isearch fwrd (supposed to be Sincerely) -ESC c compile (supposed to be center line) +ESC c compile (supposed to be center line) — actually ^OC but ncih… ^Q U align paragraph (don't know what this does) ^Q ^Q repeat next command once every second ^Q O spell check entered word @@ -565,7 +565,6 @@ Other requests: • replace all int with size_t where applicable • merge syntax handling code from joe-3.7+ • merge math from joe-3.7+ -• add group support to regex code • make -Wcast-qual clean • write a jupp(1) mdoc page • use mirkev (better code for hashtables) @@ -585,11 +584,8 @@ Other requests: • perhaps wrap at U+00AD? • put all configuration files into /usr/share; use XDG dirs for overriding (HOME, maybe site?) -• 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!) • plug memory leaks (Valgrind reports a few) • … __________________________________________________________________ -$MirOS: contrib/code/jupp/TODO,v 1.40 2017/08/09 01:15:24 tg Exp $ +$MirOS: contrib/code/jupp/TODO,v 1.42 2017/12/02 18:33:24 tg Exp $ diff --git a/autogen.sh b/autogen.sh index fb55c0f..3225dc0 100644 --- a/autogen.sh +++ b/autogen.sh @@ -1,8 +1,8 @@ #!/bin/mksh -# $MirOS: contrib/code/jupp/autogen.sh,v 1.14 2012/06/07 23:38:16 tg Exp $ +# $MirOS: contrib/code/jupp/autogen.sh,v 1.15 2017/12/02 17:13:33 tg Exp $ #- -# Copyright © 2004, 2005, 2006, 2008 -# Thorsten “mirabilos” Glaser +# Copyright © 2004, 2005, 2006, 2008, 2017 +# mirabilos # # Provided that these terms and disclaimer and all copyright notices # are retained or reproduced in an accompanying document, permission @@ -64,6 +64,6 @@ if autoconf; then else (( rv = rv ? rv : 1 )) fi -rm -rf autom4te.cache +rm -rf autom4te.cache *~ find . -type l -print0 | xargs -0 rm exit $rv diff --git a/b.c b/b.c index 6b68d54..05cbe9e 100644 --- a/b.c +++ b/b.c @@ -9,7 +9,7 @@ #include "config.h" #include "types.h" -__RCSID("$MirOS: contrib/code/jupp/b.c,v 1.18 2017/12/02 04:32:37 tg Exp $"); +__RCSID("$MirOS: contrib/code/jupp/b.c,v 1.19 2017/12/02 18:50:02 tg Exp $"); #include #include @@ -116,8 +116,8 @@ static void grmem(H *hdr, unsigned char *ptr, int ofst, unsigned char *blk, int } -static H nhdrs = { {&nhdrs, &nhdrs} }; -static H ohdrs = { {&ohdrs, &ohdrs} }; +static H nhdrs = { {&nhdrs, &nhdrs}, 0, 0, 0, 0 }; +static H ohdrs = { {&ohdrs, &ohdrs}, 0, 0, 0, 0 }; /* Header allocation */ static H *halloc(void) @@ -147,7 +147,7 @@ static void hfreechn(H *h) } -static P frptrs = { {&frptrs, &frptrs} }; +static P frptrs = { {&frptrs, &frptrs}, NULL, 0, 0, NULL, 0, 0, 0, 0, 0, 0, NULL }; /* Pointer allocation */ static P *palloc(void) @@ -161,8 +161,8 @@ static void pfree(P *p) } /* Doubly linked list of buffers and free buffer structures */ -static B bufs = { {&bufs, &bufs} }; -static B frebufs = { {&frebufs, &frebufs} }; +static B bufs = { {&bufs, &bufs}, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 }, NULL, NULL, 0, 0, 0, 0, 0, 0 }; +static B frebufs = { {&frebufs, &frebufs}, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 }, NULL, NULL, 0, 0, 0, 0, 0, 0 }; B *bnext(void) { diff --git a/b.h b/b.h index 377c740..2d20b58 100644 --- a/b.h +++ b/b.h @@ -9,7 +9,7 @@ #define _JOE_B_H 1 #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/b.h,v 1.5 2017/12/02 02:07:23 tg Exp $"); +__IDSTRING(rcsid_b_h, "$MirOS: contrib/code/jupp/b.h,v 1.6 2017/12/02 17:00:47 tg Exp $"); #endif /* 31744 */ diff --git a/blocks.h b/blocks.h index e71b241..3e81d5c 100644 --- a/blocks.h +++ b/blocks.h @@ -9,7 +9,7 @@ #define _JOE_BLOCKS_H 1 #ifdef EXTERN_B_C -__RCSID("$MirOS: contrib/code/jupp/blocks.h,v 1.5 2017/12/02 02:07:23 tg Exp $"); +__IDSTRING(rcsid_blocks_h, "$MirOS: contrib/code/jupp/blocks.h,v 1.6 2017/12/02 17:00:48 tg Exp $"); #endif /* char *mmove(char *d,char *s,int sz); Copy 'sz' bytes from 's' to 'd'. diff --git a/builtin.h b/builtin.h index 0777584..5a83d7c 100644 --- a/builtin.h +++ b/builtin.h @@ -1,5 +1,5 @@ #ifdef EXTERN_RC_C -__RCSID("$MirOS: contrib/code/jupp/builtin.h,v 1.3 2017/12/02 02:07:23 tg Exp $"); +__IDSTRING(rcsid_builtin_h, "$MirOS: contrib/code/jupp/builtin.h,v 1.4 2017/12/02 17:00:48 tg Exp $"); #endif /* Support for built-in config files */ diff --git a/bw.h b/bw.h index efca6af..78bc672 100644 --- a/bw.h +++ b/bw.h @@ -9,7 +9,7 @@ #define _JOE_BW_H 1 #ifdef EXTERN_CMD_C -__RCSID("$MirOS: contrib/code/jupp/bw.h,v 1.5 2017/12/02 02:07:24 tg Exp $"); +__IDSTRING(rcsid_bw_h, "$MirOS: contrib/code/jupp/bw.h,v 1.6 2017/12/02 17:00:48 tg Exp $"); #endif extern int dspasis; diff --git a/charmap.h b/charmap.h index 8711803..e3a9598 100644 --- a/charmap.h +++ b/charmap.h @@ -10,7 +10,7 @@ #define _Icharmap 1 #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/charmap.h,v 1.8 2017/12/02 04:32:39 tg Exp $"); +__IDSTRING(rcsid_charmap_h, "$MirOS: contrib/code/jupp/charmap.h,v 1.9 2017/12/02 17:00:48 tg Exp $"); #endif /* For sorted from_map entries */ diff --git a/cmd.h b/cmd.h index 9cf1851..e6e7511 100644 --- a/cmd.h +++ b/cmd.h @@ -9,7 +9,7 @@ #define _JOE_CMD_H 1 #ifdef EXTERN_CMD_C -__RCSID("$MirOS: contrib/code/jupp/cmd.h,v 1.5 2017/12/02 02:07:25 tg Exp $"); +__IDSTRING(rcsid_cmd_h, "$MirOS: contrib/code/jupp/cmd.h,v 1.6 2017/12/02 17:00:48 tg Exp $"); #endif extern CMD cmds[]; /* Built-in commands */ diff --git a/compat.c b/compat.c index 3e5035f..f3124b1 100644 --- a/compat.c +++ b/compat.c @@ -30,7 +30,7 @@ #include "config.h" #include "types.h" -__RCSID("$MirOS: contrib/code/jupp/compat.c,v 1.8 2017/12/02 04:32:39 tg Exp $"); +__RCSID("$MirOS: contrib/code/jupp/compat.c,v 1.9 2017/12/02 17:00:53 tg Exp $"); #include #include @@ -45,6 +45,8 @@ __RCSID("$MirOS: contrib/code/jupp/compat.c,v 1.8 2017/12/02 04:32:39 tg Exp $") #define L_strlcpy #endif #if defined(L_strlcat) || defined(L_strlcpy) +#undef __RCSID +#define __RCSID(x) __IDSTRING(rcsid_strlfun_inc,x) #define OUTSIDE_OF_LIBKERN #include "strlfun.inc" #endif @@ -201,6 +203,8 @@ joe_timet2tm(joe_tm *tm, const time_t *tp) #endif /* ndef HAVE_CTIME */ #ifndef HAVE_POPEN +#undef __RCSID +#define __RCSID(x) __IDSTRING(rcsid_popen_inc,x) #include "popen.inc" #endif diff --git a/config.h b/config.h index 4b95f86..59f0f21 100644 --- a/config.h +++ b/config.h @@ -157,7 +157,7 @@ size_t strlcpy(char *, const char *, size_t) #endif #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/config.h,v 1.9 2017/12/02 02:07:26 tg Exp $"); +__IDSTRING(rcsid_config_h, "$MirOS: contrib/code/jupp/config.h,v 1.10 2017/12/02 17:00:48 tg Exp $"); #endif #endif /* ifndef _JOE_CONFIG_H */ diff --git a/configure b/configure index 3a5a06a..3ff9467 100644 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61-MirPorts-2 for joe 3.1jupp31. +# Generated by GNU Autoconf 2.61-MirPorts-2 for joe 3.1jupp31dev. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -572,8 +572,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='joe' PACKAGE_TARNAME='joe' -PACKAGE_VERSION='3.1jupp31' -PACKAGE_STRING='joe 3.1jupp31' +PACKAGE_VERSION='3.1jupp31dev' +PACKAGE_STRING='joe 3.1jupp31dev' PACKAGE_BUGREPORT='' ac_unique_file="b.c" @@ -1231,7 +1231,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures joe 3.1jupp31 to adapt to many kinds of systems. +\`configure' configures joe 3.1jupp31dev to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1302,7 +1302,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of joe 3.1jupp31:";; + short | recursive ) echo "Configuration of joe 3.1jupp31dev:";; esac cat <<\_ACEOF @@ -1315,6 +1315,7 @@ Optional Features: --enable-dependency-tracking do not reject slow dependency extractors --disable-curses disable use of curses library --disable-termcap disable use of termcap library + --disable-terminfo disable use of terminfo functions --disable-search-libs do not search in any external libraries --disable-getpwnam disable use of getpwnam function --disable-termidx do not build the termidx binary @@ -1397,7 +1398,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -joe configure 3.1jupp31 +joe configure 3.1jupp31dev generated by GNU Autoconf 2.61-MirPorts-2 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1411,7 +1412,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by joe $as_me 3.1jupp31, which was +It was created by joe $as_me 3.1jupp31dev, which was generated by GNU Autoconf 2.61-MirPorts-2. Invocation command line was $ $0 $@ @@ -2212,7 +2213,7 @@ fi # Define the identity of the package. PACKAGE='joe' - VERSION='3.1jupp31' + VERSION='3.1jupp31dev' cat >>confdefs.h <<_ACEOF @@ -3998,7 +3999,7 @@ else fi test x"$curses" = x"yes" && \ - search_libs_term="$search_libs_term tinfo ncurses curses" + search_libs_term="$search_libs_term tinfo ncursesw ncurses curses" # Check whether --enable-termcap was given. if test "${enable_termcap+set}" = set; then @@ -4010,6 +4011,14 @@ fi test x"$termcap" = x"yes" && \ search_libs_term="$search_libs_term termcap" +# Check whether --enable-terminfo was given. +if test "${enable_terminfo+set}" = set; then + enableval=$enable_terminfo; terminfo=$enableval +else + terminfo=yes +fi + + # Check whether --enable-search_libs was given. if test "${enable_search_libs+set}" = set; then enableval=$enable_search_libs; search_libs=$enableval @@ -4200,7 +4209,10 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking for library containing tgetflag" >&5 +if test x"$terminfo" = x"no"; then + echo "DISabling looking for terminal libraries entirely!" +else + { echo "$as_me:$LINENO: checking for library containing tgetflag" >&5 echo $ECHO_N "checking for library containing tgetflag... $ECHO_C" >&6; } if test "${ac_cv_search_tgetflag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4287,6 +4299,7 @@ _ACEOF fi +fi { echo "$as_me:$LINENO: checking for library containing snprintf" >&5 echo $ECHO_N "checking for library containing snprintf... $ECHO_C" >&6; } if test "${ac_cv_search_snprintf+set}" = set; then @@ -11126,7 +11139,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by joe $as_me 3.1jupp31, which was +This file was extended by joe $as_me 3.1jupp31dev, which was generated by GNU Autoconf 2.61-MirPorts-2. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -11179,7 +11192,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -joe config.status 3.1jupp31 +joe config.status 3.1jupp31dev configured by $0, generated by GNU Autoconf 2.61-MirPorts-2, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index c95b309..9935c47 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $MirOS: contrib/code/jupp/configure.ac,v 1.59 2017/12/02 04:15:29 tg Exp $ +# $MirOS: contrib/code/jupp/configure.ac,v 1.61 2017/12/02 05:26:39 tg Exp $ #- # Process this file with autoconf to produce a configure script. @@ -6,7 +6,7 @@ AC_PREREQ(2.54) #### Here's the only place where to change version number #### -AC_INIT(joe, 3.1jupp31) +AC_INIT(joe, 3.1jupp31dev) #### But see main.c for the Copyright (c) owner and year! #### AC_CONFIG_SRCDIR([b.c]) @@ -53,7 +53,7 @@ AC_ARG_ENABLE(curses, [ --disable-curses disable use of curses library], curses=$enableval, curses=yes) test x"$curses" = x"yes" && \ - search_libs_term="$search_libs_term tinfo ncurses curses" + search_libs_term="$search_libs_term tinfo ncursesw ncurses curses" AC_ARG_ENABLE(termcap, [ --disable-termcap disable use of termcap library], @@ -61,6 +61,10 @@ AC_ARG_ENABLE(termcap, test x"$termcap" = x"yes" && \ search_libs_term="$search_libs_term termcap" +AC_ARG_ENABLE(terminfo, +[ --disable-terminfo disable use of terminfo functions], + terminfo=$enableval, terminfo=yes) + AC_ARG_ENABLE([search_libs], [ --disable-search-libs do not search in any external libraries], search_libs=$enableval, search_libs=yes) @@ -74,7 +78,11 @@ fi AC_SEARCH_LIBS(openpty, $search_libs_util, AC_DEFINE_UNQUOTED(HAVE_OPENPTY, 1, [If we have BSD function openpty()])) AC_SEARCH_LIBS(login_tty, $search_libs_util, AC_DEFINE_UNQUOTED(HAVE_LOGIN_TTY, 1, [If we have BSD function login_tty()])) -AC_SEARCH_LIBS(tgetflag, $search_libs_term, AC_DEFINE_UNQUOTED(TERMINFO, 1, [If we have newer terminfo/termcap capabilities])) +if test x"$terminfo" = x"no"; then + echo "DISabling looking for terminal libraries entirely!" +else + 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])) diff --git a/hash.h b/hash.h index d35f6be..84935b8 100644 --- a/hash.h +++ b/hash.h @@ -9,7 +9,7 @@ #define _JOE_HASH_H 1 #ifdef EXTERN_CMD_C -__RCSID("$MirOS: contrib/code/jupp/hash.h,v 1.3 2017/12/02 02:07:26 tg Exp $"); +__IDSTRING(rcsid_hash_h, "$MirOS: contrib/code/jupp/hash.h,v 1.4 2017/12/02 17:00:48 tg Exp $"); #endif unsigned long hash PARAMS((unsigned char *s)); diff --git a/help.h b/help.h index 3ba3bc6..bd67638 100644 --- a/help.h +++ b/help.h @@ -10,7 +10,7 @@ #define _JOE_HELP_H 1 #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/help.h,v 1.5 2017/12/02 02:07:26 tg Exp $"); +__IDSTRING(rcsid_help_h, "$MirOS: contrib/code/jupp/help.h,v 1.6 2017/12/02 17:00:48 tg Exp $"); #endif extern struct help *help_actual; diff --git a/i18n.c b/i18n.c index 2682d05..4dc188e 100644 --- a/i18n.c +++ b/i18n.c @@ -21,7 +21,7 @@ #include #endif -__RCSID("$MirOS: contrib/code/jupp/i18n.c,v 1.26 2017/12/02 04:32:39 tg Exp $"); +__RCSID("$MirOS: contrib/code/jupp/i18n.c,v 1.27 2017/12/02 18:50:02 tg Exp $"); #include "charmap.h" @@ -6935,7 +6935,6 @@ CPPFLAGS+= -DTEST -DTEST_I18N .ifdef __CRAZY COPTS+= -Wno-unused-parameter \ - -Wno-missing-field-initializers \ -Wno-old-style-definition -Wno-strict-prototypes \ -Wno-cast-qual \ -Wno-missing-prototypes -Wno-missing-declarations diff --git a/i18n.h b/i18n.h index 12e0693..238dd16 100644 --- a/i18n.h +++ b/i18n.h @@ -2,7 +2,7 @@ #define _Ii18n 1 #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/i18n.h,v 1.9 2017/12/02 02:07:28 tg Exp $"); +__IDSTRING(rcsid_i18n_h, "$MirOS: contrib/code/jupp/i18n.h,v 1.10 2017/12/02 17:00:48 tg Exp $"); #endif #ifdef TEST_I18N diff --git a/kbd.h b/kbd.h index 0e9f62a..c40a2fc 100644 --- a/kbd.h +++ b/kbd.h @@ -9,7 +9,7 @@ #define _JOE_KBD_H 1 #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/kbd.h,v 1.3 2017/12/02 02:07:28 tg Exp $"); +__IDSTRING(rcsid_kbd_h, "$MirOS: contrib/code/jupp/kbd.h,v 1.4 2017/12/02 17:00:49 tg Exp $"); #endif /* KMAP *mkkmap(void); diff --git a/macro.h b/macro.h index 7e152de..aec3aaa 100644 --- a/macro.h +++ b/macro.h @@ -9,7 +9,7 @@ #define _JOE_MACRO_H 1 #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/macro.h,v 1.3 2017/12/02 02:07:28 tg Exp $"); +__IDSTRING(rcsid_macro_h, "$MirOS: contrib/code/jupp/macro.h,v 1.4 2017/12/02 17:00:49 tg Exp $"); #endif /* Set when macro is recording: for status line */ diff --git a/main.h b/main.h index ff17805..1d9a55e 100644 --- a/main.h +++ b/main.h @@ -9,7 +9,7 @@ #define _JOE_MAIN_H 1 #ifdef EXTERN_B_C -__RCSID("$MirOS: contrib/code/jupp/main.h,v 1.4 2017/12/02 02:07:29 tg Exp $"); +__IDSTRING(rcsid_main_h, "$MirOS: contrib/code/jupp/main.h,v 1.5 2017/12/02 17:00:49 tg Exp $"); #endif extern const char null[]; diff --git a/menu.h b/menu.h index f3a35c6..a0a6d70 100644 --- a/menu.h +++ b/menu.h @@ -9,7 +9,7 @@ #define _JOE_MENU_H 1 #ifdef EXTERN_CMD_C -__RCSID("$MirOS: contrib/code/jupp/menu.h,v 1.3 2017/12/02 02:07:29 tg Exp $"); +__IDSTRING(rcsid_menu_h, "$MirOS: contrib/code/jupp/menu.h,v 1.4 2017/12/02 17:00:49 tg Exp $"); #endif /* Create a menu */ diff --git a/path.h b/path.h index 5c0f3cc..892b712 100644 --- a/path.h +++ b/path.h @@ -9,7 +9,7 @@ #define _JOE_PATH_H 1 #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/path.h,v 1.12 2017/12/02 02:07:29 tg Exp $"); +__IDSTRING(rcsid_path_h, "$MirOS: contrib/code/jupp/path.h,v 1.13 2017/12/02 17:00:49 tg Exp $"); #endif #if defined(__MSDOS__) || defined(__DJGPP__) || defined(__EMX__) || \ diff --git a/poshist.c b/poshist.c index 39f92e0..13ed012 100644 --- a/poshist.c +++ b/poshist.c @@ -8,7 +8,7 @@ #include "config.h" #include "types.h" -__RCSID("$MirOS: contrib/code/jupp/poshist.c,v 1.3 2017/12/02 02:07:29 tg Exp $"); +__RCSID("$MirOS: contrib/code/jupp/poshist.c,v 1.4 2017/12/02 18:50:03 tg Exp $"); #ifdef HAVE_STDLIB_H #include @@ -26,8 +26,8 @@ struct pos { W *w; }; -POS pos = { {&pos, &pos} }; -POS frpos = { {&frpos, &frpos} }; +POS pos = { {&pos, &pos}, NULL, NULL }; +POS frpos = { {&frpos, &frpos}, NULL, NULL }; POS *curpos = &pos; int npos = 0; diff --git a/poshist.h b/poshist.h index ace163c..1e956c3 100644 --- a/poshist.h +++ b/poshist.h @@ -9,7 +9,7 @@ #define _JOE_POSHIST_H 1 #ifdef EXTERN_CMD_C -__RCSID("$MirOS: contrib/code/jupp/poshist.h,v 1.3 2017/12/02 02:07:29 tg Exp $"); +__IDSTRING(rcsid_poshist_h, "$MirOS: contrib/code/jupp/poshist.h,v 1.4 2017/12/02 17:00:49 tg Exp $"); #endif void afterpos PARAMS((void)); diff --git a/pw.h b/pw.h index 0181b08..81b325d 100644 --- a/pw.h +++ b/pw.h @@ -9,7 +9,7 @@ #define _JOE_PW_H 1 #ifdef EXTERN_CMD_C -__RCSID("$MirOS: contrib/code/jupp/pw.h,v 1.5 2017/12/02 02:07:30 tg Exp $"); +__IDSTRING(rcsid_pw_h, "$MirOS: contrib/code/jupp/pw.h,v 1.6 2017/12/02 17:00:49 tg Exp $"); #endif /* BW *wmkpw(BW *bw,char *prompt,int (*func)(),char *huh,int (*abrt)(), diff --git a/queue.h b/queue.h index 72bfc3e..28da99a 100644 --- a/queue.h +++ b/queue.h @@ -9,7 +9,7 @@ #define _JOE_QUEUE 1 #ifdef EXTERN_B_C -__RCSID("$MirOS: contrib/code/jupp/queue.h,v 1.3 2017/12/02 02:07:30 tg Exp $"); +__IDSTRING(rcsid_queue_h, "$MirOS: contrib/code/jupp/queue.h,v 1.4 2017/12/02 17:00:49 tg Exp $"); #endif extern void *ITEM; diff --git a/qw.h b/qw.h index 7f5418d..293c978 100644 --- a/qw.h +++ b/qw.h @@ -9,7 +9,7 @@ #define _JOE_QW_H 1 #ifdef EXTERN_UFILE_C -__RCSID("$MirOS: contrib/code/jupp/qw.h,v 1.3 2017/12/02 02:07:30 tg Exp $"); +__IDSTRING(rcsid_qw_h, "$MirOS: contrib/code/jupp/qw.h,v 1.4 2017/12/02 17:00:49 tg Exp $"); #endif /* QW *mkqw(W *w, char *prompt, int (*func)(), int (*abrt)(), void *object); diff --git a/rc.c b/rc.c index 8bdb1e1..a247727 100644 --- a/rc.c +++ b/rc.c @@ -1,7 +1,7 @@ /* * *rc file parser * Copyright - * (C) 1992 Joseph H. Allen; + * (C) 1992 Joseph H. Allen; * * This file is part of JOE (Joe's Own Editor) */ @@ -9,7 +9,7 @@ #include "config.h" #include "types.h" -__RCSID("$MirOS: contrib/code/jupp/rc.c,v 1.26 2017/12/02 04:32:41 tg Exp $"); +__RCSID("$MirOS: contrib/code/jupp/rc.c,v 1.28 2017/12/02 18:33:24 tg Exp $"); #include #ifdef HAVE_STDLIB_H @@ -222,83 +222,99 @@ void setopt(B *b, unsigned char *parsed_name) /* local means it's in an OPTION structure, global means it's in a global * variable */ +#define F(x) NULL, &fdefault.x +#define G(type,name,setiaddr,yes,no,menu,low,high) \ + X(type,name,setiaddr,yes,no,menu,low,high) +#define X(type,name,seti,addr,yes,no,menu,low,high) \ + { UC name, { seti }, US addr, UC yes, UC no, UC menu, type, 0, low, high } +#define L(x) &x, NULL struct glopts { - unsigned char *name; /* Option name */ - int type; /* 0 for global option flag + const unsigned char *name; /* Option name */ + union { + int *i; + unsigned char **us; + } set; /* Address of global option */ + unsigned char *addr; /* Local options structure member address */ + const unsigned char *yes; /* Message if option was turned on, or prompt string */ + const unsigned char *no; /* Message if option was turned off */ + const unsigned char *menu; /* Menu string */ + int type; /* 0 for global option flag 1 for global option numeric 2 for global option string 4 for local option flag 5 for local option numeric 6 for local option string 7 for local option numeric+1, with range checking + 8 for ...? + 9 for syntax + 13 for encoding */ - int *set; /* Address of global option */ - unsigned char *addr; /* Local options structure member address */ - unsigned char *yes; /* Message if option was turned on, or prompt string */ - unsigned char *no; /* Message if option was turned off */ - unsigned char *menu; /* Menu string */ int ofst; /* Local options structure member offset */ int low; /* Low limit for numeric options */ int high; /* High limit for numeric options */ } glopts[] = { - {US "noxon", 0, &noxon, NULL, US "XON/XOFF processing disabled", US "XON/XOFF processing enabled", US " XON/XOFF usable " }, - {US "keepup", 0, &keepup, NULL, US "Status line updated constantly", US "Status line updated once/sec", US " Fast status line " }, - {US "baud", 1, &Baud, NULL, US "Terminal baud rate (%d): ", 0, US " Baud rate ", 0, 0, 38400 }, - {US "overwrite",4, NULL, (unsigned char *) &fdefault.overtype, US "Overtype mode", US "Insert mode", US "T Overtype " }, - {US "autoindent", 4, NULL, (unsigned char *) &fdefault.autoindent, US "Autoindent enabled", US "Autoindent disabled", US "I Autoindent " }, - {US "wordwrap", 4, NULL, (unsigned char *) &fdefault.wordwrap, US "Wordwrap enabled", US "Wordwrap disabled", US "Word wrap " }, - {US "tab", 5, NULL, (unsigned char *) &fdefault.tab, US "Tab width (%d): ", 0, US "D Tab width ", 0, 1, 64 }, - {US "lmargin", 7, NULL, (unsigned char *) &fdefault.lmargin, US "Left margin (%d): ", 0, US "Left margin ", 0, 0, 63 }, - {US "rmargin", 7, NULL, (unsigned char *) &fdefault.rmargin, US "Right margin (%d): ", 0, US "Right margin ", 0, 7, 255 }, - {US "square", 0, &square, NULL, US "Rectangle mode", US "Text-stream mode", US "X Rectangle mode " }, - {US "icase", 0, &icase, NULL, US "Ignore case by default", US "Case sensitive by default", US " Case insensitive " }, - {US "wrap", 0, &wrap, NULL, US "Search wraps", US "Search doesn't wrap", US " Search wraps " }, - {US "menu_explorer", 0, &menu_explorer, NULL, US "Menu explorer mode", US " Simple completion", US " Menu explorer " }, - {US "autoswap", 0, &autoswap, NULL, US "Autoswap ^KB and ^KK", US " Autoswap off ", US " Autoswap mode " }, - {US "indentc", 5, NULL, (unsigned char *) &fdefault.indentc, US "Indent char %d (SPACE=32, TAB=9, ^C to abort): ", 0, US " Indent char ", 0, 0, 255 }, - {US "istep", 5, NULL, (unsigned char *) &fdefault.istep, US "Indent step %d (^C to abort): ", 0, US " Indent step ", 0, 1, 64 }, - {US "french", 4, NULL, (unsigned char *) &fdefault.french, US "One space after periods for paragraph reformat", US "Two spaces after periods for paragraph reformat", US " French spacing " }, - {US "highlight", 4, NULL, (unsigned char *) &fdefault.highlight, US "Highlighting enabled", US "Highlighting disabled", US "Highlighting " }, - {US "spaces", 4, NULL, (unsigned char *) &fdefault.spaces, US "Inserting spaces when tab key is hit", US "Inserting tabs when tab key is hit", US " Disable tabs " }, - {US "mid", 0, &mid, NULL, US "Cursor will be recentered on scrolls", US "Cursor will not be recentered on scroll", US "Center on scroll " }, - {US "guess_crlf",0, &guesscrlf, NULL, US "Automatically detect MS-DOS files", US "Do not automatically detect MS-DOS files", US " Auto detect CR-LF " }, - {US "guess_indent",0, &guessindent, NULL, US "Automatically detect indentation", US "Do not automatically detect indentation", US " Guess indent " }, - {US "crlf", 4, NULL, (unsigned char *) &fdefault.crlf, US "CR-LF is line terminator", US "LF is line terminator", US "Z CR-LF (MS-DOS) " }, - {US "linums", 4, NULL, (unsigned char *) &fdefault.linums, US "Line numbers enabled", US "Line numbers disabled", US "N Line numbers " }, - {US "marking", 0, &marking, NULL, US "Anchored block marking on", US "Anchored block marking off", US "Marking " }, - {US "asis", 0, &dspasis, NULL, US "Characters above 127 shown as-is", US "Characters above 127 shown in inverse", US " Meta chars as-is " }, - {US "force", 0, &force, NULL, US "Last line forced to have NL when file saved", US "Last line not forced to have NL", US "Force last NL " }, - {US "nobackups", 0, &nobackups, NULL, US "Backup files will not be made", US "Backup files will be made", US " Disable backups " }, - {US "lightoff", 0, &lightoff, NULL, US "Highlighting turned off after block operations", US "Highlighting not turned off after block operations", US "Auto unmark " }, - {US "exask", 0, &exask, NULL, US "Prompt for filename in save & exit command", US "Don't prompt for filename in save & exit command", US " Exit ask " }, - {US "beep", 0, &dobeep, NULL, US "Warning bell enabled", US "Warning bell disabled", US "Beeps " }, - {US "nosta", 0, &staen, NULL, US "Top-most status line disabled", US "Top-most status line enabled", US " Disable status " }, - {US "pg", 1, &pgamnt, NULL, US "Lines to keep for PgUp/PgDn or -1 for 1/2 window (%d): ", 0, US " # PgUp/PgDn lines ", 0, -1, 64 }, - {US "csmode", 0, &csmode, NULL, US "Start search after a search repeats previous search", US "Start search always starts a new search", US "Continued search " }, - {US "rdonly", 4, NULL, (unsigned char *) &fdefault.readonly, US "Read only", US "Full editing", US "O Read only " }, - {US "smarthome", 4, NULL, (unsigned char *) &fdefault.smarthome, US "Smart home key enabled", US "Smart home key disabled", US " Smart home key " }, - {US "indentfirst", 4, NULL, (unsigned char *) &fdefault.indentfirst, US "Smart home goes to indent first", US "Smart home goes home first", US " To indent first " }, - {US "smartbacks", 4, NULL, (unsigned char *) &fdefault.smartbacks, US "Smart backspace key enabled", US "Smart backspace key disabled", US " Smart backspace " }, - {US "purify", 4, NULL, (unsigned char *) &fdefault.purify, US "Indentation clean up enabled", US "Indentation clean up disabled", US " Clean up indents " }, - {US "picture", 4, NULL, (unsigned char *) &fdefault.picture, US "Picture drawing mode enabled", US "Picture drawing mode disabled", US "Picture mode " }, - {US "backpath", 2, (int *) &backpath, NULL, US "Backup files stored in (%s): ", 0, US " Backup file path " }, - {US "vispace", 4, NULL, (unsigned char *) &fdefault.vispace, US "Spaces visible", US "Spaces invisible", US "Visible spaces " }, - {US "hex", 4, NULL, (unsigned char *) &fdefault.hex, US "Hex edit mode", US "Text edit mode", US "G Hexedit mode "}, - {US "syntax", 9, NULL, NULL, US "Select syntax (%s; ^C to abort): ", 0, US "Y Syntax" }, - {US "encoding",13, NULL, NULL, US "Select file character set (%s; ^C to abort): ", 0, US "Encoding " }, - {US "nonotice", 0, &nonotice, NULL, 0, 0, 0 }, - {US "orphan", 0, &orphan, NULL, 0, 0, 0 }, - {US "help", 0, &help, NULL, 0, 0, 0 }, - {US "dopadding", 0, &dopadding, NULL, 0, 0, 0 }, - {US "lines", 1, &lines, NULL, 0, 0, 0, 0, 2, 1024 }, - {US "columns", 1, &columns, NULL, 0, 0, 0, 0, 2, 1024 }, - {US "skiptop", 1, &skiptop, NULL, 0, 0, 0, 0, 0, 64 }, - {US "notite", 0, ¬ite, NULL, 0, 0, 0 }, - {US "pastetite", 0, &pastetite, NULL, 0, 0, 0 }, - {US "usetabs", 0, &usetabs, NULL, 0, 0, 0 }, - {US "assume_color", 0, &assume_color, NULL, 0, 0, 0 }, - { NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 } +G( 0, "noxon", L(noxon), "XON/XOFF processing disabled", "XON/XOFF processing enabled", " XON/XOFF usable ", 0, 0), +G( 0, "keepup", L(keepup), "Status line updated constantly", "Status line updated once/sec", " Fast status line ", 0, 0), +G( 1, "baud", L(Baud), "Terminal baud rate (%d): ", NULL, " Baud rate ", 0, 38400), +G( 4, "overwrite", F(overtype), "Overtype mode", "Insert mode", "T Overtype ", 0, 0), +G( 4, "autoindent", F(autoindent), "Autoindent enabled", "Autoindent disabled", "I Autoindent ", 0, 0), +G( 4, "wordwrap", F(wordwrap), "Wordwrap enabled", "Wordwrap disabled", "Word wrap ", 0, 0), +G( 5, "tab", F(tab), "Tab width (%d): ", NULL, "D Tab width ", 1, 64), +G( 7, "lmargin", F(lmargin), "Left margin (%d): ", NULL, "Left margin ", 0, 63), +G( 7, "rmargin", F(rmargin), "Right margin (%d): ", NULL, "Right margin ", 7, 255), +G( 0, "square", L(square), "Rectangle mode", "Text-stream mode", "X Rectangle mode ", 0, 0), +G( 0, "icase", L(icase), "Ignore case by default", "Case sensitive by default", " Case insensitive ", 0, 0), +G( 0, "wrap", L(wrap), "Search wraps", "Search doesn't wrap", " Search wraps ", 0, 0), +G( 0, "menu_explorer", L(menu_explorer), "Menu explorer mode", " Simple completion", " Menu explorer ", 0, 0), +G( 0, "autoswap", L(autoswap), "Autoswap ^KB and ^KK", " Autoswap off ", " Autoswap mode ", 0, 0), +G( 5, "indentc", F(indentc), "Indent char %d (SPACE=32, TAB=9, ^C to abort): ", NULL, " Indent char ", 0, 255), +G( 5, "istep", F(istep), "Indent step %d (^C to abort): ", NULL, " Indent step ", 1, 64), +G( 4, "french", F(french), "One space after periods for paragraph reformat", "Two spaces after periods for paragraph reformat", " French spacing ", 0, 0), +G( 4, "highlight", F(highlight), "Highlighting enabled", "Highlighting disabled", "Highlighting ", 0, 0), +G( 4, "spaces", F(spaces), "Inserting spaces when tab key is hit", "Inserting tabs when tab key is hit", " Disable tabs ", 0, 0), +G( 0, "mid", L(mid), "Cursor will be recentered on scrolls", "Cursor will not be recentered on scroll", "Center on scroll ", 0, 0), +G( 0, "guess_crlf", L(guesscrlf), "Automatically detect MS-DOS files", "Do not automatically detect MS-DOS files", " Auto detect CR-LF ", 0, 0), +G( 0, "guess_indent", L(guessindent), "Automatically detect indentation", "Do not automatically detect indentation", " Guess indent ", 0, 0), +G( 4, "crlf", F(crlf), "CR-LF is line terminator", "LF is line terminator", "Z CR-LF (MS-DOS) ", 0, 0), +G( 4, "linums", F(linums), "Line numbers enabled", "Line numbers disabled", "N Line numbers ", 0, 0), +G( 0, "marking", L(marking), "Anchored block marking on", "Anchored block marking off", "Marking ", 0, 0), +G( 0, "asis", L(dspasis), "Characters above 127 shown as-is", "Characters above 127 shown in inverse", " Meta chars as-is ", 0, 0), +G( 0, "force", L(force), "Last line forced to have NL when file saved", "Last line not forced to have NL", "Force last NL ", 0, 0), +G( 0, "nobackups", L(nobackups), "Backup files will not be made", "Backup files will be made", " Disable backups ", 0, 0), +G( 0, "lightoff", L(lightoff), "Highlighting turned off after block operations", "Highlighting not turned off after block operations", "Auto unmark ", 0, 0), +G( 0, "exask", L(exask), "Prompt for filename in save & exit command", "Don't prompt for filename in save & exit command", " Exit ask ", 0, 0), +G( 0, "beep", L(dobeep), "Warning bell enabled", "Warning bell disabled", "Beeps ", 0, 0), +G( 0, "nosta", L(staen), "Top-most status line disabled", "Top-most status line enabled", " Disable status ", 0, 0), +G( 1, "pg", L(pgamnt), "Lines to keep for PgUp/PgDn or -1 for 1/2 window (%d): ", NULL, " # PgUp/PgDn lines ", -1, 64), +G( 0, "csmode", L(csmode), "Start search after a search repeats previous search", "Start search always starts a new search", "Continued search ", 0, 0), +G( 4, "rdonly", F(readonly), "Read only", "Full editing", "O Read only ", 0, 0), +G( 4, "smarthome", F(smarthome), "Smart home key enabled", "Smart home key disabled", " Smart home key ", 0, 0), +G( 4, "indentfirst", F(indentfirst), "Smart home goes to indent first", "Smart home goes home first", " To indent first ", 0, 0), +G( 4, "smartbacks", F(smartbacks), "Smart backspace key enabled", "Smart backspace key disabled", " Smart backspace ", 0, 0), +G( 4, "purify", F(purify), "Indentation clean up enabled", "Indentation clean up disabled", " Clean up indents ", 0, 0), +G( 4, "picture", F(picture), "Picture drawing mode enabled", "Picture drawing mode disabled", "Picture mode ", 0, 0), +X( 2, "backpath", NULL, NULL, "Backup files stored in (%s): ", NULL, " Backup file path ", 0, 0), +G( 4, "vispace", F(vispace), "Spaces visible", "Spaces invisible", "Visible spaces ", 0, 0), +G( 4, "hex", F(hex), "Hex edit mode", "Text edit mode", "G Hexedit mode ", 0, 0), +X( 9, "syntax", NULL, NULL, "Select syntax (%s; ^C to abort): ", NULL, "Y Syntax", 0, 0), +X(13, "encoding", NULL, NULL, "Select file character set (%s; ^C to abort): ", NULL, "Encoding ", 0, 0), +G( 0, "nonotice", L(nonotice), NULL, NULL, NULL, 0, 0), +G( 0, "orphan", L(orphan), NULL, NULL, NULL, 0, 0), +G( 0, "help", L(help), NULL, NULL, NULL, 0, 0), +G( 0, "dopadding", L(dopadding), NULL, NULL, NULL, 0, 0), +G( 1, "lines", L(lines), NULL, NULL, NULL, 2, 1024), +G( 1, "columns", L(columns), NULL, NULL, NULL, 2, 1024), +G( 1, "skiptop", L(skiptop), NULL, NULL, NULL, 0, 64), +G( 0, "notite", L(notite), NULL, NULL, NULL, 0, 0), +G( 0, "pastetite", L(pastetite), NULL, NULL, NULL, 0, 0), +G( 0, "usetabs", L(usetabs), NULL, NULL, NULL, 0, 0), +G( 0, "assume_color", L(assume_color), NULL, NULL, NULL, 0, 0), +X( 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0) }; +#undef F +#undef G +#undef L +#undef X /* Initialize .ofsts above. Is this really necessary? */ @@ -310,6 +326,10 @@ static void izopts(void) for (x = 0; glopts[x].name; ++x) switch (glopts[x].type) { + case 2: + if (!strcmp((const char *)glopts[x].name, "backpath")) + glopts[x].set.us = &backpath; + break; case 4: case 5: case 6: @@ -362,21 +382,21 @@ int glopt(unsigned char *s, unsigned char *arg, OPTIONS *options_, int set) switch (glopts[x].type) { case 0: /* Global variable flag option */ if (set) - *glopts[x].set = st; + *glopts[x].set.i = st; break; case 1: /* Global variable integer option */ if (set && arg) { sscanf((char *)arg, "%d", &val); if (val >= glopts[x].low && val <= glopts[x].high) - *glopts[x].set = val; + *glopts[x].set.i = val; } break; case 2: /* Global variable string option */ if (set) { if (arg) - *(unsigned char **) glopts[x].set = (unsigned char *)strdup((char *)arg); + *glopts[x].set.us = (unsigned char *)strdup((char *)arg); else - *(unsigned char **) glopts[x].set = 0; + *glopts[x].set.us = NULL; } break; case 4: /* Local option flag */ @@ -390,7 +410,7 @@ int glopt(unsigned char *s, unsigned char *arg, OPTIONS *options_, int set) if (val >= glopts[x].low && val <= glopts[x].high) *(int *) ((unsigned char *) options_ + glopts[x].ofst) = val; - } + } } break; case 7: /* Local option numeric + 1, with range checking */ @@ -526,7 +546,7 @@ static int doopt1(BW *bw, unsigned char *s, int *xx, int *notify) msgnw(bw->parent, merrt); ret = -1; } else if (v >= glopts[x].low && v <= glopts[x].high) - *glopts[x].set = v; + *glopts[x].set.i = v; else { msgnw(bw->parent, US "Value out of range"); ret = -1; @@ -534,7 +554,7 @@ static int doopt1(BW *bw, unsigned char *s, int *xx, int *notify) break; case 2: if (s[0]) - *(unsigned char **) glopts[x].set = (unsigned char *)strdup((char *)s); + *glopts[x].set.us = (unsigned char *)strdup((char *)s); break; case 5: if (!*s) { @@ -557,7 +577,7 @@ static int doopt1(BW *bw, unsigned char *s, int *xx, int *notify) ret = -1; break; } - v = calcldec(bw, s); + v = calcl(bw, s) - 1L; if (merrf) { msgnw(bw->parent, merrt); ret = -1; @@ -719,14 +739,14 @@ static int doopt(MENU *m, int x, void *object, int flg) switch (glopts[x].type) { case 0: if (!flg) - *glopts[x].set = !*glopts[x].set; + *glopts[x].set.i = !*glopts[x].set.i; else if (flg == 1) - *glopts[x].set = 1; + *glopts[x].set.i = 1; else - *glopts[x].set = 0; + *glopts[x].set.i = 0; wabort(m->parent); - msgnw(bw->parent, *glopts[x].set ? glopts[x].yes : glopts[x].no); - if (glopts[x].set == &noxon) + msgnw(bw->parent, *glopts[x].set.i ? glopts[x].yes : glopts[x].no); + if (glopts[x].set.i == &noxon) tty_xonoffbaudrst(); break; case 4: @@ -751,21 +771,21 @@ static int doopt(MENU *m, int x, void *object, int flg) } break; case 1: - joe_snprintf_1((char *)buf, OPT_BUF_SIZE, (char *)glopts[x].yes, *glopts[x].set); + joe_snprintf_1((char *)buf, OPT_BUF_SIZE, (char *)glopts[x].yes, *glopts[x].set.i); xx = (int *) joe_malloc(sizeof(int)); *xx = x; m->parent->notify = 0; wabort(m->parent); if (wmkpw(bw->parent, buf, NULL, doopt1, NULL, doabrt1, utypebw, xx, notify, locale_map)) { - if (glopts[x].set == &Baud) + if (glopts[x].set.i == &Baud) tty_xonoffbaudrst(); return 0; } else return -1; case 2: - if (*(unsigned char **) glopts[x].set) - joe_snprintf_1((char *)buf, OPT_BUF_SIZE, (char *)glopts[x].yes, *(unsigned char **) glopts[x].set); + if (*glopts[x].set.us) + joe_snprintf_1((char *)buf, OPT_BUF_SIZE, (char *)glopts[x].yes, *glopts[x].set.us); else joe_snprintf_1((char *)buf, OPT_BUF_SIZE, (char *)glopts[x].yes, ""); xx = (int *) joe_malloc(sizeof(int)); @@ -858,11 +878,11 @@ int umode(BW *bw) switch (glopts[x].type) { case 0: joe_snprintf_1(s[x] + n, OPT_BUF_SIZE - n, - "%s", *glopts[x].set ? "ON" : "OFF"); + "%s", *glopts[x].set.i ? "ON" : "OFF"); break; case 1: joe_snprintf_1(s[x] + n, OPT_BUF_SIZE - n, - "%d", *glopts[x].set); + "%d", *glopts[x].set.i); break; case 2: strlcpy(s[x] + n, "...", OPT_BUF_SIZE - n); diff --git a/rc.h b/rc.h index 140f3cd..50a0ff2 100644 --- a/rc.h +++ b/rc.h @@ -9,7 +9,7 @@ #define _JOE_RC_H 1 #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/rc.h,v 1.5 2017/12/02 02:07:31 tg Exp $"); +__IDSTRING(rcsid_rc_h, "$MirOS: contrib/code/jupp/rc.h,v 1.6 2017/12/02 17:00:49 tg Exp $"); #endif extern OPTIONS pdefault; diff --git a/regex.h b/regex.h index c53f746..ad07353 100644 --- a/regex.h +++ b/regex.h @@ -9,7 +9,7 @@ #define _JOE_REGEX_H 1 #ifdef EXTERN_RC_C -__RCSID("$MirOS: contrib/code/jupp/regex.h,v 1.3 2017/12/02 02:07:31 tg Exp $"); +__IDSTRING(rcsid_regex_h, "$MirOS: contrib/code/jupp/regex.h,v 1.4 2017/12/02 17:00:50 tg Exp $"); #endif int escape PARAMS((int utf8,unsigned char **a, int *b)); diff --git a/scrn.h b/scrn.h index 6024ef4..f3e8288 100644 --- a/scrn.h +++ b/scrn.h @@ -9,7 +9,7 @@ #define _JOE_SCRN_H 1 #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/scrn.h,v 1.6 2017/12/02 02:07:31 tg Exp $"); +__IDSTRING(rcsid_scrn_h, "$MirOS: contrib/code/jupp/scrn.h,v 1.7 2017/12/02 17:00:50 tg Exp $"); #endif #include "tty.h" /* ttputc() */ diff --git a/syntax.h b/syntax.h index 6c97551..3b76a3e 100644 --- a/syntax.h +++ b/syntax.h @@ -2,7 +2,7 @@ #define _Isyntax 1 #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/syntax.h,v 1.4 2017/12/02 02:07:32 tg Exp $"); +__IDSTRING(rcsid_syntax_h, "$MirOS: contrib/code/jupp/syntax.h,v 1.5 2017/12/02 17:00:50 tg Exp $"); #endif #include "hash.h" diff --git a/syntax/asm.jsf.in b/syntax/asm.jsf.in index 16ca4c0..6ea833d 100644 --- a/syntax/asm.jsf.in +++ b/syntax/asm.jsf.in @@ -1,4 +1,4 @@ -# $MirOS: contrib/code/jupp/syntax/asm.jsf.in,v 1.3 2012/09/02 14:46:51 tg Exp $ +# $MirOS: contrib/code/jupp/syntax/asm.jsf.in,v 1.4 2017/12/02 05:38:05 tg Exp $ #- # JOE syntax highlight file for assembly language @@ -22,7 +22,7 @@ =Idle =Bad bold red -=Preproc blue +=Preproc yellow =Define bold blue =Comment green =IncLocal cyan diff --git a/syntax/c.jsf.in b/syntax/c.jsf.in index c903a28..787cfbc 100644 --- a/syntax/c.jsf.in +++ b/syntax/c.jsf.in @@ -1,4 +1,4 @@ -# $MirOS: contrib/code/jupp/syntax/c.jsf.in,v 1.7 2016/10/07 19:43:56 tg Exp $ +# $MirOS: contrib/code/jupp/syntax/c.jsf.in,v 1.8 2017/12/02 05:38:05 tg Exp $ #- # JOE syntax highlight file for C and C++ @@ -90,7 +90,7 @@ =Idle =Bad bold red -=Preproc blue +=Preproc yellow =Define bold blue =Comment green =IncLocal cyan diff --git a/syntax/fortran.jsf.in b/syntax/fortran.jsf.in index 4328b9f..358dd9b 100644 --- a/syntax/fortran.jsf.in +++ b/syntax/fortran.jsf.in @@ -1,4 +1,4 @@ -# $MirOS: contrib/code/jupp/syntax/fortran.jsf.in,v 1.2 2008/05/13 16:17:44 tg Exp $ +# $MirOS: contrib/code/jupp/syntax/fortran.jsf.in,v 1.3 2017/12/02 05:38:05 tg Exp $ #- # JOE syntax highlight file for FORTRAN # Heavily improved by: Malte Thoma (thoma@uni-muenster.de) @@ -13,7 +13,7 @@ =Type red =Keyword bold =Intrinsic magenta -=Preproc blue +=Preproc yellow =Operator magenta =Bad bold red diff --git a/syntax/java.jsf.in b/syntax/java.jsf.in index d821b45..fa292b8 100644 --- a/syntax/java.jsf.in +++ b/syntax/java.jsf.in @@ -1,4 +1,4 @@ -# $MirOS: contrib/code/jupp/syntax/java.jsf.in,v 1.3 2012/09/02 14:46:51 tg Exp $ +# $MirOS: contrib/code/jupp/syntax/java.jsf.in,v 1.4 2017/12/02 05:38:05 tg Exp $ #- # JOE syntax highlight file for JAVA @@ -11,7 +11,7 @@ =Idle -=Preproc blue +=Preproc yellow =Define bold blue =Comment green =Constant cyan diff --git a/syntax/mason.jsf.in b/syntax/mason.jsf.in index 2aaa313..65c5dbd 100644 --- a/syntax/mason.jsf.in +++ b/syntax/mason.jsf.in @@ -1,4 +1,4 @@ -# $MirOS: contrib/code/jupp/syntax/mason.jsf.in,v 1.2 2008/05/13 16:17:45 tg Exp $ +# $MirOS: contrib/code/jupp/syntax/mason.jsf.in,v 1.3 2017/12/02 05:38:06 tg Exp $ #- # JOE syntax highlight file for HTML # This needs lots of work... @@ -9,7 +9,7 @@ # Define colors =Idle -=Preproc blue +=Preproc yellow =Comment green =Constant cyan =Escape bold cyan diff --git a/syntax/perl.jsf.in b/syntax/perl.jsf.in index f544798..117a417 100644 --- a/syntax/perl.jsf.in +++ b/syntax/perl.jsf.in @@ -1,4 +1,4 @@ -# $MirOS: contrib/code/jupp/syntax/perl.jsf.in,v 1.3 2012/09/02 14:46:52 tg Exp $ +# $MirOS: contrib/code/jupp/syntax/perl.jsf.in,v 1.4 2017/12/02 05:38:06 tg Exp $ #- # JOE syntax highlight file for Perl @@ -30,7 +30,7 @@ # Define colors =Idle -=Preproc blue +=Preproc yellow =Comment green =Constant cyan =Escape bold cyan diff --git a/syntax/xml.jsf.in b/syntax/xml.jsf.in index ec1bffd..323df98 100644 --- a/syntax/xml.jsf.in +++ b/syntax/xml.jsf.in @@ -1,4 +1,4 @@ -# $MirOS: contrib/code/jupp/syntax/xml.jsf.in,v 1.3 2012/06/07 22:34:54 tg Exp $ +# $MirOS: contrib/code/jupp/syntax/xml.jsf.in,v 1.4 2017/12/02 05:38:06 tg Exp $ #- # Improved XML highlighter by: Brian Candler @@ -22,7 +22,7 @@ =Idle =Error red bold -=Tag blue +=Tag yellow =Attr cyan =Constant blue bold =EntityRef magenta diff --git a/tab.h b/tab.h index 195e536..3ea934b 100644 --- a/tab.h +++ b/tab.h @@ -9,7 +9,7 @@ #define _JOE_TAB_H 1 #ifdef EXTERN_UFILE_C -__RCSID("$MirOS: contrib/code/jupp/tab.h,v 1.3 2017/12/02 02:07:32 tg Exp $"); +__IDSTRING(rcsid_tab_h, "$MirOS: contrib/code/jupp/tab.h,v 1.4 2017/12/02 17:00:50 tg Exp $"); #endif int cmplt PARAMS((BW *bw)); diff --git a/termcap.h b/termcap.h index d53411b..be295d9 100644 --- a/termcap.h +++ b/termcap.h @@ -9,7 +9,7 @@ #define _JOE_TERMCAP_H 1 #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/termcap.h,v 1.5 2017/12/02 02:07:33 tg Exp $"); +__IDSTRING(rcsid_termcap_h, "$MirOS: contrib/code/jupp/termcap.h,v 1.6 2017/12/02 17:00:50 tg Exp $"); #endif /* CAP *getcap(char *s,int baud,void (*out)(void *outptr,char c),void *outptr); diff --git a/tty.h b/tty.h index 6a6538a..60b2be6 100644 --- a/tty.h +++ b/tty.h @@ -9,7 +9,7 @@ #define _JOE_TTY_H 1 #ifdef EXTERN_CMD_C -__RCSID("$MirOS: contrib/code/jupp/tty.h,v 1.9 2017/12/02 02:07:33 tg Exp $"); +__IDSTRING(rcsid_tty_h, "$MirOS: contrib/code/jupp/tty.h,v 1.10 2017/12/02 17:00:50 tg Exp $"); #endif /* void ttopen(void); Open the tty (attached to stdin) for use inside of JOE diff --git a/tw.h b/tw.h index 866d037..9da4f3e 100644 --- a/tw.h +++ b/tw.h @@ -9,7 +9,7 @@ #define _JOE_TW_H 1 #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/tw.h,v 1.4 2017/12/02 02:07:33 tg Exp $"); +__IDSTRING(rcsid_tw_h, "$MirOS: contrib/code/jupp/tw.h,v 1.5 2017/12/02 17:00:50 tg Exp $"); #endif BW *wmktw PARAMS((SCREEN *t, B *b)); diff --git a/types.h b/types.h index abcb18d..e006dab 100644 --- a/types.h +++ b/types.h @@ -2,10 +2,11 @@ #define _JOE_TYPES_H #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/types.h,v 1.16 2017/12/02 02:07:33 tg Exp $"); +__IDSTRING(rcsid_types_h, "$MirOS: contrib/code/jupp/types.h,v 1.18 2017/12/02 18:33:25 tg Exp $"); #endif /* Prefix to make string constants unsigned */ +#define UC (const unsigned char *) #define US (unsigned char *) #define LINK(type) struct { type *next; type *prev; } diff --git a/ublock.c b/ublock.c index 54e10bf..6615960 100644 --- a/ublock.c +++ b/ublock.c @@ -8,7 +8,7 @@ #include "config.h" #include "types.h" -__RCSID("$MirOS: contrib/code/jupp/ublock.c,v 1.18 2017/12/02 04:32:41 tg Exp $"); +__RCSID("$MirOS: contrib/code/jupp/ublock.c,v 1.19 2017/12/02 18:50:03 tg Exp $"); #include #ifdef HAVE_STDLIB_H @@ -53,8 +53,8 @@ typedef struct marksav MARKSAV; struct marksav { LINK(MARKSAV) link; P *markb, *markk; -} markstack = { { &markstack, &markstack} }; -MARKSAV markfree = { {&markfree, &markfree} }; +} markstack = { { &markstack, &markstack}, NULL, NULL }; +MARKSAV markfree = { {&markfree, &markfree}, NULL, NULL }; int nstack = 0; int upsh(BW *bw) diff --git a/ublock.h b/ublock.h index 8972772..351ab4b 100644 --- a/ublock.h +++ b/ublock.h @@ -9,7 +9,7 @@ #define _JOE_UBLOCK_H 1 #ifdef EXTERN_CMD_C -__RCSID("$MirOS: contrib/code/jupp/ublock.h,v 1.3 2017/12/02 02:07:34 tg Exp $"); +__IDSTRING(rcsid_ublock_h, "$MirOS: contrib/code/jupp/ublock.h,v 1.4 2017/12/02 17:00:51 tg Exp $"); #endif extern int square; diff --git a/uedit.h b/uedit.h index fe3b3b5..ad54988 100644 --- a/uedit.h +++ b/uedit.h @@ -9,7 +9,7 @@ #define _JOE_UEDIT_H 1 #ifdef EXTERN_CMD_C -__RCSID("$MirOS: contrib/code/jupp/uedit.h,v 1.6 2017/12/02 02:07:34 tg Exp $"); +__IDSTRING(rcsid_uedit_h, "$MirOS: contrib/code/jupp/uedit.h,v 1.7 2017/12/02 17:00:51 tg Exp $"); #endif extern int pgamnt; diff --git a/uerror.c b/uerror.c index ddf4be8..a901eba 100644 --- a/uerror.c +++ b/uerror.c @@ -8,7 +8,7 @@ #include "config.h" #include "types.h" -__RCSID("$MirOS: contrib/code/jupp/uerror.c,v 1.5 2017/12/02 02:07:34 tg Exp $"); +__RCSID("$MirOS: contrib/code/jupp/uerror.c,v 1.6 2017/12/02 18:50:03 tg Exp $"); #include "b.h" #include "bw.h" @@ -32,7 +32,7 @@ struct error { unsigned char *file; /* Target file name */ long src; /* Error-file line number */ unsigned char *msg; /* The message */ -} errors = { { &errors, &errors} }; +} errors = { { &errors, &errors}, 0, 0, NULL, 0, NULL }; ERROR *errptr = &errors; /* Current error row */ B *errbuf = NULL; /* Buffer with error messages */ @@ -96,7 +96,7 @@ void saverr(unsigned char *name) } /* Pool of free error nodes */ -ERROR errnodes = { {&errnodes, &errnodes} }; +ERROR errnodes = { {&errnodes, &errnodes}, 0, 0, NULL, 0, NULL }; /* Free an error node */ diff --git a/uerror.h b/uerror.h index c6d1f43..0423d1d 100644 --- a/uerror.h +++ b/uerror.h @@ -9,7 +9,7 @@ #define _JOE_UERROR_H 1 #ifdef EXTERN_B_C -__RCSID("$MirOS: contrib/code/jupp/uerror.h,v 1.3 2017/12/02 02:07:34 tg Exp $"); +__IDSTRING(rcsid_uerror_h, "$MirOS: contrib/code/jupp/uerror.h,v 1.4 2017/12/02 17:00:51 tg Exp $"); #endif int unxterr PARAMS((BW *bw)); diff --git a/ufile.h b/ufile.h index 8697025..d9f528c 100644 --- a/ufile.h +++ b/ufile.h @@ -9,7 +9,7 @@ #define _JOE_UFILE_H 1 #ifdef EXTERN_CMD_C -__RCSID("$MirOS: contrib/code/jupp/ufile.h,v 1.5 2017/12/02 02:07:35 tg Exp $"); +__IDSTRING(rcsid_ufile_h, "$MirOS: contrib/code/jupp/ufile.h,v 1.6 2017/12/02 17:00:51 tg Exp $"); #endif extern int exask; diff --git a/uformat.h b/uformat.h index be69505..012779f 100644 --- a/uformat.h +++ b/uformat.h @@ -9,7 +9,7 @@ #define _JOE_UFORMAT_H 1 #ifdef EXTERN_CMD_C -__RCSID("$MirOS: contrib/code/jupp/uformat.h,v 1.3 2017/12/02 02:07:35 tg Exp $"); +__IDSTRING(rcsid_uformat_h, "$MirOS: contrib/code/jupp/uformat.h,v 1.4 2017/12/02 17:00:51 tg Exp $"); #endif int ucenter PARAMS((BW *bw)); diff --git a/uisrch.c b/uisrch.c index 1fa0703..66e1493 100644 --- a/uisrch.c +++ b/uisrch.c @@ -8,7 +8,7 @@ #include "config.h" #include "types.h" -__RCSID("$MirOS: contrib/code/jupp/uisrch.c,v 1.9 2017/12/02 04:32:42 tg Exp $"); +__RCSID("$MirOS: contrib/code/jupp/uisrch.c,v 1.10 2017/12/02 18:50:03 tg Exp $"); #include @@ -32,7 +32,7 @@ unsigned char *lastpat = NULL; /* Previous pattern */ extern SRCH *globalsrch; /* Existing SRCH structure */ -IREC fri = { {&fri, &fri} }; /* Free-list of irecs */ +IREC fri = { {&fri, &fri}, 0, 0, 0, 0 }; /* Free-list of irecs */ static IREC *alirec(void) { /* Allocate an IREC */ diff --git a/uisrch.h b/uisrch.h index 06cc289..854d331 100644 --- a/uisrch.h +++ b/uisrch.h @@ -9,7 +9,7 @@ #define _JOE_UISRCH_H 1 #ifdef EXTERN_CMD_C -__RCSID("$MirOS: contrib/code/jupp/uisrch.h,v 1.3 2017/12/02 02:07:35 tg Exp $"); +__IDSTRING(rcsid_uisrch_h, "$MirOS: contrib/code/jupp/uisrch.h,v 1.4 2017/12/02 17:00:51 tg Exp $"); #endif int uisrch PARAMS((BW *bw)); diff --git a/umath.c b/umath.c index d4cabb3..eddf17c 100644 --- a/umath.c +++ b/umath.c @@ -8,7 +8,7 @@ #include "config.h" #include "types.h" -__RCSID("$MirOS: contrib/code/jupp/umath.c,v 1.11 2017/12/02 04:32:42 tg Exp $"); +__RCSID("$MirOS: contrib/code/jupp/umath.c,v 1.15 2017/12/02 18:33:25 tg Exp $"); #ifdef HAVE_STDLIB_H #include @@ -29,6 +29,8 @@ const unsigned char *merrt; static char math_res[JOE_MSGBUFSIZE]; static char *math_exp; +static double calc(BW *bw, unsigned char *s); + static RETSIGTYPE fperr(int unused) { if (!merrf) @@ -95,7 +97,10 @@ static double expr(int prec, struct var **rtv) while ((*ptr >= '0' && *ptr <= '9') || ((*ptr | 0x20) >= 'a' && (*ptr | 0x20) <= 'f')) ++ptr; } else if ((*ptr >= '0' && *ptr <= '9') || *ptr == '.') { - x = strtod(ptr, &ptr); + char *eptr; + + x = strtod(ptr, &eptr); + ptr = (unsigned char *)eptr; } else if (*ptr == '(') { ++ptr; x = expr(0, &v); @@ -152,7 +157,8 @@ typedef long joe_imaxt; #define JOE_IMAXT "l" #endif -double calc(BW *bw, unsigned char *s) +static double +calc(BW *bw, unsigned char *s) { double result; struct var *v; @@ -277,6 +283,15 @@ int umathres(BW *bw) binss(bw->cursor, (void *)math_res); return 0; } + +long +calcl(BW *bw, unsigned char *s) +{ + double rv; + + rv = calc(bw, s); + return ((long)rv); +} #else long calcl(BW *bw, unsigned char *s) diff --git a/umath.h b/umath.h index 64c1fc1..8605aac 100644 --- a/umath.h +++ b/umath.h @@ -9,35 +9,28 @@ #define _JOE_UMATH_H 1 #ifdef EXTERN_CMD_C -__RCSID("$MirOS: contrib/code/jupp/umath.h,v 1.8 2017/12/02 04:15:29 tg Exp $"); +__IDSTRING(rcsid_umath_h, "$MirOS: contrib/code/jupp/umath.h,v 1.10 2017/12/02 17:00:51 tg Exp $"); #endif #ifdef HAVE_SIGNAL_H #include #endif -extern volatile sig_atomic_t merrf; +extern volatile sig_atomic_t merrf; extern const unsigned char *merrt; +long calcl(BW *bw, unsigned char *s); + #if WANT_MATH -double calc(BW *bw, unsigned char *s); int umath(BW *bw); int umathins(BW *bw); int umathres(BW *bw); - -#define calcl(bw,s) ((long)calc((bw), (s))) -#define calcldec(bw,s) ((long)(calc((bw), (s)) - 1.0)) - #else - -long calcl(BW *bw, unsigned char *s); int unomath(BW *bw); #define umath unomath #define umathins unomath #define umathres unomath -#define calcldec(bw,s) (calcl((bw), (s)) - 1L) - -#endif /* !WANT_MATH */ +#endif #endif diff --git a/undo.c b/undo.c index 901187a..b60ac0c 100644 --- a/undo.c +++ b/undo.c @@ -8,7 +8,7 @@ #include "config.h" #include "types.h" -__RCSID("$MirOS: contrib/code/jupp/undo.c,v 1.4 2017/12/02 02:07:36 tg Exp $"); +__RCSID("$MirOS: contrib/code/jupp/undo.c,v 1.5 2017/12/02 18:50:03 tg Exp $"); #ifdef HAVE_STDLIB_H #include @@ -23,20 +23,20 @@ __RCSID("$MirOS: contrib/code/jupp/undo.c,v 1.4 2017/12/02 02:07:36 tg Exp $"); #define SMALL 1024 -static UNDO undos = { {&undos, &undos} }; -static UNDO frdos = { {&frdos, &frdos} }; +static UNDO undos = { {&undos, &undos}, NULL, 0, { {NULL, NULL}, NULL, 0, 0, 0, 0, 0, NULL, NULL }, NULL, NULL, NULL }; +static UNDO frdos = { {&frdos, &frdos}, NULL, 0, { {NULL, NULL}, NULL, 0, 0, 0, 0, 0, NULL, NULL }, NULL, NULL, NULL }; int inundo = 0; int inredo = 0; extern int dostaupd; -UNDOREC yanked = { {&yanked, &yanked} }; +UNDOREC yanked = { {&yanked, &yanked}, NULL, 0, 0, 0, 0, 0, NULL, NULL }; int nyanked = 0; int inyank = 0; int justkilled = 0; -UNDOREC frrecs = { {&frrecs, &frrecs} }; +UNDOREC frrecs = { {&frrecs, &frrecs}, NULL, 0, 0, 0, 0, 0, NULL, NULL }; static UNDOREC *alrec(void) { diff --git a/undo.h b/undo.h index 8fcadf5..2a7a2d5 100644 --- a/undo.h +++ b/undo.h @@ -9,7 +9,7 @@ #define _JOE_UNDO_H 1 #ifdef EXTERN_B_C -__RCSID("$MirOS: contrib/code/jupp/undo.h,v 1.3 2017/12/02 02:07:36 tg Exp $"); +__IDSTRING(rcsid_undo_h, "$MirOS: contrib/code/jupp/undo.h,v 1.4 2017/12/02 17:00:51 tg Exp $"); #endif extern int inundo; diff --git a/usearch.c b/usearch.c index 8c20d81..8f2405f 100644 --- a/usearch.c +++ b/usearch.c @@ -8,7 +8,7 @@ #include "config.h" #include "types.h" -__RCSID("$MirOS: contrib/code/jupp/usearch.c,v 1.11 2017/12/02 02:07:36 tg Exp $"); +__RCSID("$MirOS: contrib/code/jupp/usearch.c,v 1.12 2017/12/02 18:50:04 tg Exp $"); #include @@ -42,7 +42,7 @@ B *replhist = NULL; /* Replacement string history */ SRCH *globalsrch = NULL; /* Most recent completed search data */ -SRCHREC fsr = { {&fsr, &fsr} }; +SRCHREC fsr = { {&fsr, &fsr}, 0, 0, 0 }; /* Completion stuff: should go somewhere else */ diff --git a/usearch.h b/usearch.h index f1b8a40..a8d0f5e 100644 --- a/usearch.h +++ b/usearch.h @@ -9,7 +9,7 @@ #define _JOE_USEARCH_H 1 #ifdef EXTERN_CMD_C -__RCSID("$MirOS: contrib/code/jupp/usearch.h,v 1.3 2017/12/02 02:07:36 tg Exp $"); +__IDSTRING(rcsid_usearch_h, "$MirOS: contrib/code/jupp/usearch.h,v 1.4 2017/12/02 17:00:51 tg Exp $"); #endif SRCH *mksrch PARAMS((unsigned char *pattern, unsigned char *replacement, int ignore, int backwards, int repeat, int replace, int rest)); diff --git a/ushell.h b/ushell.h index 255fb04..0cf0a4e 100644 --- a/ushell.h +++ b/ushell.h @@ -8,7 +8,7 @@ #define _JOE_USHELL_H 1 #ifdef EXTERN_CMD_C -__RCSID("$MirOS: contrib/code/jupp/ushell.h,v 1.4 2017/12/02 02:07:36 tg Exp $"); +__IDSTRING(rcsid_ushell_h, "$MirOS: contrib/code/jupp/ushell.h,v 1.5 2017/12/02 17:00:52 tg Exp $"); #endif int ubknd PARAMS((BW *bw)); diff --git a/utag.h b/utag.h index 3566f31..9322aa9 100644 --- a/utag.h +++ b/utag.h @@ -9,7 +9,7 @@ #define _JOE_UTAG_H 1 #ifdef EXTERN_CMD_C -__RCSID("$MirOS: contrib/code/jupp/utag.h,v 1.3 2017/12/02 02:07:37 tg Exp $"); +__IDSTRING(rcsid_utag_h, "$MirOS: contrib/code/jupp/utag.h,v 1.4 2017/12/02 17:00:52 tg Exp $"); #endif int utag PARAMS((BW *bw)); diff --git a/utf8.h b/utf8.h index 70ed55e..f673e47 100644 --- a/utf8.h +++ b/utf8.h @@ -9,7 +9,7 @@ #define _Iutf8 1 #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/utf8.h,v 1.5 2017/12/02 02:07:37 tg Exp $"); +__IDSTRING(rcsid_utf8_h, "$MirOS: contrib/code/jupp/utf8.h,v 1.6 2017/12/02 17:00:52 tg Exp $"); #endif #include "i18n.h" diff --git a/utils.h b/utils.h index 69e6966..a1e990f 100644 --- a/utils.h +++ b/utils.h @@ -11,7 +11,7 @@ #define _JOE_UTILS_H 1 #ifdef EXTERN_B_C -__RCSID("$MirOS: contrib/code/jupp/utils.h,v 1.7 2017/12/02 03:52:35 tg Exp $"); +__IDSTRING(rcsid_utils_h, "$MirOS: contrib/code/jupp/utils.h,v 1.8 2017/12/02 17:00:52 tg Exp $"); #endif #ifdef HAVE_SIGNAL_H diff --git a/va.h b/va.h index e161c2e..1d7874c 100644 --- a/va.h +++ b/va.h @@ -9,7 +9,7 @@ #define _JOE_VA_H 1 #ifdef EXTERN_B_C -__RCSID("$MirOS: contrib/code/jupp/va.h,v 1.4 2017/12/02 02:07:37 tg Exp $"); +__IDSTRING(rcsid_va_h, "$MirOS: contrib/code/jupp/va.h,v 1.5 2017/12/02 17:00:52 tg Exp $"); #endif #include "vs.h" diff --git a/vfile.c b/vfile.c index 27e01c5..9cc3df8 100644 --- a/vfile.c +++ b/vfile.c @@ -8,7 +8,7 @@ #include "config.h" #include "types.h" -__RCSID("$MirOS: contrib/code/jupp/vfile.c,v 1.10 2017/12/02 02:07:38 tg Exp $"); +__RCSID("$MirOS: contrib/code/jupp/vfile.c,v 1.11 2017/12/02 18:50:04 tg Exp $"); #ifdef HAVE_SYS_STAT_H #include @@ -27,7 +27,8 @@ __RCSID("$MirOS: contrib/code/jupp/vfile.c,v 1.10 2017/12/02 02:07:38 tg Exp $") #include "vfile.h" #include "vs.h" -static VFILE vfiles = { {&vfiles, &vfiles} }; /* Known vfiles */ + /* Known vfiles */ +static VFILE vfiles = { {&vfiles, &vfiles}, 0, 0, 0, 0, NULL, 0, NULL, 0, NULL, NULL, 0, 0 }; static VPAGE *freepages = NULL; /* Linked list of free pages */ static VPAGE *htab[HTSIZE]; /* Hash table of page headers */ static long curvalloc = 0; /* Amount of memory in use */ diff --git a/vfile.h b/vfile.h index a63520e..915af67 100644 --- a/vfile.h +++ b/vfile.h @@ -9,7 +9,7 @@ #define _JOE_VFILE_H 1 #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/vfile.h,v 1.4 2017/12/02 02:07:38 tg Exp $"); +__IDSTRING(rcsid_vfile_h, "$MirOS: contrib/code/jupp/vfile.h,v 1.5 2017/12/02 17:00:52 tg Exp $"); #endif /* Additions: diff --git a/vs.h b/vs.h index 9da59cb..7b54dab 100644 --- a/vs.h +++ b/vs.h @@ -9,7 +9,7 @@ #define _JOE_VS_H 1 #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/vs.h,v 1.7 2017/12/02 02:07:38 tg Exp $"); +__IDSTRING(rcsid_vs_h, "$MirOS: contrib/code/jupp/vs.h,v 1.8 2017/12/02 17:00:52 tg Exp $"); #endif #include diff --git a/w.h b/w.h index 951a8ff..bc612cf 100644 --- a/w.h +++ b/w.h @@ -9,7 +9,7 @@ #define _JOE_W_H 1 #ifdef EXTERN -__RCSID("$MirOS: contrib/code/jupp/w.h,v 1.5 2017/12/02 02:07:38 tg Exp $"); +__IDSTRING(rcsid_w_h, "$MirOS: contrib/code/jupp/w.h,v 1.6 2017/12/02 17:00:53 tg Exp $"); #endif /***************/