-# $MirOS: contrib/code/jupp/Makefile.am,v 1.16 2017/01/11 21:48:57 tg Exp $
+# $MirOS: contrib/code/jupp/Makefile.am,v 1.17 2017/12/02 04:02:42 tg Exp $
AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = \
- COPYING HINTS INFO LIST NEWS README README.cvs TODO dir.c \
- win32.c jmacsrc.in joe.1.in joerc.in jpicorc.in jstarrc.in \
- jupprc rjoerc.in charmaps/klingon.in docs/help-system.html \
+ COPYING HINTS INFO LIST NEWS README README.cvs TODO \
+ charmaps/klingon.in dir.c docs/help-system.html jmacsrc.in \
+ joe.1.in joerc.in jpicorc.in jstarrc.in jupprc rjoerc.in \
syntax/asm.jsf.in syntax/c.jsf.in syntax/conf.jsf.in \
syntax/csh.jsf.in syntax/diff.jsf.in syntax/fortran.jsf.in \
syntax/html.jsf.in syntax/java.jsf.in syntax/lisp.jsf.in \
sysconf_charmaps_DATA = charmaps/klingon
man_MANS = joe.1
-noinst_HEADERS = b.h blocks.h bw.h cmd.h config.h hash.h help.h kbd.h \
- macro.h main.h menu.h path.h poshist.h pw.h queue.h qw.h rc.h regex.h \
- scrn.h tab.h termcap.h tty.h tw.h types.h ublock.h uedit.h uerror.h \
- ufile.h uformat.h uisrch.h umath.h undo.h usearch.h ushell.h utag.h \
- utils.h va.h vfile.h vs.h w.h utf8.h syntax.h i18n.h charmap.h builtin.h
-
+noinst_HEADERS = \
+ b.h blocks.h builtin.h bw.h charmap.h cmd.h config.h hash.h \
+ help.h i18n.h kbd.h macro.h main.h menu.h path.h poshist.h pw.h \
+ queue.h qw.h rc.h regex.h scrn.h syntax.h tab.h termcap.h tty.h \
+ tw.h types.h ublock.h uedit.h uerror.h ufile.h uformat.h \
+ uisrch.h umath.h undo.h usearch.h ushell.h utag.h utf8.h utils.h \
+ va.h vfile.h vs.h w.h
bin_PROGRAMS = joe
if WANT_TERMIDX
-# $MirOS: contrib/code/jupp/Makefile.bsd-wrapper,v 1.10 2017/07/08 15:38:43 tg Exp $
+# $MirOS: contrib/code/jupp/Makefile.bsd-wrapper,v 1.11 2017/12/02 04:33:47 tg Exp $
#-
# make -f Makefile.bsd-wrapper CFPREFIX=/usr/mpkg sysconfjoesubdir=/joe
--bindir=${CFPREFIX:Q}/bin \
--mandir=${CFMANDIR:Q} \
--sysconfdir=${CFETC:Q} \
+ ${GCFARGS} \
--enable-sysconfjoesubdir=${sysconfjoesubdir:Q}
.ifmake winman
@SET_MAKE@
-# $MirOS: contrib/code/jupp/Makefile.am,v 1.16 2017/01/11 21:48:57 tg Exp $
+# $MirOS: contrib/code/jupp/Makefile.am,v 1.17 2017/12/02 04:02:42 tg Exp $
target_vendor = @target_vendor@
AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = \
- COPYING HINTS INFO LIST NEWS README README.cvs TODO dir.c \
- win32.c jmacsrc.in joe.1.in joerc.in jpicorc.in jstarrc.in \
- jupprc rjoerc.in charmaps/klingon.in docs/help-system.html \
+ COPYING HINTS INFO LIST NEWS README README.cvs TODO \
+ charmaps/klingon.in dir.c docs/help-system.html jmacsrc.in \
+ joe.1.in joerc.in jpicorc.in jstarrc.in jupprc rjoerc.in \
syntax/asm.jsf.in syntax/c.jsf.in syntax/conf.jsf.in \
syntax/csh.jsf.in syntax/diff.jsf.in syntax/fortran.jsf.in \
syntax/html.jsf.in syntax/java.jsf.in syntax/lisp.jsf.in \
sysconf_charmapsdir = $(sysconf_joedir)/charmaps
sysconf_charmaps_DATA = charmaps/klingon
man_MANS = joe.1
-noinst_HEADERS = b.h blocks.h bw.h cmd.h config.h hash.h help.h kbd.h \
- macro.h main.h menu.h path.h poshist.h pw.h queue.h qw.h rc.h regex.h \
- scrn.h tab.h termcap.h tty.h tw.h types.h ublock.h uedit.h uerror.h \
- ufile.h uformat.h uisrch.h umath.h undo.h usearch.h ushell.h utag.h \
- utils.h va.h vfile.h vs.h w.h utf8.h syntax.h i18n.h charmap.h builtin.h
+noinst_HEADERS = \
+ b.h blocks.h builtin.h bw.h charmap.h cmd.h config.h hash.h \
+ help.h i18n.h kbd.h macro.h main.h menu.h path.h poshist.h pw.h \
+ queue.h qw.h rc.h regex.h scrn.h syntax.h tab.h termcap.h tty.h \
+ tw.h types.h ublock.h uedit.h uerror.h ufile.h uformat.h \
+ uisrch.h umath.h undo.h usearch.h ushell.h utag.h utf8.h utils.h \
+ va.h vfile.h vs.h w.h
@JUPP_WIN32RELOC_FALSE@joe_WIN32_DEFS = -DJUPP_WIN32RELOC=0 -DJOERC="\"$(sysconf_joedir)/\""
@JUPP_WIN32RELOC_TRUE@joe_WIN32_DEFS = -DJUPP_WIN32RELOC=1 -UJOERC
/* We have fork(2) and want to use it */
#undef WANT_FORK
+/* Can we use the FPU? */
+#undef WANT_MATH
+
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
-/* $MirOS: contrib/code/jupp/b.c,v 1.15 2016/10/08 17:42:12 tg Exp $ */
/*
* Editor engine
* Copyright
*
* This file is part of JOE (Joe's Own Editor)
*/
+#define EXTERN_B_C
#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/b.c,v 1.18 2017/12/02 04:32:37 tg Exp $");
+
#include <unistd.h>
-#include <stdio.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <limits.h>
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
#include "va.h"
#include "vfile.h"
#include "vs.h"
-#include "utf8.h"
#include "charmap.h"
#include "w.h"
int x;
*skip = 0;
- *amnt = MAXLONG;
+ *amnt = LONG_MAX;
for (x = sLEN(n) - 1; x > 0 && ((n[x] >= '0' && n[x] <= '9') || n[x] == 'x' || n[x] == 'X'); --x) ;
if (n[x] == ',') {
n[x] = 0;
b->name = joesep((unsigned char *)strdup(s));
/* Set flags */
- if (error || s[0] == '!' || skip || amnt != MAXLONG) {
+ if (error || s[0] == '!' || skip || amnt != LONG_MAX) {
b->backup = 1;
b->changed = 0;
} else if (!strcmp(n, "-")) {
nescape(maint->t);
ttclsn();
f = stdout;
- } else if (skip || amnt != MAXLONG)
+ } else if (skip || amnt != LONG_MAX)
f = fopen((char *)s, "r+");
else {
f = fopen((char *)s, "w");
bsavefd(p, fileno(f), size);
- if (!error && force && size && !skip && amnt == MAXLONG) {
+ if (!error && force && size && !skip && amnt == LONG_MAX) {
P *q = pdup(p);
unsigned char nl = '\n';
-/* $MirOS: contrib/code/jupp/b.h,v 1.4 2014/10/23 16:10:28 tg Exp $ */
/*
* Editor engine
* Copyright
#ifndef _JOE_B_H
#define _JOE_B_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/b.h,v 1.5 2017/12/02 02:07:23 tg Exp $");
+#endif
/* 31744 */
extern unsigned char stdbuf[stdsiz];
-/* $MirOS: contrib/code/jupp/blocks.c,v 1.5 2017/08/08 16:09:43 tg Exp $ */
/*
* Fast block move/copy subroutines
* Copyright
*/
#include "config.h"
+__RCSID("$MirOS: contrib/code/jupp/blocks.c,v 1.6 2017/12/02 02:07:23 tg Exp $");
+
/* This module requires ALIGNED and SIZEOF_INT to be defined correctly */
#include "blocks.h"
-/* $MirOS: contrib/code/jupp/blocks.h,v 1.4 2012/06/08 16:55:27 tg Exp $ */
/*
* Fast block move/copy subroutines
* Copyright
#ifndef _JOE_BLOCKS_H
#define _JOE_BLOCKS_H 1
-#include "config.h"
+#ifdef EXTERN_B_C
+__RCSID("$MirOS: contrib/code/jupp/blocks.h,v 1.5 2017/12/02 02:07:23 tg Exp $");
+#endif
/* char *mmove(char *d,char *s,int sz); Copy 'sz' bytes from 's' to 'd'.
* Chooses either mbkwd or mfwrd to do this such that the data won't get
-/* $MirOS: contrib/code/jupp/builtin.c,v 1.5 2017/01/10 19:16:27 tg Exp $ */
/*
* Built-in config files
* Copyright
#include "config.h"
-#include <stdio.h>
+__RCSID("$MirOS: contrib/code/jupp/builtin.c,v 1.6 2017/12/02 02:07:23 tg Exp $");
+
#include <stdlib.h>
#include <string.h>
-/* $MirOS: contrib/code/jupp/builtin.h,v 1.2 2010/04/08 15:31:01 tg Exp $ */
+#ifdef EXTERN_RC_C
+__RCSID("$MirOS: contrib/code/jupp/builtin.h,v 1.3 2017/12/02 02:07:23 tg Exp $");
+#endif
/* Support for built-in config files */
done | perl -pe 's/[^\ca-~]/sprintf "\\x%02X", unpack("U", $&)/eg'
*/
+#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/builtins.c,v 1.26 2017/12/02 02:07:24 tg Exp $");
+
#ifndef JUPPRC_BUILTIN_NAME
#define JUPPRC_BUILTIN_NAME "jupprc"
#endif
":querysr\n"
"type ^@ TO \xFF\n"
, NULL
-, "@(#) $MirOS: contrib/code/jupp/builtins.c,v 1.25 2017/08/09 02:47:30 tg Exp $"
};
-/* $MirOS: contrib/code/jupp/bw.c,v 1.22 2017/07/09 01:15:51 tg Exp $ */
/*
* Edit buffer window generation
* Copyright
#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/bw.c,v 1.25 2017/12/02 04:32:38 tg Exp $");
+
#include <string.h>
-#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#include <limits.h>
#ifdef HAVE_BSD_STRING_H
#include <bsd/string.h>
#include "ublock.h"
#include "utils.h"
#include "syntax.h"
-#include "utf8.h"
#include "charmap.h"
#include "w.h"
if (p == NULL) {
P *best = cur;
- long dist = MAXLONG;
+ long dist = LONG_MAX;
long d;
d = (line >= cur->line ? line - cur->line : cur->line - line);
-/* $MirOS: contrib/code/jupp/bw.h,v 1.4 2014/03/04 23:04:11 tg Exp $ */
/*
* Edit buffer window generation
* Copyright
#ifndef _JOE_BW_H
#define _JOE_BW_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_CMD_C
+__RCSID("$MirOS: contrib/code/jupp/bw.h,v 1.5 2017/12/02 02:07:24 tg Exp $");
+#endif
extern int dspasis;
extern int mid;
#if 0
.if "0" == "1"
#endif
-/* $MirOS: contrib/code/jupp/charmap.c,v 1.19 2017/01/11 22:04:31 tg Exp $ */
/*
* UNICODE/ISO-10646 conversion utilities
* Copyright
*/
#include "config.h"
+#include "types.h"
+
+__RCSID("$MirOS: contrib/code/jupp/charmap.c,v 1.21 2017/12/02 04:32:38 tg Exp $");
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "va.h"
#include "utils.h"
-#include "i18n.h"
#include "path.h"
#include "charmap.h"
-/* $MirOS: contrib/code/jupp/charmap.h,v 1.6 2017/01/10 23:10:47 tg Exp $ */
/*
* Character sets
* Copyright
#ifndef _Icharmap
#define _Icharmap 1
-#include "config.h"
-#include "utf8.h"
-#include "types.h"
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/charmap.h,v 1.8 2017/12/02 04:32:39 tg Exp $");
+#endif
/* For sorted from_map entries */
int to_uni PARAMS((struct charmap *cset, int c));
int from_uni PARAMS((struct charmap *cset, int c));
+#include "utf8.h"
+
#endif
-/* $MirOS: contrib/code/jupp/cmd.c,v 1.18 2017/11/18 17:05:50 tg Exp $ */
/*
* Command execution
* Copyright
*
* This file is part of JOE (Joe's Own Editor)
*/
+#define EXTERN_CMD_C
#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/cmd.c,v 1.19 2017/12/02 02:07:25 tg Exp $");
+
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
-/* $MirOS: contrib/code/jupp/cmd.h,v 1.4 2014/06/09 16:06:46 tg Exp $ */
/*
* Command execution
* Copyright
#ifndef _JOE_CMD_H
#define _JOE_CMD_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_CMD_C
+__RCSID("$MirOS: contrib/code/jupp/cmd.h,v 1.5 2017/12/02 02:07:25 tg Exp $");
+#endif
extern CMD cmds[]; /* Built-in commands */
extern int dobeep;
-/* $MirOS: contrib/code/jupp/compat.c,v 1.4 2012/06/08 16:48:58 tg Exp $ */
-
/*-
- * Copyright © 2004, 2005, 2006, 2007, 2011, 2012
- * Thorsten “mirabilos” Glaser <tg@mirbsd.org>
+ * Copyright © 2004, 2005, 2006, 2007, 2011, 2012, 2017
+ * mirabilos <m@mirbsd.org>
*
* Provided that these terms and disclaimer and all copyright notices
* are retained or reproduced in an accompanying document, permission
* damage or existence of a defect, except proven that it results out
* of said person’s immediate fault when using the work as intended.
*-
- * Compatibility functions for jupp.
+ * Compatibility and fully new utility functions for jupp.
*
* – ctime: based on mirtime from MirBSD libc; not leap second capable
* src/kern/include/mirtime.h,v 1.2 2011/11/20 23:40:11 tg Exp
* src/kern/c/mirtime.c,v 1.3 2011/11/20 23:40:10 tg Exp
* – strlcpy, strlcat: pulled in via "strlfun.inc"
* – popen, pclose: pulled in via "popen.inc"
+ * - ustoc_{hex,oct}, ustol: parse integers
*/
#include "config.h"
#include "types.h"
-#undef __RCSID
-#define __RCSID(x) /* nothing, in jupp */
+__RCSID("$MirOS: contrib/code/jupp/compat.c,v 1.8 2017/12/02 04:32:39 tg Exp $");
+
+#include <limits.h>
+#include <string.h>
+#include "utils.h"
#undef L_strlcat
#undef L_strlcpy
# endif
#endif
-#include <limits.h>
-#include <stdio.h>
-
typedef struct {
int tm_sec; /* seconds [0-60] */
int tm_min; /* minutes [0-59] */
#ifndef HAVE_POPEN
#include "popen.inc"
#endif
+
+size_t
+ustoc_hex(const void *us, int *dp, size_t lim)
+{
+ unsigned char c;
+ const unsigned char *s = (const unsigned char *)us;
+ int rv = 0, rounds = 0;
+
+ while (rounds++ < 2 && lim-- > 0)
+ if ((c = *s++) >= '0' && c <= '9')
+ rv = (rv << 4) | (c & 15);
+ else if ((c |= 0x20) >= 'a' && c <= 'f')
+ rv = (rv << 4) | (c - 'a' + 10);
+ else {
+ --s;
+ break;
+ }
+
+ *dp = rv;
+ return (s - (const unsigned char *)us);
+}
+
+size_t
+ustoc_oct(const void *us, int *dp, size_t lim)
+{
+ unsigned char c;
+ const unsigned char *s = (const unsigned char *)us;
+ int rv = 0, rounds = 0;
+
+ while (rounds++ < 3 && lim-- > 0)
+ if ((c = *s++) >= '0' && c <= '7')
+ rv = (rv << 3) | (c & 7);
+ else {
+ --s;
+ break;
+ }
+
+ *dp = rv;
+ return (s - (const unsigned char *)us);
+}
+
+#define USTOL_MODEMASK 0x03
+
+static const char ustol_wsp[] = "\t\x0B\x0C\r ";
+
+long
+ustol(void *us, void **dpp, int flags)
+{
+ unsigned char c, *s = (unsigned char *)us;
+ unsigned long a = 0;
+ unsigned char *sp;
+ unsigned char neg = 0;
+
+ if (flags & USTOL_LTRIM)
+ while ((c = *s) && strchr(ustol_wsp, c))
+ ++s;
+
+ switch (flags & USTOL_MODEMASK) {
+ case USTOL_HEX:
+ if (s[0] == '0' && (s[1] | 0x20) == 'x')
+ s += 2;
+ break;
+ case USTOL_AUTO:
+ if (s[0] != '0')
+ flags |= USTOL_DEC;
+ else if ((s[1] | 0x20) != 'x')
+ flags |= USTOL_OCT;
+ else {
+ flags |= USTOL_HEX;
+ s += 2;
+ }
+ break;
+ }
+
+ sp = s;
+ switch (flags & USTOL_MODEMASK) {
+ case USTOL_OCT:
+ while ((c = *s++) >= '0' && c <= '7') {
+ /* overflow check */
+ if (a > (ULONG_MAX >> 3))
+ goto err;
+ /* accumulate trivially */
+ a = (a << 3) | (c & 7);
+ }
+ break;
+ case USTOL_HEX:
+ while ((c = *s++) >= '0') {
+ if (c <= '9')
+ c &= 15;
+ else if ((c |= 0x20) >= 'a' && c <= 'f')
+ c = c - 'a' + 10;
+ else
+ break;
+ /* overflow check */
+ if (a > (ULONG_MAX >> 4))
+ goto err;
+ /* accumulate trivially */
+ a = (a << 4) | c;
+ }
+ break;
+ default:
+ switch (*s) {
+ case '-':
+ neg = 1;
+ /* FALLTHROUGH */
+ case '+':
+ sp = ++s;
+ }
+ while ((c = *s++) >= '0' && c <= '9') {
+ c &= 15;
+ if (a > (ULONG_MAX / 10))
+ goto err;
+ a *= 10;
+ if (a > (ULONG_MAX - c))
+ goto err;
+ a += c;
+ }
+ if (neg) {
+ if (a > (((unsigned long)(-(LONG_MIN + 1L))) + 1UL))
+ goto err;
+ a = -a;
+ } else if (a > (unsigned long)LONG_MAX)
+ goto err;
+ }
+ /* check we had at least one digit */
+ if (--s == sp)
+ goto err;
+
+ if (flags & USTOL_RTRIM)
+ while ((c = *s) && strchr(ustol_wsp, c))
+ ++s;
+
+ /* don’t check for EOS, or arrived at EOS */
+ if (!(flags & USTOL_EOS) || !*s)
+ goto out;
+
+ err:
+ s = NULL;
+ a = 0;
+ out:
+ if (dpp)
+ *dpp = (void *)s;
+ return ((long)a);
+}
+
+long
+ustolb(void *us, void **dpp, long lower, long upper, int flags)
+{
+ void *dp;
+ long rv;
+
+ rv = ustol(us, &dp, flags);
+ if (dp != NULL && (rv < lower || rv > upper)) {
+ dp = NULL;
+ rv = 0;
+ }
+ if (dpp)
+ *dpp = dp;
+ return (rv);
+}
-/* $MirOS: contrib/code/jupp/config.h,v 1.7 2014/06/26 18:15:17 tg Exp $ */
-
#ifndef _JOE_CONFIG_H
#define _JOE_CONFIG_H
+/* see bottom for RCSID on this one */
+
#ifndef TEST
#include "autoconf.h"
#else
#define PARAMS(protos) protos
#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
#ifdef HAVE_SNPRINTF
#define joe_snprintf_0(buf,len,fmt) snprintf((buf),(len),(fmt))
#endif
-#define MAXINT ((((unsigned int)-1)/2)-1)
-#define MAXLONG ((((unsigned long)-1L)/2)-1)
-
#include <stdio.h>
#ifndef EOF
#define EOF -1
ATTR_BOUNDED((__string__, 1, 3));
#endif
+/* from mksh */
+
+#define BIT(i) (1U << (i))
+#define NELEM(a) (sizeof(a) / sizeof((a)[0]))
+
+#if defined(MirBSD) && (MirBSD >= 0x09A1) && \
+ defined(__ELF__) && defined(__GNUC__) && \
+ !defined(__llvm__) && !defined(__NWCC__)
+/*
+ * We got usable __IDSTRING __COPYRIGHT __RCSID __SCCSID macros
+ * which work for all cases; no need to redefine them using the
+ * "portable" macros from below when we might have the "better"
+ * gcc+ELF specific macros or other system dependent ones.
+ */
+#else
+#undef __IDSTRING
+#undef __IDSTRING_CONCAT
+#undef __IDSTRING_EXPAND
+#undef __COPYRIGHT
+#undef __RCSID
+#undef __SCCSID
+#define __IDSTRING_CONCAT(l,p) __LINTED__ ## l ## _ ## p
+#define __IDSTRING_EXPAND(l,p) __IDSTRING_CONCAT(l,p)
+#ifdef MKSH_DONT_EMIT_IDSTRING
+#define __IDSTRING(prefix, string) /* nothing */
+#elif defined(__ELF__) && defined(__GNUC__) && \
+ !defined(__llvm__) && !defined(__NWCC__) && !defined(NO_ASM)
+#define __IDSTRING(prefix, string) \
+ __asm__(".section .comment" \
+ "\n .ascii \"@(\"\"#)" #prefix ": \"" \
+ "\n .asciz \"" string "\"" \
+ "\n .previous")
+#else
+#define __IDSTRING(prefix, string) \
+ static const char __IDSTRING_EXPAND(__LINE__,prefix) [] \
+ __attribute__((__used__)) = "@(""#)" #prefix ": " string
+#endif
+#define __COPYRIGHT(x) __IDSTRING(copyright,x)
+#define __RCSID(x) __IDSTRING(rcsid,x)
+#define __SCCSID(x) __IDSTRING(sccsid,x)
+#endif
+
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/config.h,v 1.9 2017/12/02 02:07:26 tg Exp $");
+#endif
+
#endif /* ifndef _JOE_CONFIG_H */
--enable-win32reloc enable win32 self-relocation
--disable-largefile omit support for large files
--disable-fork disable use of fork
+ --disable-fpu disable use of floating point arithmetics
Some influential environment variables:
CC C compiler command
#define WANT_FORK $use_fork
_ACEOF
+if test $use_fork = 1; then
+ echo "Enabling use of fork(), concurrent subshells, etc."
+else
+ echo "DISabling use of fork() and concurrent subshells (NOMMU)!"
+fi
+
+# Check whether --enable-fpu was given.
+if test "${enable_fpu+set}" = set; then
+ enableval=$enable_fpu; use_fpu=$enableval
+else
+ use_fpu=yes
+fi
+
+if test x"$use_fpu" = x"no"; then
+ use_fpu=0
+else
+ use_fpu=1
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define WANT_MATH $use_fpu
+_ACEOF
+
+if test $use_fpu = 1; then
+ echo "Enabling use of floating point arithmetics"
+else
+ echo "DISabling Math support for lack of an FPU!"
+fi
+
{ echo "$as_me:$LINENO: checking whether strlcpy is declared" >&5
echo $ECHO_N "checking whether strlcpy is declared... $ECHO_C" >&6; }
-# $MirOS: contrib/code/jupp/configure.ac,v 1.57 2017/11/18 16:25:07 tg Exp $
+# $MirOS: contrib/code/jupp/configure.ac,v 1.59 2017/12/02 04:15:29 tg Exp $
#-
# Process this file with autoconf to produce a configure script.
*) use_fork=0 ;;
esac
AC_DEFINE_UNQUOTED([WANT_FORK], [$use_fork], [We have fork(2) and want to use it])
+if test $use_fork = 1; then
+ echo "Enabling use of fork(), concurrent subshells, etc."
+else
+ echo "DISabling use of fork() and concurrent subshells (NOMMU)!"
+fi
+
+AC_ARG_ENABLE([fpu],
+[ --disable-fpu disable use of floating point arithmetics],
+ use_fpu=$enableval, use_fpu=yes)
+if test x"$use_fpu" = x"no"; then
+ use_fpu=0
+else
+ use_fpu=1
+fi
+AC_DEFINE_UNQUOTED([WANT_MATH], [$use_fpu], [Can we use the FPU?])
+if test $use_fpu = 1; then
+ echo "Enabling use of floating point arithmetics"
+else
+ echo "DISabling Math support for lack of an FPU!"
+fi
+
AC_CHECK_DECLS([strlcpy, strlcat, popen])
AC_CHECK_DECLS([ctime], [], [], [AC_INCLUDES_DEFAULT
-/* $MirOS: contrib/code/jupp/dir.c,v 1.2 2008/05/13 13:08:21 tg Exp $ */
/*
* Directory package for older UNIXs
* Copyright
* This file is part of JOE (Joe's Own Editor)
*/
+__RCSID("$MirOS: contrib/code/jupp/dir.c,v 1.3 2017/12/02 02:07:26 tg Exp $");
+
struct direct {
short d_ino;
unsigned char d_name[14];
-/* $MirOS: contrib/code/jupp/hash.c,v 1.3 2017/01/10 19:16:27 tg Exp $ */
/*
* Simple hash table
* Copyright
#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/hash.c,v 1.4 2017/12/02 02:07:26 tg Exp $");
+
#include <stdlib.h>
#include <string.h>
-/* $MirOS: contrib/code/jupp/hash.h,v 1.2 2008/05/13 13:08:22 tg Exp $ */
/*
* Simple hash table
* Copyright
#ifndef _JOE_HASH_H
#define _JOE_HASH_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_CMD_C
+__RCSID("$MirOS: contrib/code/jupp/hash.h,v 1.3 2017/12/02 02:07:26 tg Exp $");
+#endif
unsigned long hash PARAMS((unsigned char *s));
HASH *htmk PARAMS((int len));
-/* $MirOS: contrib/code/jupp/help.c,v 1.10 2017/01/10 23:59:32 tg Exp $ */
/*
* Help system
* Copyright
#include "config.h"
#include "types.h"
-#include <stdio.h>
+__RCSID("$MirOS: contrib/code/jupp/help.c,v 1.11 2017/12/02 02:07:26 tg Exp $");
+
#include <stdlib.h>
#include <string.h>
-/* $MirOS: contrib/code/jupp/help.h,v 1.4 2012/12/30 19:50:32 tg Exp $ */
/*
* Help system
* Copyright
#ifndef _JOE_HELP_H
#define _JOE_HELP_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/help.h,v 1.5 2017/12/02 02:07:26 tg Exp $");
+#endif
extern struct help *help_actual;
#if 0
.if "0" == "1"
#endif
-/* $MirOS: contrib/code/jupp/i18n.c,v 1.24 2017/11/18 12:01:52 tg Exp $ */
/*
* UNICODE/ISO-10646 functions for JOE
* Copyright
#include <stdlib.h>
#endif
+__RCSID("$MirOS: contrib/code/jupp/i18n.c,v 1.26 2017/12/02 04:32:39 tg Exp $");
+
#include "charmap.h"
-#include "utf8.h"
-#include "i18n.h"
/* From: X11/xc/programs/xterm/wcwidth.c,v 1.10 */
-/* $MirOS: contrib/code/jupp/i18n.h,v 1.8 2017/07/08 16:23:26 tg Exp $ */
-
#ifndef _Ii18n
#define _Ii18n 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/i18n.h,v 1.9 2017/12/02 02:07:28 tg Exp $");
+#endif
#ifdef TEST_I18N
int joe_iswupper PARAMS((struct charmap *,int c));
-/* $MirOS: contrib/code/jupp/kbd.c,v 1.4 2017/01/10 19:16:27 tg Exp $ */
/*
* Key-map handler
* Copyright
#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/kbd.c,v 1.5 2017/12/02 02:07:28 tg Exp $");
+
#include <stdlib.h>
#include <string.h>
-/* $MirOS: contrib/code/jupp/kbd.h,v 1.2 2008/05/13 13:08:23 tg Exp $ */
/*
* Key-map handler
* Copyright
#ifndef _JOE_KBD_H
#define _JOE_KBD_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/kbd.h,v 1.3 2017/12/02 02:07:28 tg Exp $");
+#endif
/* KMAP *mkkmap(void);
* Create an empty keymap
-/* $MirOS: contrib/code/jupp/macro.c,v 1.8 2017/03/19 19:19:50 tg Exp $ */
/*
* Keyboard macros
* Copyright
#include "config.h"
#include "types.h"
-#include <stdio.h>
+__RCSID("$MirOS: contrib/code/jupp/macro.c,v 1.11 2017/12/02 04:32:40 tg Exp $");
+
#include <string.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#include "undo.h"
#include "utils.h"
#include "vs.h"
-#include "utf8.h"
#include "charmap.h"
#include "w.h"
if (notify)
*notify = 1;
- num = calc(bw, s);
+ num = calcl(bw, s);
if (merrf) {
msgnw(bw->parent, merrt);
return -1;
-/* $MirOS: contrib/code/jupp/macro.h,v 1.2 2008/05/13 13:08:23 tg Exp $ */
/*
* Keyboard macros
* Copyright
#ifndef _JOE_MACRO_H
#define _JOE_MACRO_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/macro.h,v 1.3 2017/12/02 02:07:28 tg Exp $");
+#endif
/* Set when macro is recording: for status line */
extern struct recmac *recmac;
-/* $MirOS: contrib/code/jupp/main.c,v 1.31 2017/08/08 21:39:28 tg Exp $ */
-
#define JUPP_IS_COPYRIGHT_C_BY "2017 mirabilos"
/*-
* Editor startup and main edit loop
*/
+#define EXTERN
#include "config.h"
#include "types.h"
-#include <stdio.h>
+__RCSID("$MirOS: contrib/code/jupp/main.c,v 1.33 2017/12/02 04:32:40 tg Exp $");
+
#include <fcntl.h>
#include <string.h>
#ifdef HAVE_STDLIB_H
#include "vfile.h"
#include "vs.h"
#include "w.h"
-#include "utf8.h"
#include "charmap.h"
#include "syntax.h"
-/* $MirOS: contrib/code/jupp/main.h,v 1.3 2012/12/22 00:06:12 tg Exp $ */
/*
* Editor startup and edit loop
* Copyright
#ifndef _JOE_MAIN_H
#define _JOE_MAIN_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_B_C
+__RCSID("$MirOS: contrib/code/jupp/main.h,v 1.4 2017/12/02 02:07:29 tg Exp $");
+#endif
extern const char null[];
-/* $MirOS: contrib/code/jupp/menu.c,v 1.7 2017/01/10 19:16:27 tg Exp $ */
/*
* Menu selection window
* Copyright
#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/menu.c,v 1.8 2017/12/02 02:07:29 tg Exp $");
+
#include <stdlib.h>
#include <string.h>
-/* $MirOS: contrib/code/jupp/menu.h,v 1.2 2008/05/13 13:08:23 tg Exp $ */
/*
* Menu selection window
* Copyright
#ifndef _JOE_MENU_H
#define _JOE_MENU_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_CMD_C
+__RCSID("$MirOS: contrib/code/jupp/menu.h,v 1.3 2017/12/02 02:07:29 tg Exp $");
+#endif
/* Create a menu */
/* FIXME: ??? ---> */
-/* $MirOS: contrib/code/jupp/path.c,v 1.12 2016/10/29 23:44:45 tg Exp $ */
/*
* Directory and path functions
* Copyright
#include "config.h"
#include "types.h"
-#include <stdio.h>
-#include <sys/types.h>
+__RCSID("$MirOS: contrib/code/jupp/path.c,v 1.13 2017/12/02 02:07:29 tg Exp $");
+
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
-/* $MirOS: contrib/code/jupp/path.h,v 1.11 2016/10/29 23:44:45 tg Exp $ */
/*
* Directory and path functions
* Copyright
#ifndef _JOE_PATH_H
#define _JOE_PATH_H 1
-#include "config.h"
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/path.h,v 1.12 2017/12/02 02:07:29 tg Exp $");
+#endif
#if defined(__MSDOS__) || defined(__DJGPP__) || defined(__EMX__) || \
defined(__CYGWIN__) || defined(_WIN32)
-/* $MirOS: contrib/code/jupp/poshist.c,v 1.2 2008/05/13 13:08:24 tg Exp $ */
/*
* Position history
* Copyright
#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/poshist.c,v 1.3 2017/12/02 02:07:29 tg Exp $");
+
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
-/* $MirOS: contrib/code/jupp/poshist.h,v 1.2 2008/05/13 13:08:24 tg Exp $ */
/*
* Position history
* Copyright
#ifndef _JOE_POSHIST_H
#define _JOE_POSHIST_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_CMD_C
+__RCSID("$MirOS: contrib/code/jupp/poshist.h,v 1.3 2017/12/02 02:07:29 tg Exp $");
+#endif
void afterpos PARAMS((void));
void aftermove PARAMS((W *w, P *p));
-/* $MirOS: contrib/code/jupp/pw.c,v 1.8 2017/01/11 22:56:48 tg Exp $ */
/*
* Prompt windows
* Copyright
#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/pw.c,v 1.9 2017/12/02 02:07:29 tg Exp $");
+
#include <stdlib.h>
#include <string.h>
-/* $MirOS: contrib/code/jupp/pw.h,v 1.4 2017/01/11 22:56:49 tg Exp $ */
/*
* Prompt windows
* Copyright
#ifndef _JOE_PW_H
#define _JOE_PW_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_CMD_C
+__RCSID("$MirOS: contrib/code/jupp/pw.h,v 1.5 2017/12/02 02:07:30 tg Exp $");
+#endif
/* BW *wmkpw(BW *bw,char *prompt,int (*func)(),char *huh,int (*abrt)(),
int (*tab)(),void *object,int *notify);
-/* $MirOS: contrib/code/jupp/queue.c,v 1.3 2017/01/10 19:16:27 tg Exp $ */
/*
* Doubly linked list primitives
* Copyright
#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/queue.c,v 1.4 2017/12/02 02:07:30 tg Exp $");
+
#include <stdlib.h>
#include "queue.h"
-/* $MirOS: contrib/code/jupp/queue.h,v 1.2 2008/05/13 13:08:24 tg Exp $ */
/*
* Doubly linked list primitives
* Copyright
#ifndef _JOE_QUEUE
#define _JOE_QUEUE 1
-#include "config.h"
+#ifdef EXTERN_B_C
+__RCSID("$MirOS: contrib/code/jupp/queue.h,v 1.3 2017/12/02 02:07:30 tg Exp $");
+#endif
extern void *ITEM;
extern void *QUEUE;
-/* $MirOS: contrib/code/jupp/qw.c,v 1.5 2017/01/10 19:16:27 tg Exp $ */
/*
* Query windows
* Copyright
#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/qw.c,v 1.7 2017/12/02 04:32:40 tg Exp $");
+
#include <stdlib.h>
#include "utils.h"
#include "vs.h"
#include "charmap.h"
#include "scrn.h"
-#include "utf8.h"
#include "w.h"
static void dispqw(QW *qw)
-/* $MirOS: contrib/code/jupp/qw.h,v 1.2 2008/05/13 13:08:24 tg Exp $ */
/*
* Single-key query windows
* Copyright
#ifndef _JOE_QW_H
#define _JOE_QW_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_UFILE_C
+__RCSID("$MirOS: contrib/code/jupp/qw.h,v 1.3 2017/12/02 02:07:30 tg Exp $");
+#endif
/* QW *mkqw(W *w, char *prompt, int (*func)(), int (*abrt)(), void *object);
* Create a query window for the given window
-/* $MirOS: contrib/code/jupp/rc.c,v 1.23 2017/03/19 19:19:50 tg Exp $ */
/*
* *rc file parser
* Copyright
*
* This file is part of JOE (Joe's Own Editor)
*/
+#define EXTERN_RC_C
#include "config.h"
#include "types.h"
-#include <stdio.h>
+__RCSID("$MirOS: contrib/code/jupp/rc.c,v 1.26 2017/12/02 04:32:41 tg Exp $");
+
#include <string.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#include "b.h"
#include "syntax.h"
#include "va.h"
-#include "utf8.h"
#include "charmap.h"
#include "w.h"
{
int ret = 0;
int x = *xx;
- int v;
+ long v;
joe_free(xx);
switch (glopts[x].type) {
ret = -1;
break;
}
- v = calc(bw, s);
+ v = calcl(bw, s);
if (merrf) {
msgnw(bw->parent, merrt);
ret = -1;
ret = -1;
break;
}
- v = calc(bw, s);
+ v = calcl(bw, s);
if (merrf) {
msgnw(bw->parent, merrt);
ret = -1;
ret = -1;
break;
}
- v = calc(bw, s) - 1.0;
+ v = calcldec(bw, s);
if (merrf) {
msgnw(bw->parent, merrt);
ret = -1;
-/* $MirOS: contrib/code/jupp/rc.h,v 1.4 2012/12/30 21:45:16 tg Exp $ */
/*
* *rc file parser
* Copyright
#ifndef _JOE_RC_H
#define _JOE_RC_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/rc.h,v 1.5 2017/12/02 02:07:31 tg Exp $");
+#endif
extern OPTIONS pdefault;
extern OPTIONS fdefault;
-/* $MirOS: contrib/code/jupp/regex.c,v 1.5 2012/12/22 00:06:13 tg Exp $ */
/*
* Regular expression subroutines
* Copyright
#include "config.h"
#include "types.h"
-#include <stdio.h>
+__RCSID("$MirOS: contrib/code/jupp/regex.c,v 1.7 2017/12/02 04:32:41 tg Exp $");
#include "b.h"
-#include "utf8.h"
#include "charmap.h"
#include "vs.h"
-/* $MirOS: contrib/code/jupp/regex.h,v 1.2 2008/05/13 13:08:24 tg Exp $ */
/*
* Regular expression subroutines
* Copyright
#ifndef _JOE_REGEX_H
#define _JOE_REGEX_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_RC_C
+__RCSID("$MirOS: contrib/code/jupp/regex.h,v 1.3 2017/12/02 02:07:31 tg Exp $");
+#endif
int escape PARAMS((int utf8,unsigned char **a, int *b));
int pmatch PARAMS((unsigned char **pieces, unsigned char *regex, int len, P *p, int n, int icase));
-/* $MirOS: contrib/code/jupp/scrn.c,v 1.27 2017/11/18 16:02:04 tg Exp $ */
/*
* Device independant TTY interface for JOE
* Copyright
#include "config.h"
#include "types.h"
-#include <stdio.h>
+__RCSID("$MirOS: contrib/code/jupp/scrn.c,v 1.30 2017/12/02 04:49:46 tg Exp $");
+
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include "scrn.h"
#include "termcap.h"
#include "charmap.h"
-#include "utf8.h"
#include "utils.h"
int skiptop = 0;
t->avattr |= INVERSE;
oops:
-
- if (assume_color) {
- /* Install color support if it looks like an ansi terminal (it has bold which begins with ESC [) */
-#ifndef TERMINFO
- if (!t->Sf && t->md && t->md[0]=='\\' && t->md[1]=='E' && t->md[2]=='[') {
+ if (assume_color && !t->Sf && t->md) {
+ /*
+ * Install colour support if this looks like an ANSI
+ * terminal — that is, it’s got bold with ESC ‘[’…
+ */
+ if (t->md[0] == '\\' && t->md[1] == 'E' && t->md[2] == '[') {
t->ut = 1;
t->Sf =US "\\E[3%dm";
t->Sb =US "\\E[4%dm";
- }
-#else
- if (!t->Sf && t->md && t->md[0]=='\033' && t->md[1]=='[') {
+ } else if (t->md[0] == '\033' && t->md[1] == '[') {
t->ut = 1;
t->Sf =US "\033[3%p1%dm";
t->Sb =US "\033[4%p1%dm";
}
-#endif
}
if (getnum(t->cap,US "sg") <= 0 && !t->mr && jgetstr(t->cap,US "se")) {
-/* $MirOS: contrib/code/jupp/scrn.h,v 1.5 2017/07/09 01:03:54 tg Exp $ */
/*
* Device independant tty interface for JOE
* Copyright
#ifndef _JOE_SCRN_H
#define _JOE_SCRN_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/scrn.h,v 1.6 2017/12/02 02:07:31 tg Exp $");
+#endif
#include "tty.h" /* ttputc() */
-/* $MirOS: contrib/code/jupp/selinux.c,v 1.7 2014/06/26 18:15:17 tg Exp $ */
-
#include "config.h"
+
+__RCSID("$MirOS: contrib/code/jupp/selinux.c,v 1.8 2017/12/02 02:07:31 tg Exp $");
+
#if defined(HAVE_SELINUX_HDR) && defined(HAVE_SELINUX_FUN)
#define WITH_SELINUX
#else
-/* $MirOS: contrib/code/jupp/syntax.c,v 1.17 2017/07/08 16:15:12 tg Exp $ */
/*
* Syntax highlighting DFA interpreter
* Copyright
*/
#include "config.h"
+#include "types.h"
+
+__RCSID("$MirOS: contrib/code/jupp/syntax.c,v 1.20 2017/12/02 04:36:56 tg Exp $");
+
+#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include "b.h"
-#include "types.h"
#include "scrn.h"
#include "utils.h"
#include "hash.h"
struct high_state *state=0; /* Current state */
struct high_syntax *syntax; /* New syntax table */
int line = 0;
+ void *np;
if (!name)
return NULL;
}
}
} else if(!parse_char(&p, '-')) { /* No. sync lines */
- if(parse_int(&p, &syntax->sync_lines))
+ syntax->sync_lines = (int)ustolb(p, &np,
+ INT_MIN, INT_MAX, USTOL_TRIM);
+ if (!np)
syntax->sync_lines = -1;
+ else
+ p = np;
} else {
c = parse_ws(&p,'#');
parse_ws(&p,'#');
if(!parse_char(&p,'=')) {
parse_ws(&p,'#');
- if(parse_int(&p,&cmd->recolor))
+ cmd->recolor = (int)ustolb(p, &np,
+ INT_MIN, INT_MAX, USTOL_TRIM);
+ if (!np)
fprintf(stderr,"%s:%d: Missing value for option %s\n", name, line, bf);
+ else
+ p = np;
} else
fprintf(stderr,"%s:%d: Missing value for option %s\n", name, line, bf);
} else if(!strcmp(bf,"strings") || !strcmp(bf,"istrings")) {
parse_ws(&p,'#');
if(!parse_char(&p,'=')) {
parse_ws(&p,'#');
- if(parse_int(&p,&kw_cmd->recolor))
+ kw_cmd->recolor = (int)ustolb(p, &np,
+ INT_MIN, INT_MAX, USTOL_TRIM);
+ if (!np)
fprintf(stderr,"%s:%d: Missing value for option %s\n", name, line, bf);
+ else
+ p = np;
} else
fprintf(stderr,"%s:%d: Missing value for option %s\n", name, line, bf);
} else
-/* $MirOS: contrib/code/jupp/syntax.h,v 1.3 2016/10/07 19:43:55 tg Exp $ */
-
#ifndef _Isyntax
#define _Isyntax 1
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/syntax.h,v 1.4 2017/12/02 02:07:32 tg Exp $");
+#endif
+
#include "hash.h"
/*
-/* $MirOS: contrib/code/jupp/tab.c,v 1.6 2017/01/10 19:16:28 tg Exp $ */
/*
* File selection menu
* Copyright
#include "config.h"
#include "types.h"
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
+__RCSID("$MirOS: contrib/code/jupp/tab.c,v 1.7 2017/12/02 02:07:32 tg Exp $");
+
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
-/* $MirOS: contrib/code/jupp/tab.h,v 1.2 2008/05/13 13:08:26 tg Exp $ */
/*
* File selection menu
* Copyright
#ifndef _JOE_TAB_H
#define _JOE_TAB_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_UFILE_C
+__RCSID("$MirOS: contrib/code/jupp/tab.h,v 1.3 2017/12/02 02:07:32 tg Exp $");
+#endif
int cmplt PARAMS((BW *bw));
-/* $MirOS: contrib/code/jupp/termcap.c,v 1.14 2017/08/08 16:12:04 tg Exp $ */
/*
* TERMCAP/TERMINFO database interface
* Copyright
#include "config.h"
#include "types.h"
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
+__RCSID("$MirOS: contrib/code/jupp/termcap.c,v 1.16 2017/12/02 04:46:10 tg Exp $");
+
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#ifdef TERMINFO
-#ifdef HAVE_TERM_H
-#endif
-#endif
#include "blocks.h"
#include "path.h"
-/* $MirOS: contrib/code/jupp/termcap.h,v 1.4 2010/04/08 15:31:04 tg Exp $ */
/*
* TERMCAP/TERMINFO header file
* Copyright
#ifndef _JOE_TERMCAP_H
#define _JOE_TERMCAP_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/termcap.h,v 1.5 2017/12/02 02:07:33 tg Exp $");
+#endif
/* CAP *getcap(char *s,int baud,void (*out)(void *outptr,char c),void *outptr);
*
-/* $MirOS: contrib/code/jupp/termidx.c,v 1.5 2014/03/04 23:04:12 tg Exp $ */
/*
* Program to generate termcap index file
* Copyright
*
* This file is part of JOE (Joe's Own Editor)
*/
+#define EXTERN
#include "config.h"
#include "types.h"
-#include <stdio.h>
+__RCSID("$MirOS: contrib/code/jupp/termidx.c,v 1.6 2017/12/02 02:07:33 tg Exp $");
+
#include <string.h>
static void gen(unsigned char *s, FILE *fd)
-/* $MirOS: contrib/code/jupp/tty.c,v 1.28 2017/11/18 17:08:44 tg Exp $ */
/*
* UNIX Tty and Process interface
* Copyright
#include "config.h"
#include "types.h"
-#include <sys/types.h>
+__RCSID("$MirOS: contrib/code/jupp/tty.c,v 1.30 2017/12/02 02:07:33 tg Exp $");
+
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
-#include <stdio.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
-/* $MirOS: contrib/code/jupp/tty.h,v 1.8 2017/11/18 16:43:08 tg Exp $ */
/*
* TTY interface header file
* Copyright
#ifndef _JOE_TTY_H
#define _JOE_TTY_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_CMD_C
+__RCSID("$MirOS: contrib/code/jupp/tty.h,v 1.9 2017/12/02 02:07:33 tg Exp $");
+#endif
/* void ttopen(void); Open the tty (attached to stdin) for use inside of JOE
*
-/* $MirOS: contrib/code/jupp/tw.c,v 1.12 2017/03/19 18:53:02 tg Exp $ */
/*
* Text editing windows
* Copyright
#include "config.h"
#include "types.h"
-#include <stdio.h>
+__RCSID("$MirOS: contrib/code/jupp/tw.c,v 1.13 2017/12/02 02:07:33 tg Exp $");
+
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_TIME_H
-/* $MirOS: contrib/code/jupp/tw.h,v 1.3 2009/10/18 14:52:57 tg Exp $ */
/*
* Text editing windows
* Copyright
#ifndef _JOE_TW_H
#define _JOE_TW_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/tw.h,v 1.4 2017/12/02 02:07:33 tg Exp $");
+#endif
BW *wmktw PARAMS((SCREEN *t, B *b));
-/* $MirOS: contrib/code/jupp/types.h,v 1.15 2017/01/11 22:56:49 tg Exp $ */
-
#ifndef _JOE_TYPES_H
#define _JOE_TYPES_H
-#include "config.h"
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/types.h,v 1.16 2017/12/02 02:07:33 tg Exp $");
+#endif
/* Prefix to make string constants unsigned */
#define US (unsigned char *)
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h> /* we need pid_t */
-#endif
-
-/* from mksh */
-#if defined(DEBUG) || defined(__COVERITY__)
-#define mkssert(e) do { if (!(e)) exit(255); } while (/* CONSTCOND */ 0)
-#else
-#define mkssert(e) do { } while (/* CONSTCOND */ 0)
-#endif
-
-/* from mksh */
-#define NELEM(a) (sizeof(a) / sizeof((a)[0]))
-
#define LINK(type) struct { type *next; type *prev; }
#define KEYS 256
-/* $MirOS: contrib/code/jupp/ublock.c,v 1.14 2017/11/18 16:30:21 tg Exp $ */
/*
* Highlighted block functions
* Copyright
#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/ublock.c,v 1.18 2017/12/02 04:32:41 tg Exp $");
+
#include <unistd.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
+#include <limits.h>
#include "b.h"
#include "pw.h"
#include "path.h"
#include "poshist.h"
#include "ushell.h"
-#include "utf8.h"
#include "charmap.h"
#include "w.h"
markk->line - markb->line + 1,
markk->xcol);
- tmp = bread(fr[0], MAXLONG);
+ tmp = bread(fr[0], LONG_MAX);
if (piscol(tmp->eof))
height = tmp->eof->line + 1;
else
if (!flg)
prgetc(p);
bdel(markb, p);
- binsb(p, bread(fr[0], MAXLONG));
+ binsb(p, bread(fr[0], LONG_MAX));
if (!flg) {
pset(p,markk);
prgetc(p);
-/* $MirOS: contrib/code/jupp/ublock.h,v 1.2 2008/05/13 13:08:27 tg Exp $ */
/*
* Highlighted block functions
* Copyright
#ifndef _JOE_UBLOCK_H
#define _JOE_UBLOCK_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_CMD_C
+__RCSID("$MirOS: contrib/code/jupp/ublock.h,v 1.3 2017/12/02 02:07:34 tg Exp $");
+#endif
extern int square;
extern int lightoff;
-/* $MirOS: contrib/code/jupp/uedit.c,v 1.17 2017/03/19 19:19:51 tg Exp $ */
/*
* Basic user edit functions
* Copyright
#include "config.h"
#include "types.h"
-#include <stdio.h>
+__RCSID("$MirOS: contrib/code/jupp/uedit.c,v 1.20 2017/12/02 04:32:42 tg Exp $");
+
#include <string.h>
#ifdef HAVE_BSD_STRING_H
#include "umath.h"
#include "utils.h"
#include "vs.h"
-#include "utf8.h"
#include "charmap.h"
#include "w.h"
static int doline(BW *bw, unsigned char *s, void *object, int *notify)
{
- long num = calc(bw, s);
+ long num = calcl(bw, s);
if (notify)
*notify = 1;
static int docol(BW *bw, unsigned char *s, void *object, int *notify)
{
- long num = calc(bw, s);
+ long num = calcl(bw, s);
if (notify)
*notify = 1;
static int dobyte(BW *bw, unsigned char *s, void *object, int *notify)
{
- long num = calc(bw, s);
+ long num = calcl(bw, s);
if (notify)
*notify = 1;
-/* $MirOS: contrib/code/jupp/uedit.h,v 1.5 2016/10/07 20:07:50 tg Exp $ */
/*
* Basic user edit functions
* Copyright
#ifndef _JOE_UEDIT_H
#define _JOE_UEDIT_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_CMD_C
+__RCSID("$MirOS: contrib/code/jupp/uedit.h,v 1.6 2017/12/02 02:07:34 tg Exp $");
+#endif
extern int pgamnt;
-/* $MirOS: contrib/code/jupp/uerror.c,v 1.4 2017/08/09 00:46:02 tg Exp $ */
/*
* Compiler error handler
* Copyright
#include "config.h"
#include "types.h"
-#include <stdio.h>
+__RCSID("$MirOS: contrib/code/jupp/uerror.c,v 1.5 2017/12/02 02:07:34 tg Exp $");
#include "b.h"
#include "bw.h"
-/* $MirOS: contrib/code/jupp/uerror.h,v 1.2 2008/05/13 13:08:27 tg Exp $ */
/*
* Compiler error handler
* Copyright
#ifndef _JOE_UERROR_H
#define _JOE_UERROR_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_B_C
+__RCSID("$MirOS: contrib/code/jupp/uerror.h,v 1.3 2017/12/02 02:07:34 tg Exp $");
+#endif
int unxterr PARAMS((BW *bw));
int uprverr PARAMS((BW *bw));
-/* $MirOS: contrib/code/jupp/ufile.c,v 1.12 2017/08/08 21:39:28 tg Exp $ */
/*
* User file operations
* Copyright
*
* This file is part of JOE (Joe's Own Editor)
*/
+#define EXTERN_UFILE_C
#include "config.h"
#include "types.h"
-#include <stdio.h>
+__RCSID("$MirOS: contrib/code/jupp/ufile.c,v 1.14 2017/12/02 04:32:42 tg Exp $");
+
#include <unistd.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#include "utils.h"
#include "va.h"
#include "vs.h"
-#include "utf8.h"
#include "charmap.h"
#include "w.h"
-/* $MirOS: contrib/code/jupp/ufile.h,v 1.4 2017/08/09 00:46:02 tg Exp $ */
/*
* User file operations
* Copyright
#ifndef _JOE_UFILE_H
#define _JOE_UFILE_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_CMD_C
+__RCSID("$MirOS: contrib/code/jupp/ufile.h,v 1.5 2017/12/02 02:07:35 tg Exp $");
+#endif
extern int exask;
-/* $MirOS: contrib/code/jupp/uformat.c,v 1.3 2010/04/08 15:31:05 tg Exp $ */
/*
* User text formatting functions
* Copyright
#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/uformat.c,v 1.4 2017/12/02 02:07:35 tg Exp $");
+
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
-/* $MirOS: contrib/code/jupp/uformat.h,v 1.2 2008/05/13 13:08:28 tg Exp $ */
/*
* User text formatting functions
* Copyright
#ifndef _JOE_UFORMAT_H
#define _JOE_UFORMAT_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_CMD_C
+__RCSID("$MirOS: contrib/code/jupp/uformat.h,v 1.3 2017/12/02 02:07:35 tg Exp $");
+#endif
int ucenter PARAMS((BW *bw));
P *pbop PARAMS((P *p));
-/* $MirOS: contrib/code/jupp/uisrch.c,v 1.7 2017/01/10 19:16:28 tg Exp $ */
/*
* Incremental search
* Copyright
#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/uisrch.c,v 1.9 2017/12/02 04:32:42 tg Exp $");
+
#include <stdlib.h>
#include "b.h"
#include "usearch.h"
#include "utils.h"
#include "charmap.h"
-#include "utf8.h"
#include "vs.h"
extern int smode;
-/* $MirOS: contrib/code/jupp/uisrch.h,v 1.2 2008/05/13 13:08:28 tg Exp $ */
/*
* Incremental search
* Copyright
#ifndef _JOE_UISRCH_H
#define _JOE_UISRCH_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_CMD_C
+__RCSID("$MirOS: contrib/code/jupp/uisrch.h,v 1.3 2017/12/02 02:07:35 tg Exp $");
+#endif
int uisrch PARAMS((BW *bw));
int ursrch PARAMS((BW *bw));
-/* $MirOS: contrib/code/jupp/umath.c,v 1.7 2017/03/19 19:19:51 tg Exp $ */
/*
* Math
* Copyright
#include "config.h"
#include "types.h"
-#include <stdio.h>
+__RCSID("$MirOS: contrib/code/jupp/umath.c,v 1.11 2017/12/02 04:32:42 tg Exp $");
+
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include "pw.h"
#include "utils.h"
#include "vs.h"
-#include "utf8.h"
#include "charmap.h"
#include "w.h"
volatile sig_atomic_t merrf;
const unsigned char *merrt;
+#if WANT_MATH
static char math_res[JOE_MSGBUFSIZE];
static char *math_exp;
while ((*ptr >= '0' && *ptr <= '9') || ((*ptr | 0x20) >= 'a' && (*ptr | 0x20) <= 'f'))
++ptr;
} else if ((*ptr >= '0' && *ptr <= '9') || *ptr == '.') {
- sscanf((char *)ptr, "%lf", &x);
- while ((*ptr >= '0' && *ptr <= '9') || *ptr == '.' || *ptr == 'e' || *ptr == 'E')
- ++ptr;
+ x = strtod(ptr, &ptr);
} else if (*ptr == '(') {
++ptr;
x = expr(0, &v);
binss(bw->cursor, (void *)math_res);
return 0;
}
+#else
+long
+calcl(BW *bw, unsigned char *s)
+{
+ long rv;
+ void *cp = NULL;
+
+ rv = ustol(s, &cp, USTOL_TRIM | USTOL_EOS);
+ if (!cp) {
+ rv = 0;
+ merrt = US "Invalid or out-of-range number";
+ merrf = 1;
+ }
+ return (rv);
+}
+
+int
+unomath(BW *bw)
+{
+ msgnw(bw->parent, US "Sorry, compiled without Math");
+ return (-1);
+}
+#endif
-/* $MirOS: contrib/code/jupp/umath.h,v 1.5 2017/03/19 19:19:51 tg Exp $ */
/*
* Math
* Copyright
#ifndef _JOE_UMATH_H
#define _JOE_UMATH_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_CMD_C
+__RCSID("$MirOS: contrib/code/jupp/umath.h,v 1.8 2017/12/02 04:15:29 tg Exp $");
+#endif
#ifdef HAVE_SIGNAL_H
#include <signal.h>
extern volatile sig_atomic_t merrf;
extern const unsigned char *merrt;
+#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
-/* $MirOS: contrib/code/jupp/undo.c,v 1.3 2010/04/08 15:31:05 tg Exp $ */
/*
* UNDO system
* Copyright
#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/undo.c,v 1.4 2017/12/02 02:07:36 tg Exp $");
+
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
-/* $MirOS: contrib/code/jupp/undo.h,v 1.2 2008/05/13 13:08:29 tg Exp $ */
/*
* UNDO system
* Copyright
#ifndef _JOE_UNDO_H
#define _JOE_UNDO_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_B_C
+__RCSID("$MirOS: contrib/code/jupp/undo.h,v 1.3 2017/12/02 02:07:36 tg Exp $");
+#endif
extern int inundo;
extern int justkilled;
-/* $MirOS: contrib/code/jupp/usearch.c,v 1.10 2017/01/11 22:56:50 tg Exp $ */
/*
* Search & Replace system
* Copyright
#include "config.h"
#include "types.h"
-#include <stdio.h>
+__RCSID("$MirOS: contrib/code/jupp/usearch.c,v 1.11 2017/12/02 02:07:36 tg Exp $");
+
#include <stdlib.h>
#include "b.h"
-/* $MirOS: contrib/code/jupp/usearch.h,v 1.2 2008/05/13 13:08:29 tg Exp $ */
/*
* Search & Replace system
* Copyright
#ifndef _JOE_USEARCH_H
#define _JOE_USEARCH_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_CMD_C
+__RCSID("$MirOS: contrib/code/jupp/usearch.h,v 1.3 2017/12/02 02:07:36 tg Exp $");
+#endif
SRCH *mksrch PARAMS((unsigned char *pattern, unsigned char *replacement, int ignore, int backwards, int repeat, int replace, int rest));
void rmsrch PARAMS((SRCH *srch));
-/* $MirOS: contrib/code/jupp/ushell.c,v 1.6 2017/11/18 17:05:51 tg Exp $ */
/*
* Shell-window functions
* Copyright
#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/ushell.c,v 1.8 2017/12/02 02:07:36 tg Exp $");
+
#include <unistd.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
-/* $MirOS: contrib/code/jupp/ushell.h,v 1.3 2012/12/30 18:18:07 tg Exp $ */
/*
* Shell-window functions
* Copyright (C) 1992 Joseph H. Allen
#ifndef _JOE_USHELL_H
#define _JOE_USHELL_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_CMD_C
+__RCSID("$MirOS: contrib/code/jupp/ushell.h,v 1.4 2017/12/02 02:07:36 tg Exp $");
+#endif
int ubknd PARAMS((BW *bw));
int ukillpid PARAMS((BW *bw));
-/* $MirOS: contrib/code/jupp/utag.c,v 1.3 2017/08/09 00:46:02 tg Exp $ */
/*
* tags file symbol lookup
* Copyright
#include "config.h"
#include "types.h"
-#include <stdio.h>
+__RCSID("$MirOS: contrib/code/jupp/utag.c,v 1.5 2017/12/02 04:32:43 tg Exp $");
#include "b.h"
#include "bw.h"
#include "usearch.h"
#include "utils.h"
#include "vs.h"
-#include "utf8.h"
#include "charmap.h"
#include "w.h"
-/* $MirOS: contrib/code/jupp/utag.h,v 1.2 2008/05/13 13:08:30 tg Exp $ */
/*
* tags file symbol lookup
* Copyright
#ifndef _JOE_UTAG_H
#define _JOE_UTAG_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN_CMD_C
+__RCSID("$MirOS: contrib/code/jupp/utag.h,v 1.3 2017/12/02 02:07:37 tg Exp $");
+#endif
int utag PARAMS((BW *bw));
-/* $MirOS: contrib/code/jupp/utf8.c,v 1.19 2017/01/11 21:48:58 tg Exp $ */
/*
* UTF-8 Utilities
* Copyright
#include "config.h"
#include "types.h"
-#include <stdio.h>
+__RCSID("$MirOS: contrib/code/jupp/utf8.c,v 1.21 2017/12/02 04:32:43 tg Exp $");
+
#include <string.h>
#ifdef HAVE_STDLIB_H
#endif
#include "rc.h"
-#include "utf8.h"
#include "charmap.h"
/* UTF-8 Encoder
-/* $MirOS: contrib/code/jupp/utf8.h,v 1.4 2013/11/07 21:50:36 tg Exp $ */
/*
* UTF-8 Utilities
* Copyright
#ifndef _Iutf8
#define _Iutf8 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/utf8.h,v 1.5 2017/12/02 02:07:37 tg Exp $");
+#endif
#include "i18n.h"
-/* $MirOS: contrib/code/jupp/utils.c,v 1.4 2017/01/10 19:05:17 tg Exp $ */
/*
* Various utilities
* Copyright
*/
#include "config.h"
+__RCSID("$MirOS: contrib/code/jupp/utils.c,v 1.7 2017/12/02 04:32:43 tg Exp $");
+
#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#include <stdlib.h>
#endif
-#include "i18n.h"
-#include "utf8.h"
#include "charmap.h"
#include "blocks.h"
#include "utils.h"
return -1;
}
-/* Parse an integer. Returns 0 for success. */
-
-int parse_int(unsigned char **pp, int *buf)
-{
- unsigned char *p = *pp;
- if ((*p>='0' && *p<='9') || *p=='-') {
- *buf = atoi((char *)p);
- if(*p=='-')
- ++p;
- while(*p>='0' && *p<='9')
- ++p;
- *pp = p;
- return 0;
- } else
- return -1;
-}
-
/* Parse a string into a buffer. Returns 0 for success.
Leaves escape sequences in string. */
-/* $MirOS: contrib/code/jupp/utils.h,v 1.4 2017/01/10 19:05:17 tg Exp $ */
/*
* Various utilities
*
#ifndef _JOE_UTILS_H
#define _JOE_UTILS_H 1
-#include "config.h"
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h> /* we need size_t, ssize_t */
+#ifdef EXTERN_B_C
+__RCSID("$MirOS: contrib/code/jupp/utils.h,v 1.7 2017/12/02 03:52:35 tg Exp $");
#endif
+
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
int parse_tows PARAMS((unsigned char **p,unsigned char *buf));
int parse_field PARAMS((unsigned char **p,unsigned char *field));
int parse_char PARAMS((unsigned char **p,unsigned char c));
-int parse_int PARAMS((unsigned char **p,int *buf));
int parse_string PARAMS((unsigned char **p,unsigned char *buf,int len));
int parse_range PARAMS((unsigned char **p,int *first,int *second));
void tty_xonoffbaudrst(void);
+/* from compat.c */
+
+#define USTOL_AUTO 0x00
+#define USTOL_DEC 0x01
+#define USTOL_HEX 0x02
+#define USTOL_OCT 0x03
+#define USTOL_LTRIM 0x04
+#define USTOL_RTRIM 0x08
+#define USTOL_TRIM 0x0C
+#define USTOL_EOS 0x10
+
+long ustol(void *, void **, int);
+long ustolb(void *, void **, long, long, int);
+
+#define USTOC_MAX 4 /* arbitrary, but at least 4 */
+
+size_t ustoc_hex(const void *, int *, size_t);
+size_t ustoc_oct(const void *, int *, size_t);
+
#endif
-/* $MirOS: contrib/code/jupp/va.c,v 1.3 2012/06/08 16:55:29 tg Exp $ */
/*
* Variable length array of strings
* Copyright
*/
#include "config.h"
+__RCSID("$MirOS: contrib/code/jupp/va.c,v 1.4 2017/12/02 02:07:37 tg Exp $");
+
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
-/* $MirOS: contrib/code/jupp/va.h,v 1.3 2012/06/08 16:55:29 tg Exp $ */
/*
* Variable length arrays of strings
* Copyright
#ifndef _JOE_VA_H
#define _JOE_VA_H 1
-#include "config.h"
+#ifdef EXTERN_B_C
+__RCSID("$MirOS: contrib/code/jupp/va.h,v 1.4 2017/12/02 02:07:37 tg Exp $");
+#endif
#include "vs.h"
-/* $MirOS: contrib/code/jupp/vfile.c,v 1.8 2013/08/19 22:03:20 tg Exp $ */
/*
* Software virtual memory system
* Copyright
#include "config.h"
#include "types.h"
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
+__RCSID("$MirOS: contrib/code/jupp/vfile.c,v 1.10 2017/12/02 02:07:38 tg Exp $");
+
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#include <fcntl.h>
+#include <limits.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
for (vfile = vfiles.link.next; vfile != &vfiles; vfile = vfile->link.next) {
last = -1;
loop:
- addr = MAXLONG;
+ addr = LONG_MAX;
vlowest = NULL;
for (x = 0; x != HTSIZE; x++)
for (vp = htab[x]; vp; vp = vp->next)
int x;
loop:
- addr = MAXLONG;
+ addr = LONG_MAX;
vlowest = NULL;
for (x = 0; x != HTSIZE; x++)
for (vp = htab[x]; vp; vp = vp->next)
-/* $MirOS: contrib/code/jupp/vfile.h,v 1.3 2012/06/08 16:55:29 tg Exp $ */
/*
* Software virtual memory system
* Copyright
#ifndef _JOE_VFILE_H
#define _JOE_VFILE_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/vfile.h,v 1.4 2017/12/02 02:07:38 tg Exp $");
+#endif
/* Additions:
*
-/* $MirOS: contrib/code/jupp/vs.c,v 1.9 2017/01/10 19:16:28 tg Exp $ */
/*
* Variable length strings
* Copyright
#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/vs.c,v 1.10 2017/12/02 02:07:38 tg Exp $");
+
#include <stdlib.h>
#include "blocks.h"
if (!vary || pos + len > sSIZ(vary))
vary = vsensure(vary, pos + len);
- mkssert(vary != NULL);
if (pos + len > olen) {
vary[pos + len] = vary[olen];
sLen(vary) = pos + len;
-/* $MirOS: contrib/code/jupp/vs.h,v 1.6 2016/10/30 00:19:58 tg Exp $ */
/*
* Dynamic string library
* Copyright
#ifndef _JOE_VS_H
#define _JOE_VS_H 1
-#include "config.h"
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/vs.h,v 1.7 2017/12/02 02:07:38 tg Exp $");
+#endif
#include <string.h>
-/* $MirOS: contrib/code/jupp/w.c,v 1.7 2017/01/11 22:56:50 tg Exp $ */
/*
* Window system
* Copyright
#include "config.h"
#include "types.h"
+__RCSID("$MirOS: contrib/code/jupp/w.c,v 1.8 2017/12/02 02:07:38 tg Exp $");
+
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
-/* $MirOS: contrib/code/jupp/w.h,v 1.4 2017/01/11 22:56:50 tg Exp $ */
/*
* Window management
* Copyright
#ifndef _JOE_W_H
#define _JOE_W_H 1
-#include "config.h"
-#include "types.h"
+#ifdef EXTERN
+__RCSID("$MirOS: contrib/code/jupp/w.h,v 1.5 2017/12/02 02:07:38 tg Exp $");
+#endif
/***************/
/* Subroutines */
-/* $MirOS: contrib/code/jupp/win32.c,v 1.3 2017/01/11 21:48:58 tg Exp $ */
-
/*-
* Copyright (c) 2016, 2017
* mirabilos <m@mirbsd.org>
* of said person's immediate fault when using the work as intended.
*/
+#include "config.h"
+
+__RCSID("$MirOS: contrib/code/jupp/win32.c,v 1.4 2017/12/02 02:07:39 tg Exp $");
+
#ifdef __CYGWIN__
#include <cygwin/version.h>