diff --git a/CHANGES b/CHANGES
index 942a16d..29a07f7 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,20 @@
+New in release 1.3.2
+====================
+
+* configure: checking term.h and ncurses/term.h
+* cast in bmore.c in putline();
+* ported to compile under DJGPP v2.0 w/ PDCURSES (by simoN)
+* fixed multiple file handling for "bmore" (by simoN)
+* renamed several local screen processing routines to avoid compiler conflicts
+* several minor fixes to "bmore" code (by simoN)
+* reset tty after CTRL-C in bmore
+* -c option in bmore (clear before displaying)
+* -n num option in bmore (display the indicated number of lines in each
+ screenful
+* -w num option in bmore (display the indicated number of bytes in each
+ line)
+
+
New in release 1.3.1
====================
diff --git a/CREDITS b/CREDITS
index 92b05d1..306802c 100644
--- a/CREDITS
+++ b/CREDITS
@@ -9,13 +9,14 @@ Claudio Nieder Makefile
Nico Schmidt r-bug fix
Steve Waltner Mac OS X support
Andre Wobst AIX fixes
-SimoN bmore: subshell support fixes
+SimoN bmore: subshell support fixes, DJGPP support
Packages:
Christian "naddy" Weisgerber Source RPM
Christian Kurz Debian package
Stijn de Bekker Debian package
Troy Engel i386 RPM package
+Thomas Steudten RH alpha and x86 RPM package
Doc:
Sven Guckes
diff --git a/Makefile.in b/Makefile.in
index a0bef99..55e9b25 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -6,8 +6,8 @@
# "autoconf" program (constructs like "@foo@" will get replaced in the
# actual Makefile.
#
-# Copyright (c) 1996-2000 by Gerhard Buergmann
-# Gerhard.Buergmann@altavista.net
+# Copyright (c) 1996-2003 by Gerhard Buergmann
+# gerhard@puon.at
#
# 1996-01-18 V 1.0.0
# 1999-01-15 V 1.1.0
@@ -15,6 +15,7 @@
# 1999-10-22 V 1.2.0
# 2000-05-31 V 1.3.0 beta
# 2000-10-01 V 1.3.0 final
+# 2003-07-03 V 1.3.2
#
###############################################
@@ -24,7 +25,7 @@ exec_prefix = @exec_prefix@
bindir = $(DESTDIR)@bindir@
mandir = $(DESTDIR)@mandir@
-datadir = $(DESTDIR)@datadir@
+libdir = $(DESTDIR)@libdir@
man1dir = $(mandir)/man1
@@ -57,7 +58,7 @@ bmore: $(BMOBJ)
$(CC) $(CFLAGS) $(DEFS) -c $<
bmore.o: bmore.c
- $(CC) $(CFLAGS) $(DEFS) -DHELPFILE=\"$(datadir)/bmore.help\" -c $<
+ $(CC) $(CFLAGS) $(DEFS) -DHELPFILE=\"$(libdir)/bmore.help\" -c $<
install: all installdirs
@@ -65,14 +66,14 @@ install: all installdirs
@$(INSTALL_DATA) bvi.1 bmore.1 $(man1dir)
@$(INSTALL_PROGRAM) -s bvi $(bindir)
@$(INSTALL_PROGRAM) -s bmore $(bindir)
- @$(INSTALL_DATA) bmore.help $(datadir)
+ @$(INSTALL_DATA) bmore.help $(libdir)
@if [ -f $(bindir)/bview ]; then rm $(bindir)/bview; fi
@if [ -f $(bindir)/bvedit ]; then rm $(bindir)/bvedit; fi
@ln $(bindir)/bvi $(bindir)/bview
@ln $(bindir)/bvi $(bindir)/bvedit
installdirs:
- $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(datadir) $(man1dir)
+ $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(libdir) $(man1dir)
uninstall:
@echo "Uninstalling bvi"
@@ -80,12 +81,12 @@ uninstall:
@if [ -f $(bindir)/bvedit ]; then rm $(bindir)/bvedit; fi
@if [ -f $(bindir)/bvi ]; then rm $(bindir)/bvi; fi
@if [ -f $(bindir)/bmore ]; then rm $(bindir)/bmore; fi
- @if [ -f $(datadir)/bmore.help ]; then rm $(datadir)/bmore.help; fi
+ @if [ -f $(libdir)/bmore.help ]; then rm $(libdir)/bmore.help; fi
@if [ -f $(man1dir)/bvi.1 ]; then rm $(man1dir)/bvi.1; fi
@if [ -f $(man1dir)/bmore.1 ]; then rm $(man1dir)/bmore.1; fi
clean:
- rm -f core *.o bvi bmore a.out
+ rm -f core *.o bvi bvi.exe bmore bmore.exe a.out
distclean: clean
rm -f Makefile config.cache config.h config.log config.status
diff --git a/README b/README
index 67bc989..b80a99b 100644
--- a/README
+++ b/README
@@ -9,8 +9,8 @@ and is distributed under the GPL (GNU Public License).
How to compile
==============
- gunzip -c bvi-1.3.1.tar.gz | tar xvf -
- cd bvi-1.3.1
+ gunzip -c bvi-1.3.2.tar.gz | tar xvf -
+ cd bvi-1.3.2
./configure
make
make install
@@ -39,6 +39,6 @@ comments, questions, etc. (even flames) to:
Gerhard Buergmann
Vienna, Austria
-E-mail: Gerhard.Buergmann@utanet.at
+E-mail: gerhard@puon.at
diff --git a/acconfig.h b/acconfig.h
index eb56d2d..8941d4c 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -5,3 +5,7 @@
#undef HAVE_CURSES_H
#undef NO_SYSERRL
+
+#undef NEED_PUTC_CHAR
+
+#undef HAVE_NCURSES_TERM_H
diff --git a/bm_dos.c b/bm_dos.c
index 45d7f83..29ccf8c 100755
--- a/bm_dos.c
+++ b/bm_dos.c
@@ -3,11 +3,12 @@
* 2000-05-10 V 1.3.0 alpha
* 2000-07-07 V 1.3.0 final
* 2001-12-07 V 1.3.1
+ * 2003-07-03 V 1.3.2
*
* NOTE: Edit this file with tabstop=4 !
*
- * Copyright 1996-2000 by Gerhard Buergmann
- * Gerhard.Buergmann@altavista.net
+ * Copyright 1996-2003 by Gerhard Buergmann
+ * gerhard@puon.at
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -81,24 +82,47 @@ char *cmd;
{
system(cmd);
printf("\r");
- clrscr();
+ clearscreen();
fseek(curr_file, screen_home, SEEK_SET);
bytepos = screen_home;
}
+void
+highlight()
+{
+ highvideo();
+}
+
+
+void
+normal()
+{
+ normvideo();
+}
+
+
+void
+clearscreen()
+{
+ clrscr();
+}
+
+
void
home()
{
- /*
- tputs(Home, 1, putch);
-
- screenlines = 0;
- */
gotoxy(1, 1);
}
+/* force clear to end of line */
+cleartoeol()
+{
+ clreol();
+}
+
+
int
vgetc()
{
@@ -106,15 +130,3 @@ vgetc()
}
-/*
- * force clear to end of line
- */
-cleareol()
-{
- /*
- tputs(erase_ln, 1, putch);
- */
- clreol();
-}
-
-
diff --git a/bm_unix.c b/bm_unix.c
index b97b82d..7da803c 100644
--- a/bm_unix.c
+++ b/bm_unix.c
@@ -1,13 +1,14 @@
-/* BM_UNIX.C - Unix specific subroutines for BMORE
+/* bm_unix.c - Unix specific subroutines for BMORE
*
* 2000-05-31 V 1.3.0 beta
* 2000-10-12 V 1.3.0 final
* 2002-02-10 V 1.3.1
+ * 2003-07-04 V 1.3.2
*
* NOTE: Edit this file with tabstop=4 !
*
- * Copyright 1996-2002 by Gerhard Buergmann
- * Gerhard.Buergmann@altavista.net
+ * Copyright 1996-2003 by Gerhard Buergmann
+ * gerhard@puon.at
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -80,12 +81,21 @@ initterm()
no_tty = tcgetattr(fileno(stdout), &ostate);
if (!no_tty) {
nstate = ostate;
+ /*
+ * is this really necessary??
+ *
+ nstate.c_lflag &= ~(ICANON|ECHO|ECHOE|ECHONL);
+ */
nstate.c_lflag &= ~(ICANON|ECHO|ECHOE|ECHONL);
nstate.c_cc[VMIN] = 1;
nstate.c_cc[VTIME] = 0;
tcsetattr(fileno(stdin), TCSADRAIN, &nstate);
}
+#ifdef DJGPP
+ maxx = 80;
+ maxy = 25;
+#else
if ((term = getenv("TERM")) == 0 || tgetent(buf, term) <= 0) {
printf("Dumb terminal\n");
maxx = 80;
@@ -99,6 +109,7 @@ initterm()
clear_sc = tgetstr("cl", &clearptr);
rev_start = tgetstr("so", &clearptr);
rev_end = tgetstr("se", &clearptr);
+#endif
no_intty = tcgetattr(fileno(stdin), &ostate);
tcgetattr(fileno(stderr), &ostate);
@@ -129,12 +140,12 @@ reset_tty()
void
-sig()
+sig(sig)
+ int sig;
{
- signal(SIGINT, sig);
- signal(SIGQUIT, sig);
-
- got_int = TRUE;
+ reset_tty();
+ printf("\r\n");
+ exit(0);
}
@@ -145,12 +156,15 @@ void
doshell(cmd)
char *cmd;
{
+#ifndef DJGPP
char *getenv();
char *shell;
char cline[128];
+#endif
printf("\n");
+#ifndef DJGPP
if ((shell = getenv("SHELL")) == NULL) shell = "sh";
else if(strrchr(shell,'/')) shell=(char *)(strrchr(shell,'/')+1);
@@ -161,6 +175,7 @@ doshell(cmd)
sprintf(cline, "%s -c \"%s\"", shell, cmd);
cmd = cline;
}
+#endif
reset_tty();
system(cmd);
@@ -173,40 +188,68 @@ doshell(cmd)
void
-highvideo()
+highlight()
{
+#ifndef DJGPP
if (rev_start && rev_end)
tputs(rev_start, 1, putchr);
+#endif
}
void
-normvideo()
+normal()
{
+#ifndef DJGPP
if (rev_start && rev_end)
tputs(rev_end, 1, putchr);
+#endif
}
void
-clrscr()
+clearscreen()
{
- tputs(clear_sc, 1, putchr);
+#ifdef DJGPP
+ /* if (!no_tty)
+ {
+ int n;
+
+ for (n = 0; n < maxy; n++) {
+ cleartoeol();
+ printf("\n");
+ }
+ } */
+#else
+ tputs(clear_sc, 1, putchr);
+#endif
}
void
home()
{
- tputs(Home, 1, putchr);
+#ifdef DJGPP
+ if (!no_tty) printf("\r");
+#else
+ tputs(Home, 1, putchr);
+#endif
}
/* force clear to end of line */
void
-clreol()
+cleartoeol()
{
+#ifdef DJGPP
+ int n;
+
+ home();
+ if (!no_tty) for (n = 1; n < maxx; n++) printf(" ");
+ home();
+#else
tputs(erase_ln, 1, putchr);
+#endif
}
diff --git a/bmore.1 b/bmore.1
index 429eabd..4749154 100644
--- a/bmore.1
+++ b/bmore.1
@@ -1,10 +1,14 @@
-.TH BMORE 1 "3 Jan 2002"
+.TH BMORE 1 "3 Jan 2004"
.SH NAME
bmore \- browse through a binary file
.SH SYNOPSIS
.B bmore
[
-.B \-adi
+.B \-acdi
+] [
+.B \-n \fIlines\fP
+] [
+.B \-w \fIcols\fP
] [
.B +\fIlinenumber\fP
] [
@@ -76,6 +80,9 @@ except that a header is printed before each file in a series.
ASCII mode: no hex representation of the contents. Non printable
characters are displayed as a dot (.)
.TP
+.B \-c
+Clear before displaying. Redrawing the screen instead of scrolling.
+.TP
.B \-d
Display error messages rather than ringing the terminal bell if
an unrecognized command is used.
@@ -84,6 +91,14 @@ This is helpful for inexperienced users.
.B \-i
Ignore case for searching.
.TP
+.B \-n \fIlines\fP
+Displays the indicated number of \fIlines\fP in each screenful,
+rather than the default (the number of lines in the terminal screen
+less two).
+.TP
+.B \-w \fIcols\fP
+Display number of \fIcols\fP in each line.
+.TP
.BI + linenumber\fP
Start up at
.IR linenumber .
diff --git a/bmore.c b/bmore.c
index e1a3500..d7c9485 100644
--- a/bmore.c
+++ b/bmore.c
@@ -5,11 +5,12 @@
* 2000-05-31 V 1.3.0 beta
* 2000-10-18 V 1.3.0 final
* 2002-01-16 V 1.3.1
+ * 2004-01-09 V 1.3.2
*
* NOTE: Edit this file with tabstop=4 !
*
- * Copyright 1990-2002 by Gerhard Buergmann
- * Gerhard.Buergmann@altavista.net
+ * Copyright 1990-2004 by Gerhard Buergmann
+ * gerhard@puon.at
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -31,20 +32,25 @@
# include
#endif
-#ifdef __MSDOS__
+#if defined(__MSDOS__) && !defined(DJGPP)
# define PRINTF cprintf
#else
# define PRINTF printf
#ifndef HELPFILE
-# define HELPFILE "/usr/local/share/bmore.help"
+# ifdef DJGPP
+# define HELPFILE "/dev/env/DJDIR/lib/bmore.help"
+# else
+# define HELPFILE "/usr/local/lib/bmore.help"
+# endif
#endif
#endif
#include "bmore.h"
-char *copyright = "Copyright (C) 1990-2002 by Gerhard Buergmann";
+char *copyright = "Copyright (C) 1990-2004 by Gerhard Buergmann";
int maxx, maxy;
+int mymaxx = 0, mymaxy = 0;
char *name = NULL;
char sstring[MAXCMD] = ""; /* string for search */
char estring[MAXCMD] = ""; /* string for shell escape */
@@ -62,11 +68,12 @@ char numarr[64]; /* string for collecting number */
char addr_form[15];
int ascii_flag = 0;
-int d_flag = 0;
+int c_flag = 0, d_flag = 0;
+int exval = 0;
int init_search = 0;
char buffer1[MAXCMD], buffer2[MAXCMD];
int out_len;
-int corr = 0, to_print;
+int corr = 0, do_header = 0, to_print;
off_t init_byte = 0;
off_t last_search = 0;
off_t screen_home, filesize;
@@ -74,7 +81,7 @@ off_t bytepos, oldpos;
int prompt = 1;
char helppath[MAXCMD];
-static char *progname;
+static char progname[10];
static char cmdbuf[MAXCMD];
static int cnt = 0;
static int icnt = 0;
@@ -86,12 +93,15 @@ char *emptyclass = "Empty byte class '[]' or '[^]'";
/* -a ASCII mode
* -d beginners mode
+ * -c clear before displaying
* -i ignore case
+ * -n number of lines/screen
+ * -w width of screen
*/
void
usage()
{
- fprintf(stderr, "Usage: %s [-adi] [+linenum | +/pattern] name1 name2 ...\n", progname);
+ fprintf(stderr, "Usage: %s [-acdi] [-lines] [+linenum | +/pattern] name1 name2 ...\n", progname);
exit(1);
}
@@ -108,15 +118,14 @@ main(argc, argv)
long count;
int i, n = 1;
int d_line, r_line, z_line;
-
-
-#ifdef __MSDOS__
char *poi;
+
+#if defined(__MSDOS__) && !defined(DJGPP)
strcpy(helppath, argv[0]);
poi = strrchr(helppath, '\\');
*poi = '\0';
- strcat(helppath, "\\MORE.HLP");
+ strcat(helppath, "\\BMORE.HLP");
#else
strncpy(helppath, HELPFILE, MAXCMD - 1);
#endif
@@ -125,23 +134,46 @@ main(argc, argv)
setlocale(LC_ALL, "");
#endif
- progname = argv[0];
+ poi = strrchr(argv[0], DELIM);
+
+ if (poi) strncpy(progname, ++poi, 9);
+ else strncpy(progname, argv[0], 9);
+ strtok(progname, ".");
while (n < argc) {
switch (argv[n][0]) {
case '-':
- i = 1;
- while (argv[n][i] != '\0') {
- switch (argv[n][i]) {
- case 'a': ascii_flag++;
- break;
- case 'd': d_flag++;
- break;
- case 'i': ignore_case++;
- break;
- default: usage();
+ if (argv[n][1] >= '0' && argv[n][1] <= '9') {
+ sscanf(&argv[n][1], "%dx%d", &mymaxy, &mymaxx);
+ } else if (argv[n][1] == 'n') {
+ if (argv[n+1] == NULL || argv[n+1][0] == '-') {
+ usage();
+ } else {
+ sscanf(&argv[++n][0], "%d", &mymaxy);
+ }
+ } else if (argv[n][1] == 'w') {
+ if (argv[n+1] == NULL || argv[n+1][0] == '-') {
+ usage();
+ } else {
+ sscanf(&argv[++n][0], "%d", &mymaxx);
+ }
+ } else {
+ i = 1;
+ while (argv[n][i] != '\0') {
+ switch (argv[n][i]) {
+ case 'a': ascii_flag++;
+ break;
+ case 'c': c_flag++;
+ break;
+ case 'd': d_flag++;
+ break;
+ case 'i': ignore_case++;
+ break;
+ default:
+ usage();
+ }
+ i++;
}
- i++;
}
n++;
break;
@@ -166,24 +198,35 @@ main(argc, argv)
break;
}
}
- if (numfiles == 0) {
- curr_file = stdin;
- if (isatty(fileno(stdin)) != 0) usage();
- } else {
- open_file(name);
- file_nr = 1;
- fseek(curr_file, init_byte, SEEK_SET);
- bytepos += init_byte;
- }
- screen_home = bytepos;
-
initterm();
set_tty();
maxy -= 2;
+ if (mymaxy) {
+ maxy = mymaxy;
+ }
z_line = maxy;
d_line = maxy / 2;
r_line = 1;
+ if (numfiles == 0) {
+ curr_file = stdin;
+ if (isatty(fileno(stdin)) != 0) {
+ reset_tty();
+ usage();
+ }
+ } else {
+ file_nr = 1;
+ while (open_file(name)) {
+ do_next(1);
+ }
+ if (exval) {
+ } else {
+ fseek(curr_file, init_byte, SEEK_SET);
+ bytepos += init_byte;
+ }
+ }
+ screen_home = bytepos;
+
AnzAdd = 10;
strcpy(addr_form, "%08lX ");
@@ -191,24 +234,42 @@ main(argc, argv)
out_len = ((maxx - AnzAdd - 1) / 4) * 4;
else
out_len = ((maxx - AnzAdd - 1) / 16) * 4;
+ if (mymaxx) {
+ out_len = mymaxx;
+ }
if (init_search)
bmsearch(init_search);
if (no_tty) {
- while(!printout(1));
+ int fileloop;
+
+ for (fileloop = 0; fileloop < numfiles; fileloop++) {
+ while(!printout(1));
+ do_next(1);
+ open_file(name);
+ }
fclose(curr_file);
reset_tty();
- exit(0);
+ exit(exval);
}
- if (printout(maxy)) {
- do_next(1);
+ if (!exval) {
+ if (printout(maxy)) {
+ do_next(1);
+ }
}
+ signal(SIGINT, sig);
+ signal(SIGQUIT, sig);
/* main loop */
do {
to_print = 0;
if (prompt) {
- highvideo();
+ if (prompt == 2) {
+ while (open_file(name)) {
+ do_next(1);
+ }
+ }
+ highlight();
PRINTF("--More--");
if (prompt == 2) {
PRINTF("(Next file: %s)", name);
@@ -217,13 +278,15 @@ main(argc, argv)
}
if (d_flag) PRINTF("[Press space to continue, 'q' to quit]");
- normvideo();
+ normal();
fflush(stdout);
}
ch = vgetc();
+ /*
if (prompt == 2) {
open_file(name);
}
+ */
prompt = 1;
PRINTF("\r");
while (ch >= '0' && ch <= '9') {
@@ -262,10 +325,10 @@ main(argc, argv)
break;
case 'q':
case 'Q':
- clreol();
+ cleartoeol();
fclose(curr_file);
reset_tty();
- exit(0);
+ exit(exval);
case ':' :
switch (colon) {
case 'f':
@@ -282,7 +345,7 @@ main(argc, argv)
if (precount < 1) precount = 1;
do_next(precount);
PRINTF("\r");
- clreol();
+ cleartoeol();
PRINTF("\n...Skipping to file %s\r\n\r\n", name);
prompt = 2;
break;
@@ -290,19 +353,19 @@ main(argc, argv)
if (precount < 1) precount = 1;
do_next(-precount);
PRINTF("\r");
- clreol();
+ cleartoeol();
PRINTF("\n...Skipping back to file %s\r\n\r\n", name);
prompt = 2;
break;
case 'q':
- clreol();
+ cleartoeol();
fclose(curr_file);
reset_tty();
- exit(0);
+ exit(exval);
break;
case '!':
if (!no_intty) {
- clreol();
+ cleartoeol();
if (rdline(colon, estring)) break;
doshell(estring);
PRINTF("------------------------\r\n");
@@ -314,7 +377,7 @@ main(argc, argv)
break;
case '!':
if (!no_intty) {
- clreol();
+ cleartoeol();
if (rdline(ch, estring)) break;
doshell(estring);
PRINTF("------------------------\r\n");
@@ -329,7 +392,7 @@ main(argc, argv)
if (no_intty) {
bmbeep();
} else {
- clrscr();
+ clearscreen();
to_print = maxy + 1;
fseek(curr_file, screen_home, SEEK_SET);
bytepos = screen_home;
@@ -363,7 +426,7 @@ main(argc, argv)
count = precount;
}
putchar('\r');
- clreol();
+ cleartoeol();
PRINTF("\n...skipping %ld line", count);
if (count > 1) {
PRINTF("s\r\n\r\n");
@@ -382,7 +445,7 @@ main(argc, argv)
}
case '/': /**** Search String ****/
if (!repeat) {
- clreol();
+ cleartoeol();
if (rdline(ch, sstring)) break;
}
case 'n': /**** Search Next ****/
@@ -401,13 +464,13 @@ main(argc, argv)
screen_home = bytepos;
to_print = maxy;
PRINTF("\r");
- clreol();
+ cleartoeol();
PRINTF("\n\r\n***Back***\r\n\r\n");
}
break;
case '=':
prompt = 0;
- clreol();
+ cleartoeol();
PRINTF("%lX hex %lu dec", (unsigned long)bytepos,
(unsigned long)bytepos);
fflush(stdout);
@@ -426,7 +489,7 @@ main(argc, argv)
case 'w':
case 'v':
if (!no_intty) {
- clreol();
+ cleartoeol();
if (ch == 'v') {
sprintf(string, "bvi +%lu %s",
(unsigned long)(screen_home +
@@ -482,7 +545,7 @@ rdline(ch, sstring)
if (i) {
sstring[--i] = '\0';
PRINTF("\r%c%s", ch, sstring);
- clreol();
+ cleartoeol();
} else {
ch1 = ESC;
break;
@@ -504,7 +567,7 @@ rdline(ch, sstring)
}
if (ch1 == ESC) {
putchar('\r');
- clreol();
+ cleartoeol();
return 1;
}
if (i) sstring[i] = '\0';
@@ -520,7 +583,7 @@ do_next(n)
if (n == 1 && file_nr == numfiles) {
fclose(curr_file);
reset_tty();
- exit(0);
+ exit(exval);
}
if ((file_nr + n) > numfiles)
file_nr = numfiles;
@@ -534,12 +597,12 @@ do_next(n)
} else {
fclose(curr_file);
reset_tty();
- exit(0);
+ exit(exval);
}
}
-void
+int
open_file(name)
char *name;
{
@@ -548,19 +611,15 @@ open_file(name)
if (stat(name, &buf) > -1) {
filesize = buf.st_size;
}
- if (numfiles > 1) {
- PRINTF("\r");
- clreol();
- PRINTF("\n::::::::::::::\r\n%s\r\n::::::::::::::\r\n", name);
- corr = 2;
- }
if (curr_file != NULL) fclose(curr_file);
+ if (numfiles > 1) do_header = 1;
if ((curr_file = fopen(name, "rb")) == NULL) {
- /* reset_tty(); */
perror(name);
- exit(1);
+ exval = 1;
+ return 1;
}
bytepos = screen_home = 0;
+ return 0;
}
@@ -572,7 +631,7 @@ putline(buf, num)
int print_pos;
unsigned char ch;
- PRINTF(addr_form, bytepos);
+ PRINTF(addr_form, (unsigned long)bytepos);
for (print_pos = 0; print_pos < num; print_pos++) {
ch = buf[print_pos];
if (!ascii_flag) {
@@ -592,7 +651,8 @@ putline(buf, num)
*(string + print_pos) = ' ';
}
*(string + num) = '\0';
- PRINTF("%s\r\n", string);
+ if (no_tty) PRINTF("%s\n", string);
+ else PRINTF("%s\r\n", string);
}
@@ -604,6 +664,20 @@ printout(lns)
int doub = 0;
static int flag;
+ if (c_flag) {
+ clearscreen();
+ }
+ if (do_header) {
+ if (no_tty) {
+ PRINTF("::::::::::::::\n%s\n::::::::::::::\n", name);
+ } else {
+ PRINTF("\r");
+ cleartoeol();
+ PRINTF("::::::::::::::\r\n%s\r\n::::::::::::::\r\n", name);
+ }
+ do_header = 0;
+ corr = 2;
+ }
if (corr && (lns > maxy - 2)) lns -= corr;
corr = 0;
do {
@@ -619,7 +693,7 @@ printout(lns)
lns--;
} else {
if (flag) {
- clreol();
+ cleartoeol();
PRINTF("*\r\n");
lns--;
} else {
@@ -855,10 +929,10 @@ emsg(s)
char *s;
{
putchar('\r');
- clreol();
- highvideo();
+ cleartoeol();
+ highlight();
PRINTF(s);
- normvideo();
+ normal();
fflush(stdout);
prompt = 0;
}
diff --git a/bmore.c.old b/bmore.c.old
new file mode 100644
index 0000000..ad016b9
--- /dev/null
+++ b/bmore.c.old
@@ -0,0 +1,871 @@
+/* BMORE - binary more
+ *
+ * 1990-01-31 V 1.0.0
+ * 1990-09-04 V 1.1.0
+ * 2000-05-31 V 1.3.0 beta
+ * 2000-10-18 V 1.3.0 final
+ * 2002-01-16 V 1.3.1
+ * 2002-02-22 V 1.3.2 line 576
+ *
+ * NOTE: Edit this file with tabstop=4 !
+ *
+ * Copyright 1990-2003 by Gerhard Buergmann
+ * gerhard@puon.at
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * See file COPYING for information on distribution conditions.
+ */
+
+
+#include
+
+#ifdef HAVE_LOCALE_H
+# include
+#endif
+
+#ifdef __MSDOS__
+# define PRINTF cprintf
+#else
+# define PRINTF printf
+#ifndef HELPFILE
+# define HELPFILE "/usr/local/share/bmore.help"
+#endif
+#endif
+
+#include "bmore.h"
+
+char *copyright = "Copyright (C) 1990-2003 by Gerhard Buergmann";
+
+int maxx, maxy;
+char *name = NULL;
+char sstring[MAXCMD] = ""; /* string for search */
+char estring[MAXCMD] = ""; /* string for shell escape */
+char string[MAXCMD];
+FILE *curr_file = NULL, *help_file;
+int AnzAdd;
+long precount = -1; /* number preceding command */
+
+char **files; /* list of input files */
+int numfiles; /* number of input files */
+int file_nr = 0; /* number of current input file */
+
+int arrnum = 0;
+char numarr[64]; /* string for collecting number */
+char addr_form[15];
+
+int ascii_flag = 0;
+int d_flag = 0;
+int init_search = 0;
+char buffer1[MAXCMD], buffer2[MAXCMD];
+int out_len;
+int corr = 0, to_print;
+off_t init_byte = 0;
+off_t last_search = 0;
+off_t screen_home, filesize;
+off_t bytepos, oldpos;
+int prompt = 1;
+char helppath[MAXCMD];
+
+static char *progname;
+static char cmdbuf[MAXCMD];
+static int cnt = 0;
+static int icnt = 0;
+static int smode;
+
+char search_pat[BUFFER]; /* / or ? command */
+char *emptyclass = "Empty byte class '[]' or '[^]'";
+
+
+/* -a ASCII mode
+ * -d beginners mode
+ * -i ignore case
+ */
+void
+usage()
+{
+ fprintf(stderr, "Usage: %s [-adi] [+linenum | +/pattern] name1 name2 ...\n", progname);
+ exit(1);
+}
+
+
+int
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int ch, ch1;
+ int colon = 0, last_ch = 0;
+ long last_pre = 0;
+ int lflag, repeat;
+ long count;
+ int i, n = 1;
+ int d_line, r_line, z_line;
+
+
+#ifdef __MSDOS__
+ char *poi;
+
+ strcpy(helppath, argv[0]);
+ poi = strrchr(helppath, '\\');
+ *poi = '\0';
+ strcat(helppath, "\\MORE.HLP");
+#else
+ strncpy(helppath, HELPFILE, MAXCMD - 1);
+#endif
+
+#ifdef HAVE_LOCALE_H
+ setlocale(LC_ALL, "");
+#endif
+
+ progname = argv[0];
+
+ while (n < argc) {
+ switch (argv[n][0]) {
+ case '-':
+ i = 1;
+ while (argv[n][i] != '\0') {
+ switch (argv[n][i]) {
+ case 'a': ascii_flag++;
+ break;
+ case 'd': d_flag++;
+ break;
+ case 'i': ignore_case++;
+ break;
+ default: usage();
+ }
+ i++;
+ }
+ n++;
+ break;
+ case '+': /* +cmd */
+ if (argv[n][1] == '/' || argv[n][1] == '\\') {
+ init_search = argv[n][1];
+ strcpy(sstring, &argv[n][2]);
+ } else {
+ if (argv[n][1] == '0') {
+ init_byte = (off_t)strtol(argv[n] + 1, NULL, 16);
+ } else {
+ init_byte = (off_t)strtol(argv[n] + 1, NULL, 10);
+ }
+ }
+ n++;
+ break;
+ default: /* must be a file name */
+ name = strdup(argv[n]);
+ files = &(argv[n]);
+ numfiles = argc - n;
+ n = argc;
+ break;
+ }
+ }
+ if (numfiles == 0) {
+ curr_file = stdin;
+ if (isatty(fileno(stdin)) != 0) usage();
+ } else {
+ open_file(name);
+ file_nr = 1;
+ fseek(curr_file, init_byte, SEEK_SET);
+ bytepos += init_byte;
+ }
+ screen_home = bytepos;
+
+ initterm();
+ set_tty();
+ maxy -= 2;
+ z_line = maxy;
+ d_line = maxy / 2;
+ r_line = 1;
+
+ AnzAdd = 10;
+ strcpy(addr_form, "%08lX ");
+
+ if (ascii_flag)
+ out_len = ((maxx - AnzAdd - 1) / 4) * 4;
+ else
+ out_len = ((maxx - AnzAdd - 1) / 16) * 4;
+
+ if (init_search)
+ bmsearch(init_search);
+
+ if (no_tty) {
+ while(!printout(1));
+ fclose(curr_file);
+ reset_tty();
+ exit(0);
+ }
+ if (printout(maxy)) {
+ do_next(1);
+ }
+ /* main loop */
+ do {
+ to_print = 0;
+ if (prompt) {
+ highvideo();
+ PRINTF("--More--");
+ if (prompt == 2) {
+ PRINTF("(Next file: %s)", name);
+ } else if (!no_intty && filesize) {
+ PRINTF("(%d%%)", (int)((bytepos * 100) / filesize));
+ }
+
+ if (d_flag) PRINTF("[Press space to continue, 'q' to quit]");
+ normvideo();
+ fflush(stdout);
+ }
+ ch = vgetc();
+ if (prompt == 2) {
+ open_file(name);
+ }
+ prompt = 1;
+ PRINTF("\r");
+ while (ch >= '0' && ch <= '9') {
+ numarr[arrnum++] = ch;
+ ch = vgetc();
+ }
+ numarr[arrnum] = '\0';
+ if (arrnum != 0) precount = strtol(numarr, (char **)NULL, 10);
+ else precount = -1;
+ lflag = arrnum = 0;
+
+ if (ch == '.') {
+ precount = last_pre;
+ ch = last_ch;
+ repeat = 1;
+ } else {
+ last_pre = precount;
+ last_ch = ch;
+ if (ch == ':') colon = vgetc();
+ repeat = 0;
+ }
+
+ switch (ch) {
+ case ' ': /* Display next k lines of text [current screen size] */
+ if (precount > 0) to_print = precount;
+ else to_print = maxy;
+ break;
+ case 'z': /* Display next k lines of bytes [current screen size]* */
+ if (precount > 0) z_line = precount;
+ to_print = z_line;
+ break;
+ case '\r':
+ case '\n': /* Display next k lines of text [current screen size]* */
+ if (precount > 0) r_line = precount;
+ to_print = r_line;
+ break;
+ case 'q':
+ case 'Q':
+ clreol();
+ fclose(curr_file);
+ reset_tty();
+ exit(0);
+ case ':' :
+ switch (colon) {
+ case 'f':
+ prompt = 0;
+ if (!no_intty)
+ PRINTF("\"%s\" line %lu", name,
+ (unsigned long)(bytepos - out_len));
+ else
+ PRINTF("[Not a file] line %lu",
+ (unsigned long)(bytepos - out_len));
+ fflush(stdout);
+ break;
+ case 'n':
+ if (precount < 1) precount = 1;
+ do_next(precount);
+ PRINTF("\r");
+ clreol();
+ PRINTF("\n...Skipping to file %s\r\n\r\n", name);
+ prompt = 2;
+ break;
+ case 'p':
+ if (precount < 1) precount = 1;
+ do_next(-precount);
+ PRINTF("\r");
+ clreol();
+ PRINTF("\n...Skipping back to file %s\r\n\r\n", name);
+ prompt = 2;
+ break;
+ case 'q':
+ clreol();
+ fclose(curr_file);
+ reset_tty();
+ exit(0);
+ break;
+ case '!':
+ if (!no_intty) {
+ clreol();
+ if (rdline(colon, estring)) break;
+ doshell(estring);
+ PRINTF("------------------------\r\n");
+ break;
+ }
+ default:
+ bmbeep();
+ }
+ break;
+ case '!':
+ if (!no_intty) {
+ clreol();
+ if (rdline(ch, estring)) break;
+ doshell(estring);
+ PRINTF("------------------------\r\n");
+ break;
+ }
+ case 'd': /* Scroll k lines [current scroll size, initially 11]* */
+ case BVICTRL('D'):
+ if (precount > 0) d_line = precount;
+ to_print = d_line;
+ break;
+ case BVICTRL('L'): /*** REDRAW SCREEN ***/
+ if (no_intty) {
+ bmbeep();
+ } else {
+ clrscr();
+ to_print = maxy + 1;
+ fseek(curr_file, screen_home, SEEK_SET);
+ bytepos = screen_home;
+ }
+ break;
+ case 'b': /* Skip backwards k screenfuls of text [1] */
+ case BVICTRL('B'):
+ if (no_intty) {
+ bmbeep();
+ } else {
+ if (precount < 1) precount = 1;
+ PRINTF("...back %ld page", precount);
+ if (precount > 1) {
+ PRINTF("s\r\n");
+ } else {
+ PRINTF("\r\n");
+ }
+ screen_home -= (maxy + 1) * out_len;
+ if (screen_home < 0) screen_home = 0;
+ fseek(curr_file, screen_home, SEEK_SET);
+ bytepos = screen_home;
+ to_print = maxy + 1;
+ }
+ break;
+ case 'f': /* Skip forward k screenfuls of bytes [1] */
+ case 's': /* Skip forward k lines of bytes [1] */
+ if (precount < 1) precount = 1;
+ if (ch == 'f') {
+ count = maxy * precount;
+ } else {
+ count = precount;
+ }
+ putchar('\r');
+ clreol();
+ PRINTF("\n...skipping %ld line", count);
+ if (count > 1) {
+ PRINTF("s\r\n\r\n");
+ } else {
+ PRINTF("\r\n\r\n");
+ }
+ screen_home += (count + maxy) * out_len;
+ fseek(curr_file, screen_home, SEEK_SET);
+ bytepos = screen_home;
+ to_print = maxy;
+ break;
+ case '\\':
+ if (ascii_flag) {
+ bmbeep();
+ break;
+ }
+ case '/': /**** Search String ****/
+ if (!repeat) {
+ clreol();
+ if (rdline(ch, sstring)) break;
+ }
+ case 'n': /**** Search Next ****/
+ case 'N':
+ bmsearch(ch);
+ /*
+ to_print--;
+ */
+ break;
+ case '\'':
+ if (no_intty) {
+ bmbeep();
+ } else {
+ bytepos = last_search;
+ fseek(curr_file, bytepos, SEEK_SET);
+ screen_home = bytepos;
+ to_print = maxy;
+ PRINTF("\r");
+ clreol();
+ PRINTF("\n\r\n***Back***\r\n\r\n");
+ }
+ break;
+ case '=':
+ prompt = 0;
+ clreol();
+ PRINTF("%lX hex %lu dec", (unsigned long)bytepos,
+ (unsigned long)bytepos);
+ fflush(stdout);
+ break;
+ case '?':
+ case 'h':
+ if ((help_file = fopen(helppath, "r")) == NULL) {
+ emsg("Can't open help file");
+ break;
+ }
+ while ((ch1 = getc(help_file)) != EOF)
+ putchar(ch1);
+ fclose(help_file);
+ to_print = 0;
+ break;
+ case 'w':
+ case 'v':
+ if (!no_intty) {
+ clreol();
+ if (ch == 'v') {
+ sprintf(string, "bvi +%lu %s",
+ (unsigned long)(screen_home +
+ (maxy + 1) / 2 * out_len), name);
+ } else {
+ if (precount < 1) precount = bytepos - screen_home;
+ sprintf(string, "bvi -b %lu -s %lu %s",
+ (unsigned long)screen_home,
+ (unsigned long)precount, name);
+ }
+ doshell(string);
+ to_print = maxy + 1;
+ break;
+ }
+ default :
+ if (d_flag) {
+ emsg("[Press 'h' for instructions.]");
+ } else {
+ bmbeep();
+ }
+ break;
+ }
+ if (to_print) {
+ if (printout(to_print)) {
+ do_next(1);
+ }
+ }
+ } while (1);
+}
+
+
+int
+rdline(ch, sstring)
+ int ch;
+ char *sstring;
+{
+ int i = 0;
+ int ch1 = 0;
+ char bstring[MAXCMD];
+
+ if (ch == '!') {
+ strcpy(bstring, sstring);
+ sstring[0] = '\0';
+ }
+ putchar(ch);
+ fflush(stdout);
+
+ while (i < MAXCMD) {
+ ch1 = vgetc();
+ if (ch1 == '\n' || ch1 == '\r' || ch1 == ESC) {
+ break;
+ } else if (ch1 == 8) {
+ if (i) {
+ sstring[--i] = '\0';
+ PRINTF("\r%c%s", ch, sstring);
+ clreol();
+ } else {
+ ch1 = ESC;
+ break;
+ }
+ } else if (ch1 == '!' && i == 0) {
+ if (bstring[0] == '\0') {
+ emsg("No previous command");
+ return 1;
+ }
+ putchar(ch1);
+ PRINTF("\r%c%s", ch, bstring);
+ strcat(sstring, bstring);
+ i = strlen(sstring);
+ } else {
+ putchar(ch1);
+ sstring[i++] = ch1;
+ }
+ fflush(stdout);
+ }
+ if (ch1 == ESC) {
+ putchar('\r');
+ clreol();
+ return 1;
+ }
+ if (i) sstring[i] = '\0';
+ return 0;
+}
+
+
+void
+do_next(n)
+ int n;
+{
+ if (numfiles) {
+ if (n == 1 && file_nr == numfiles) {
+ fclose(curr_file);
+ reset_tty();
+ exit(0);
+ }
+ if ((file_nr + n) > numfiles)
+ file_nr = numfiles;
+ else if ((file_nr + n) < 1)
+ file_nr = 1;
+ else
+ file_nr += n;
+ prompt = 2;
+ free(name);
+ name = strdup(*(files + file_nr - 1));
+ } else {
+ fclose(curr_file);
+ reset_tty();
+ exit(0);
+ }
+}
+
+
+void
+open_file(name)
+ char *name;
+{
+ struct stat buf;
+
+ if (stat(name, &buf) > -1) {
+ filesize = buf.st_size;
+ }
+ if (numfiles > 1) {
+ PRINTF("\r");
+ clreol();
+ PRINTF("\n::::::::::::::\r\n%s\r\n::::::::::::::\r\n", name);
+ corr = 2;
+ }
+ if (curr_file != NULL) fclose(curr_file);
+ if ((curr_file = fopen(name, "rb")) == NULL) {
+ /* reset_tty(); */
+ perror(name);
+ exit(1);
+ }
+ bytepos = screen_home = 0;
+}
+
+
+void
+putline(buf, num)
+ char *buf;
+ int num;
+{
+ int print_pos;
+ unsigned char ch;
+
+ PRINTF(addr_form, (unsigned long)bytepos);
+ for (print_pos = 0; print_pos < num; print_pos++) {
+ ch = buf[print_pos];
+ if (!ascii_flag) {
+ PRINTF("%02X ", ch);
+ }
+ ++bytepos;
+ if ((ch > 31) && (ch < 127))
+ *(string + print_pos) = ch;
+ else
+ *(string + print_pos) = '.';
+ }
+ for (; print_pos < out_len; print_pos++) {
+ if (!ascii_flag) {
+ PRINTF(" ");
+ }
+ ++bytepos;
+ *(string + print_pos) = ' ';
+ }
+ *(string + num) = '\0';
+ PRINTF("%s\r\n", string);
+}
+
+
+int
+printout(lns)
+ int lns;
+{
+ int c, num;
+ int doub = 0;
+ static int flag;
+
+ if (corr && (lns > maxy - 2)) lns -= corr;
+ corr = 0;
+ do {
+ for (num = 0; num < out_len; num++) {
+ if ((c = nextchar()) == -1) break;
+ buffer1[num] = c;
+ }
+ if (!num) return 1;
+ if (memcmp(buffer1, buffer2, num) || !bytepos ) {
+ memcpy(buffer2, buffer1, num);
+ putline(buffer2, num);
+ if (!no_tty) flag = TRUE;
+ lns--;
+ } else {
+ if (flag) {
+ clreol();
+ PRINTF("*\r\n");
+ lns--;
+ } else {
+ doub++;
+ }
+ flag = FALSE;
+ bytepos += num;
+ }
+ if (lns == 0) {
+ screen_home = bytepos - ((maxy + 1 + doub) * out_len);
+ if (screen_home < 0) screen_home = 0;
+ return 0;
+ }
+ } while(num);
+ return 1;
+}
+
+
+int
+nextchar()
+{
+ if (cnt == 0) return fgetc(curr_file);
+ cnt--;
+ return cmdbuf[icnt++] & 0xff;
+}
+
+
+void
+pushback(n, where)
+ int n;
+ char *where;
+{
+ if (cnt) memmove(cmdbuf + n, cmdbuf, n);
+ memcpy(cmdbuf, where, n);
+ icnt = 0;
+ cnt += n;
+}
+
+
+
+
+/* Return:
+ * -1 EOF
+ * 0 not found at current position
+ * 1 found
+ */
+int
+bmregexec(scan)
+ char *scan;
+{
+ char *act;
+ int count, test;
+ int l;
+ char act_pat[MAXCMD]; /* found pattern */
+
+ act = act_pat;
+ l = 0;
+ while (*scan != 0) {
+ if ((test = nextchar()) == -1) return -1;
+ *act++ = test;
+ if (++l == MAXCMD) {
+ pushback(l, act_pat);
+ return 0;
+ }
+ if (ignore_case && smode == ASCII) test = toupper(test);
+ switch (*scan++) {
+ case ONE: /* exactly one character */
+ count = *scan++;
+ if (count == 1) {
+ if (test != *scan) {
+ bytepos++;
+ if (l > 1) pushback(--l, act_pat + 1);
+ return 0;
+ }
+ scan++;
+ } else if (count > 1) {
+ if (sbracket(test, scan, count)) {
+ bytepos++;
+ if (l > 1) pushback(--l, act_pat + 1);
+ return 0;
+ }
+ scan += count;
+ }
+ break;
+ case STAR: /* zero or more characters */
+ count = *scan++;
+ if (count == 1) { /* only one character, 0 - n times */
+ while (test == *scan) {
+ if ((test = nextchar()) == -1) return -2;
+ *act++ = test;
+ if (++l == MAXCMD) {
+ pushback(l, act_pat);
+ return 0;
+ }
+ if (ignore_case && smode == ASCII)
+ test = toupper(test);
+ }
+ pushback(1, --act);
+ l--;
+ scan++;
+ } else if (count > 1) { /* characters in bracket */
+ if (*scan == '^') {
+ do {
+/* If we found something matching the next part of the expression, we
+ * abandon the search for not-matching characters. */
+ if (bmregexec(scan + count)) {
+ *act++ = test; /* May be wrong case !! */
+ l++;
+ scan += count;
+ bytepos--;
+ break;
+ }
+ if (sbracket(test, scan, count)) {
+ bytepos++;
+ if (l > 1) pushback(--l, act_pat + 1);
+ return 0;
+ } else {
+ if ((test = nextchar()) == -1) return -3;
+ *act++ = test;
+ if (++l == MAXCMD) {
+ pushback(l, act_pat);
+ return 0;
+ }
+ if (ignore_case && smode == ASCII)
+ test = toupper(test);
+ }
+ } while(1);
+ } else {
+ while(!sbracket(test, scan, count)) {
+ if ((test = nextchar()) == -1) return -4;
+ *act++ = test;
+ if (++l == MAXCMD) {
+ pushback(l, act_pat);
+ return 0;
+ }
+ if (ignore_case && smode == ASCII)
+ test = toupper(test);
+ }
+ scan += count;
+ pushback(1, --act);
+ l--;
+ }
+ } else { /* ".*" */
+ do {
+ if ((test = nextchar()) == -1) return -5;
+ *act++ = test;
+ if (++l == MAXCMD) {
+ pushback(l, act_pat);
+ return 0;
+ }
+ pushback(1, act - 1);
+ bytepos--;
+ } while (bmregexec(scan) == 0);
+ bytepos++;
+ act--;
+ l--;
+ }
+ break;
+ }
+ }
+ pushback(l, act_pat);
+ return 1; /* found */
+}
+
+
+int
+sbracket(start, scan, count)
+ int start;
+ char *scan;
+ int count;
+{
+ if (*scan++ == '^') {
+ if (!memchr(scan, start, --count)) return 0;
+ } else {
+ if (memchr(scan, start, --count)) return 0;
+ }
+ return 1;
+}
+
+
+void
+bmsearch(ch)
+ int ch;
+{
+ int i;
+
+ if (sstring[0] == '\0') {
+ emsg("No previous regular expression");
+ return;
+ }
+ if (ch == '/') {
+ if (ascii_comp(search_pat, sstring)) return;
+ }
+ if (ch == '\\') {
+ if (hex_comp(search_pat, sstring)) return;
+ }
+ oldpos = bytepos;
+ last_search = screen_home;
+ if (precount < 1) precount = 1;
+ while (precount--) {
+ while ((i = bmregexec(search_pat)) == 0);
+ if (i == 1) {
+ screen_home = bytepos;
+ to_print = maxy;
+ } else { /* i == -1 -> EOF */
+ if (no_intty) {
+ PRINTF("\r\nPattern not found\r\n");
+ do_next(1);
+ } else {
+/*
+sprintf(string, "Pattern not found %d - %ul", i, (unsigned long)bytepos);
+emsg(string);
+*/
+ emsg("Pattern not found");
+ bytepos = oldpos;
+ fseek(curr_file, bytepos, SEEK_SET);
+ break;
+ }
+ }
+ if (precount) {
+ nextchar();
+ bytepos++;
+ }
+ }
+ if (prompt) {
+ PRINTF("\r\n...skipping\r\n");
+ }
+}
+
+
+void
+emsg(s)
+ char *s;
+{
+ putchar('\r');
+ clreol();
+ highvideo();
+ PRINTF(s);
+ normvideo();
+ fflush(stdout);
+ prompt = 0;
+}
+
+
+void
+bmbeep() {
+ putchar(7);
+}
diff --git a/bmore.h b/bmore.h
index c1521f1..18d5aab 100644
--- a/bmore.h
+++ b/bmore.h
@@ -8,11 +8,12 @@
* 2000-05-31 V 1.3.0 beta
* 2000-10-04 V 1.3.0 final
* 2002-01-16 V 1.3.1
+ * 2003-02-20 V 1.3.2
*
* NOTE: Edit this file with tabstop=4 !
*
- * Copyright 1996-2002 by Gerhard Buergmann
- * Gerhard.Buergmann@altavista.net
+ * Copyright 1996-2003 by Gerhard Buergmann
+ * gerhard@puon.at
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -36,7 +37,7 @@
#include
#include
-#ifdef __MSDOS__
+#if defined(__MSDOS__) && !defined(DJGPP)
# include "patchlev.h"
# include "dosconf.h"
# include
@@ -46,15 +47,21 @@
# include "patchlevel.h"
# include "config.h"
# include
-#if HAVE_NCURSES_H
+# if HAVE_NCURSES_H
# include
-# include
-#else
+# else
# include
+# endif
+# if HAVE_TERM_H
# include
-#endif
+# else
+# if HAVE_NCURSES_TERM_H
+# include
+# endif
+# endif
#endif
+
/* defines for filemode */
#define ERROR -1
#define REGULAR 0
@@ -89,7 +96,7 @@
# define FALSE 0
#endif
-#ifdef __MSDOS__
+#if defined(__MSDOS__) && !defined(DJGPP)
# define ANSI
# define PTR char huge *
# define off_t long
@@ -123,13 +130,13 @@ extern int no_tty, no_intty;
#ifdef ANSI
void initterm(void), set_tty(void), reset_tty(void);
- void clreol(void), clrscr(void), highvideo(void), normvideo(void);
- void bmbeep(void), home(void), sig(void);
+ void cleartoeol(void), clearscreen(void), highlight(void);
+ void normal(void), bmbeep(void), home(void), sig(void);
void doshell(char *), emsg(char *);
void do_next(int);
- void open_file(char *);
void bmsearch(int);
void pushback(int, char *);
+ int open_file(void);
int printout(int), rdline(int, char *);
int nextchar(void), vgetc(void);
int sbracket(int, char *, int);
@@ -138,13 +145,13 @@ extern int no_tty, no_intty;
void putline(char *, int);
#else
void initterm(), set_tty(), reset_tty();
- void clreol(), clrscr(), highvideo(), normvideo();
- void bmbeep(), home(), sig();
+ void cleartoeol(), clearscreen(), highlight();
+ void normal(), bmbeep(), home(), sig();
void doshell(), emsg();
void do_next();
- void open_file();
void bmsearch();
void pushback();
+ int open_file();
int printout(), rdline();
int nextchar(), vgetc();
int sbracket();
diff --git a/bmore.man b/bmore.man
index 62b9582..da13196 100644
--- a/bmore.man
+++ b/bmore.man
@@ -1,29 +1,26 @@
-
-
-
BMORE(1) BMORE(1)
-NNAAMMEE
+NAME
bmore - browse through a binary file
-SSYYNNOOPPSSIISS
- bbmmoorree [ --aaddii ] [ ++_l_i_n_e_n_u_m_b_e_r ] [ ++//_A_S_C_I_I_-_p_a_t_t_e_r_n ] [
- ++\\_H_e_x_-_p_a_t_t_e_r_n ] [ _f_i_l_e_n_a_m_e ... ]
+SYNOPSIS
+ bmore [ -acdi ] [ -n lines ] [ -w cols ] [ +linenumber ] [
+ +/ASCII-pattern ] [ +\Hex-pattern ] [ filename ... ]
-DDEESSCCRRIIPPTTIIOONN
- mmoorree is a filter that displays the contents of a binary
- file on the terminal, one screenful at a time. It nor
- mally pauses after each screenful, and prints ----MMoorree---- at
- the bottom of the screen. bbmmoorree provides a two-line over
- lap between screens for continuity. If bbmmoorree is reading
- from a file rather than a pipe, the percentage of charac
+DESCRIPTION
+ more is a filter that displays the contents of a binary
+ file on the terminal, one screenful at a time. It nor-
+ mally pauses after each screenful, and prints --More-- at
+ the bottom of the screen. bmore provides a two-line over-
+ lap between screens for continuity. If bmore is reading
+ from a file rather than a pipe, the percentage of charac-
ters displayed so far is also shown.
- bbmmoorree scrolls up to display one more screen line in
+ bmore scrolls up to display one more screen line in
response to a RETURN character; it displays another
- screenful in response to a SPACE character. Other com
+ screenful in response to a SPACE character. Other com-
mands are listed below.
The screen is divided in three sections or panes: The byte
@@ -34,165 +31,148 @@ DDEESSCCRRIIPPTTIIOONN
screen line. Note that (as one would expect) the first
byte has the offset 0 (zero).
- bbmmoorree sets the terminal to _n_o_e_c_h_o mode, so that the output
+ bmore sets the terminal to noecho mode, so that the output
can be continuous. Commands that you type do not normally
- show up on your terminal, except for the // , \\ and !! com
+ show up on your terminal, except for the / , \ and ! com-
mands.
- If the standard output is not a terminal, mmoorree acts just
- like ccaatt(1V), except that a header is printed before each
+ If the standard output is not a terminal, more acts just
+ like cat(1V), except that a header is printed before each
file in a series.
-OOPPTTIIOONNSS
- --aa ASCII mode: no hex representation of the contents.
+OPTIONS
+ -a ASCII mode: no hex representation of the contents.
Non printable characters are displayed as a dot (.)
- --dd Display error messages rather than ringing the ter
- minal bell if an unrecognized command is used.
+ -c Clear before displaying. Redrawing the screen
+ instead of scrolling.
+
+ -d Display error messages rather than ringing the ter-
+ minal bell if an unrecognized command is used.
This is helpful for inexperienced users.
- --ii Ignore case for searching.
+ -i Ignore case for searching.
- ++_l_i_n_e_n_u_m_b_e_r
- Start up at _l_i_n_e_n_u_m_b_e_r.
+ -n lines
+ Displays the indicated number of lines in each
+ screenful, rather than the default (the number of
+ lines in the terminal screen less two).
- ++//_A_S_C_I_I_-_p_a_t_t_e_r_n
- Start up at the line containing the regular
+ -w cols
+ Display number of cols in each line.
+
+ +linenumber
+ Start up at linenumber.
+
+ +/ASCII-pattern
+ Start up at the line containing the regular expres-
+ sion pattern. Note: unlike editors, this construct
+ should not end with a `/'. If it does, then the
+ trailing slash is taken as a character in the
+ search pattern.
+USAGE
- 13 June 2000 1
-
-
-
-
-
-BMORE(1) BMORE(1)
-
-
- expression _p_a_t_t_e_r_n. Note: unlike editors, this
- construct should _n_o_t end with a `//'. If it does,
- then the trailing slash is taken as a character in
- the search pattern.
-
-
- UUSSAAGGEE
-
- CCoommmmaannddss
+ Commands
The commands take effect immediately; it is not necessary
- to type a carriage return. Up to the time when the com
+ to type a carriage return. Up to the time when the com-
mand character itself is given, the user may type the line
- kill character to cancel the numerical argument being
- formed. In addition, the user may type the erase charac
- ter to redisplay the `----MMoorree----((_x_x%%))' message.
+ kill character to cancel the numerical argument being
+ formed. In addition, the user may type the erase charac-
+ ter to redisplay the `--More--(xx%)' message.
- In the following commands, _i is a numerical argument (11 by
+ In the following commands, i is a numerical argument (1 by
default).
- _iSPACE Display another screenful, or _i more lines if _i
+ iSPACE Display another screenful, or i more lines if i
is specified.
- _iRETURN Display another line, or _i more lines, if speci
+ iRETURN Display another line, or i more lines, if speci-
fied.
- _i^^DD (CTRL-D) Display (scroll down) 11 more lines. _i
- is given, the scroll size is set to _i.
+ i^D (CTRL-D) Display (scroll down) 11 more lines. i
+ is given, the scroll size is set to i.
- _id Same as ^^DD.
+ id Same as ^D.
- _izz Same as SPACE, except that _i, if present,
- becomes the new default number of lines per
+ iz Same as SPACE, except that i, if present,
+ becomes the new default number of lines per
screenful.
- _iss Skip _i lines and then print a screenful.
+ is Skip i lines and then print a screenful.
- _iff Skip _i screenfuls and then print a screenful.
+ if Skip i screenfuls and then print a screenful.
- _i^^BB (CTRL-B) Skip back _i screenfuls and then print a
+ i^B (CTRL-B) Skip back i screenfuls and then print a
screenful.
- _b Same as ^^BB (CTRL-D).
+ b Same as ^B (CTRL-D).
- qq
- QQ Exit from mmoorree.
+ q
+ Q Exit from more.
- == Display the current line number.
+ = Display the current line number.
- vv Drop into the bbvvii(1) editor at the current off
+ v Drop into the bvi(1) editor at the current off-
set of the current file.
-
- ww Drop into the bbvvii(1) editor at the current off
+ w Drop into the bvi(1) editor at the current off-
set of the current file. Only the portion of the
file displayed on the screen will be loaded.
-
-
- 13 June 2000 2
-
-
-
-
-
-BMORE(1) BMORE(1)
-
-
- hh Help. Give a description of all the mmoorree com
+ h Help. Give a description of all the more com-
mands.
- _i//_p_a_t_t_e_r_n Search for the _ith occurrence of the regular
- expression _p_a_t_t_e_r_n. Display the screenful
- starting at the file position that contains the
- _ith match for the regular expression _A_S_C_I_I_-_p_a_t_
- _t_e_r_n, or the end of a pipe, whichever comes
- first. If bbmmoorree is displaying a file and there
- is no such match, its position in the file
- remains unchanged. Regular expressions can be
+ i/pattern Search for the ith occurrence of the regular
+ expression pattern. Display the screenful
+ starting at the file position that contains the
+ ith match for the regular expression ASCII-pat-
+ tern, or the end of a pipe, whichever comes
+ first. If bmore is displaying a file and there
+ is no such match, its position in the file
+ remains unchanged. Regular expressions can be
edited using erase and kill characters. Erasing
- back past the first column cancels the search
+ back past the first column cancels the search
command.
- ´´ Single quote. Go to the point from which the
- last search started. If no search has been per
- formed in the current file, go to the beginning
+ ' Single quote. Go to the point from which the
+ last search started. If no search has been per-
+ formed in the current file, go to the beginning
of the file.
- !!_c_o_m_m_a_n_d Invoke a shell to execute _c_o_m_m_a_n_d. The charac
- ters %% and !!, when used within _c_o_m_m_a_n_d are
- replaced with the current filename and the pre
- vious shell command, respectively. If there is
- no current filename, %% is not expanded. Prepend
- a backslash to these characters to escape expan
+ !command Invoke a shell to execute command. The charac-
+ ters % and !, when used within command are
+ replaced with the current filename and the pre-
+ vious shell command, respectively. If there is
+ no current filename, % is not expanded. Prepend
+ a backslash to these characters to escape expan-
sion.
- _i::nn Skip to the _ith next filename given in the com
- mand line, or to the last filename in the list
- if _i is out of range.
+ i:n Skip to the ith next filename given in the com-
+ mand line, or to the last filename in the list
+ if i is out of range.
- _i::pp Skip to the _ith previous filename given in the
- command line, or to the first filename if _i is
- out of range. If given while mmoorree is positioned
- within a file, go to the beginning of the file.
- If mmoorree is reading from a pipe, mmoorree simply
+ i:p Skip to the ith previous filename given in the
+ command line, or to the first filename if i is
+ out of range. If given while more is positioned
+ within a file, go to the beginning of the file.
+ If more is reading from a pipe, more simply
rings the terminal bell.
- ::ff Display the current filename and offset number.
+ :f Display the current filename and offset number.
- ::qq
- ::QQ Exit from bbmmoorree (same as qq or QQ ))..
+ :q
+ :Q Exit from bmore (same as q or Q ).
- .. Dot. Repeat the previous command.
+ . Dot. Repeat the previous command.
- FFIILLEESS
- //eettcc//tteerrmmccaapp terminal data base
- //uussrr//llooccaall//sshhaarree//bbmmoorree..hheellpp
+ FILES
+ /etc/termcap terminal data base
+ /usr/local/share/bmore.help
help file
-SSEEEE AALLSSOO
- bbvvii(1), tteerrmmccaapp(5)
-
-
-
- 3 Jan 2002 3
-
-
+SEE ALSO
+ bvi(1), termcap(5)
+
+ 3 Jan 2004
diff --git a/bvi.1 b/bvi.1
index 092384b..44d3cc1 100644
--- a/bvi.1
+++ b/bvi.1
@@ -93,7 +93,7 @@
.nr % 0
.rr F
.\}
-.TH BVI 1 "BVI Version 1.3.1" "3/Jan/2002" "User Commands"
+.TH BVI 1 "BVI Version 1.3.2" "3/Jan/2004" "User Commands"
.IX Title "BVI 1"
.UC
.IX Name "bvi, bview - visual display editor for binary files"
@@ -194,7 +194,7 @@
bvi, bview \- visual editor for binary files
.SH "VERSION"
.IX Header "VERSION"
-bvi-1.3.1
+bvi-1.3.2
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\fBbvi\fR\ \ \ [\fB\-R\fR]\ [\fB\-c\fR\ \fIcmd\fR]\ [\fB\-f\fR\ \fIscript\fR]\ [\fB\-b\fR\ \fIbegin\fR]\ [\fB\-e\fR\ \fIend\fR]\ [\fB\-s\fR\ \fIsize\fR]\ \fIfile\fR...
@@ -594,11 +594,11 @@ the file. If you use ASCII mode you can use the special characters
.SH "AUTHOR"
.IX Header "AUTHOR"
bvi was developed by Gerhard Buergmann, Vienna, Austria
-\fIGerhard.Buergmann@altavista.net\fR
+\fIGerhard.Buergmann@puon.at\fR
.SH "WWW"
.IX Header "WWW"
Bvi\ Homepage:\ \ http://bvi.sourceforge.net/
-Vi\ Pages:\ \ \ \ \ \ http://www.math.fu-berlin.de/~guckes/vi/
+Vi\ Pages:\ \ \ \ \ \ http://www.guckes.net/vi/clones.php3
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (all\ about\ Vi\ and\ its\ clones)
.SH "FILES"
.IX Header "FILES"
diff --git a/bvi.c b/bvi.c
index f23bda6..7fc4b9e 100644
--- a/bvi.c
+++ b/bvi.c
@@ -8,11 +8,12 @@
* 2000-05-10 V 1.3.0 alpha
* 2000-10-24 V 1.3.0 final
* 2002-01-03 V 1.3.1
+ * 2004-01-04 V 1.3.2
*
* NOTE: Edit this file with tabstop=4 !
*
- * Copyright 1996-2002 by Gerhard Buergmann
- * Gerhard.Buergmann@altavista.net
+ * Copyright 1996-2004 by Gerhard Buergmann
+ * gerhard@puon.at
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -37,7 +38,7 @@
#endif
-char *copyright = "Copyright (C) 1996-2002 by Gerhard Buergmann";
+char *copyright = "Copyright (C) 1996-2004 by Gerhard Buergmann";
jmp_buf env; /* context for `longjmp' function */
diff --git a/bvi.h b/bvi.h
index 62c2d82..b019465 100644
--- a/bvi.h
+++ b/bvi.h
@@ -8,11 +8,12 @@
* 2000-05-10 V 1.3.0 alpha
* 2000-10-24 V 1.3.0 final
* 2001-10-29 V 1.3.1
+ * 2003-07-04 V 1.3.2
*
* NOTE: Edit this file with tabstop=4 !
*
- * Copyright 1996-2001 by Gerhard Buergmann
- * Gerhard.Buergmann@altavista.net
+ * Copyright 1996-2003 by Gerhard Buergmann
+ * gerhard@puon.at
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -36,7 +37,7 @@
#include
#include
-#ifdef __MSDOS__
+#if defined(__MSDOS__) && !defined(DJGPP)
# include "patchlev.h"
# include "dosconf.h"
# include "doscur.h"
@@ -109,7 +110,7 @@
# define FALSE 0
#endif
-#ifdef __MSDOS__
+#if defined(__MSDOS__) && !defined(DJGPP)
# define ANSI
# define PTR char huge *
# define off_t long
@@ -185,7 +186,7 @@ extern off_t block_begin, block_end, block_size;
#define S_ISFIFO(m) ((m & 0170000) == 0010000) /* fifo */
#endif
-#ifdef __MSDOS__
+#if defined(__MSDOS__) && !defined(DJGPP)
void d_memcpy(PTR, PTR, off_t);
void d_memmove(PTR, PTR, off_t);
#endif
diff --git a/bvi.man b/bvi.man
index 43f8c98..b0e0b11 100644
--- a/bvi.man
+++ b/bvi.man
@@ -2,28 +2,48 @@ BVI(1) User Commands BVI(1)
NAME
- bvi, bview - visual display editor for binary files
+ bvi, bview - visual editor for binary files
VERSION
- bvi-1.3.1
+ bvi-1.3.2
SYNOPSIS
- bvi [-R] [-c cmd] [-f script] file...
- bview [-R] [-c cmd] [-f script] file...
+ bvi [-R] [-c cmd] [-f script] [-b begin] [-e end] [-s size] file...
+ bview [-R] [-c cmd] [-f script] [-b begin] [-e end] [-s size] file...
OPTIONS
file...
- One or more files. The file argument indicates one or
- more files to be edited.
+ A list of filenames. The first one will be the
+ current file and will be read into the buffer. The
+ cursor will be positioned on the first line of the
+ buffer. You can get to the other files with the
+ ":next" command.
-R "Readonly": The readonly flag is set for all the
files, preventing accidental overwriting with a write
command.
+
+ -b begin
+ causes bvi to load a file not from the start but from
+ offset begin.
+
+
+ -e end
+ causes bvi to load a file not till end but till
+ address end.
+
+
+ -s size
+ causes bvi not to load the complete file but only size
+ bytes.
+
+
-c cmd
- Execute command cmd. Begin editing by executing the
- specified editor command (usually a search or
- positioning command).
+ cmd will be executed after the first file has
+ been read. If the cmd contains spaces it must be
+ enclosed in double quotes (this depends on the shell
+ that is used).
-f script
This command provides a means for collecting a series
@@ -33,39 +53,38 @@ OPTIONS
to make several global changes in a binary file.
DESCRIPTION
- Bvi stands for "Binary VIsual editor". Bvi is a display
+ Bvi stands for "Binary VIsual editor". Bvi is a screen
oriented editor for binary files; its command set is based
- on those of the vi(1) texteditor. As a binary editor
- cannot have the concept of "lines" there are several
- differences to Vi commands (see COMPARISON).
+ on that of the vi(1) text editor. As a binary editor does
+ not have the concept of "lines" there are differences from
+ Vi commands wherever the latter are line orientate.
COMPARISON
The main differences between Vi and Bvi are:
- The screen is divided in three sections/windows: The byte
- offset (at the left side), the hex window (in the middle),
- and the ascii window (to the right) which shows the ascii
- values of those bytes in the hex window. On an 80 column
- terminal you will therefore see sixteen hex values and
- their ASCII values on each screen line. Note that the
- first byte has the offset '0' (zero).
+ The screen is divided in three sections or panes: The byte
+ offset (extreme left), the hex pane (middle), and an ascii
+ pane (right) which shows as printable characters those
+ bytes in the hex pane. On an 80 column terminal there
+ will be sixteen hex values and their ASCII values on each
+ screen line. Note that (as one would expect) the first
+ byte has the offset '0' (zero).
You can toggle between the hex and ascii windows with the
- tabulator key (TAB). Toggling between these two windows
- does not change the current position within the file.
+ tab key (TAB). Toggling between these two windows does
+ not change the current position (offset) within the file.
- No "lines" concept: Files are treated as one long series
- of bytes only. These characters "newline" and "carriage
- return" thus are not special, ie they do not mark the end
- of lines. Therefore the lines on the screen do not
- represent lines in the usual way. Data is broken across
- screen lines as they happen to fit in. As a consequence
- there are no commands in bvi from ex or vi that are based
- on line numbers, eg "dd", "yy", 'C', 'S', 'o', 'O'. This
- also changes the meaning of "range" before the ":write"
- command to a byte offset, ie the command ":100,200w foo"
- writes all *bytes* (not lines) from offset 100 to offset
- 200 to the file "foo".
+ No "lines" concept: Files are treated as one long stream
+ of bytes. The characters "newline" and "carriage return"
+ are not special, id est they never mark the end of lines.
+ Therefore the lines on the screen do not represent lines
+ in the usual way. Data is broken across screen lines
+ arbitarily. As a consequence there are no commands in bvi
+ from ex or vi that are based on line numbers, eg "dd",
+ "yy", 'C', 'S', 'o', 'O'. This also changes the meaning
+ of "range" before the ":write" command to a byte offset,
+ ie the command ":100,200w foo" writes all *bytes* (not
+ lines) from offset 100 to offset 200 to the file "foo".
No "text objects": There are also no text-specific
arrangements like words, paragraphs, sentences, sections
@@ -102,38 +121,41 @@ COMPARISON
between hex value are optional, so searching for
"6775636B6573" will find "guckes".
- Changing data (insertion, deletion) moves the data to
- other addresses; this is bad for many cases (eg.
- databases, program files) and is thus disabled by default.
- You can enable this commands by typing
+ Changing the length of data (insertion, deletion) moves
+ the data to other addresses; this is bad for many cases
+ (eg. databases, program files) and is thus disabled by
+ default. You can enable this commands by typing
:set memmove
- BVI Modes:
+ BVI Modes:
- Command Mode aka Normal Mode:
+ Command Mode (Normal Mode):
- Input is treated as commands. Note that command mode is
- the default mode after startup and when you escape/quit
- from either command line mode or input mode. Use ESC
- (escape) to cancel a partial (uncompleted) command.
+ Input is treated as command. Note that command mode is
+ the default mode after startup and after escaping from
+ input mode. Use ESC (escape) to cancel a partial
+ (uncompleted) command.
- Input Mode:
+ Input Mode:
- Input is treated as replacement of current character or is
- appended to the current file. This mode is entered from
- command mode by typing either of 'i', 'I', 'A', 'r', or
- 'R'. You can enter the character itself (in the ASCII
- window) or its hexadecimal value (in the HEX window).
- Type TAB to switch between these two windows. Type ESC to
- cancel current command and return to command mode. Type
- CTRL-C to cancel current command abnormally.
+ Input is treated as replacement of current characters or
+ (after the end of the file) is appended to the current
+ file. This mode is entered from command mode by typing
+ one of 'i', 'I', 'A', 'r', or 'R'. You can enter the
+ characters from the keyboard (in the ASCII window) or
+ hexadecimal values (in the HEX window). Type TAB to
+ switch between these two windows. Type ESC to finish the
+ current input and return to command mode. Type CTRL-C to
+ cancel current command abnormally.
- Command line mode (aka Last Line Mode):
+ Command line mode (Last Line Mode or : mode):
- Reading input for : / ? \ # or !; terminate by typing a
- carriage return; an interrupt cancels termination. Type
- ESC to cancel current command and return to command mode.
+ Similar to vi, this mode is entered by typing one of the
+ characters : / ? \ # ! The command is terminated and
+ executed by typing a carriage return; to cancel a
+ partially typed command, type ESC to cancel the current
+ command and return to command mode.
ENVIRONMENT
The editor recognizes the environment variable BVIINIT as
@@ -166,11 +188,11 @@ COMMAND SUMMARY
abbreviations used within the following description of
commands.
- Abstract:
- Arrow keys move the cursor on the screen within the
+ Abstract:
+ Arrow keys move the cursor on the screen within the
current window.
- Sample commands:
+ Sample commands:
:version show version info
<- v ^ -> arrow keys move the cursor
h j k l same as arrow keys
@@ -180,7 +202,7 @@ COMMAND SUMMARY
/text search for text
^U ^D scroll up or down
- Counts before bvi commands:
+ Counts before bvi commands:
Numbers may be typed as a prefix to some commands.
They are interpreted in one of these ways.
@@ -189,11 +211,11 @@ COMMAND SUMMARY
scroll amount ^D ^U
repeat effect most of the rest
- Interrupting, canceling
+ Interrupting, canceling
ESC end insert or incomplete command
DEL (delete or rubout) interrupts
- File manipulation:
+ File manipulation:
ZZ if file modified, write and exit;
otherwise, exit
:w write changed buffer to file
@@ -202,7 +224,7 @@ COMMAND SUMMARY
:q quit when no changes have been made
:q! quit and discard all changes
:e file edit file
- :e! reedit current file, discard all changes
+ :e! re-read current file, discard all changes
:e # edit the alternate file
:e! # edit the alternate file, discard changes
:w file write current buffer to file
@@ -218,13 +240,13 @@ COMMAND SUMMARY
current position within buffer
^G same as :f
- Additional edit commands
- You can insert/append/change bytes in
+ Additional edit commands
+ You can insert/append/change bytes in
ASCII/binary/decimal/ hexadecimal or octal representation.
You can enter several (screen) lines of input. A line with
only a period (.) in it will terminate the command. You
must not type in values greater than a byte value. This
- causes an abandom of the command. Pressing the CR key
+ causes an abandonment of the command. Pressing the CR key
does not insert a newline - character into the file. If
you use ASCII mode you can use the special characters \n,
\r, \t and \0.
@@ -233,7 +255,7 @@ COMMAND SUMMARY
:a bCR append bytes (Binary) at end of file
:c hCR change bytes (hexadecimal) at cursor position
- Bit-level operations
+ Bit-level operations
:and n bitwise 'and' operation with value n
:or n bitwise 'or' operation with value n
:xor n bitwise 'xor' operation with value n
@@ -244,7 +266,7 @@ COMMAND SUMMARY
:rl i rotate each byte i bits to the left
:rr i rotate each byte i bits to the right
- Command mode addresses
+ Command mode addresses
:w foo write current buffer to a file
named "foo"
:5,10w foo copy byte 5 through 100 into as
@@ -256,7 +278,7 @@ COMMAND SUMMARY
:/pat/,$ foo search pattern pat and and copy
through end of file
- Positioning within file:
+ Positioning within file:
^B backward screen
^F forward screen
^D scroll down half screen
@@ -271,7 +293,7 @@ COMMAND SUMMARY
N repeat last search command, but in opposite
direction
- Adjusting the screen:
+ Adjusting the screen:
^L clear and redraw screen
zCR redraw screen with current line at top of screen
z- redraw screen with current line at bottom of
@@ -283,16 +305,15 @@ COMMAND SUMMARY
^E scroll screen down 1 line
^Y scroll screen up 1 line
- Marking and returning:
+ Marking and returning:
mx mark current position with lower-case letter x
Note: this command works for all lower-case
- letters
+ letters
'x move cursor to mark x in ASCII section
`x move cursor to mark x in HEX section
'' move cursor to previous context in ASCII section
`` move cursor to previous context in HEX section
-
- Line positioning:
+ Line positioning:
H jump to first line on screen ("top")
L jump to last line on screen ("low")
M jump to middle line on screen ("middle")
@@ -302,7 +323,7 @@ COMMAND SUMMARY
DOWN or j next line, same column
UP or k previous line, same column
- Character positioning:
+ Character positioning:
^ first byte in HEX window
$ end of screen line
l or RIGHT jump onto next byte (within current
@@ -316,7 +337,7 @@ COMMAND SUMMARY
n| jump onto nth byte/character within current
line
- Strings:
+ Strings:
(works similar to the strings(1) command)
Note: "Words" are defined as strings of "nonprinting
characters".
@@ -327,35 +348,34 @@ COMMAND SUMMARY
\0 or \n
B back to previous string delimited with a
nonprinting char
-
- Corrections during insert:
+ Corrections during insert:
^H erase last character (backspace)
erase your erase character, same as ^H (backspace)
ESC ends insertion, back to command mode
- Append and replace:
+ Append and replace:
A append at end of file
rx replace current bte with char 'x'
R enter replace mode; for all subsequent input,
the current byte is overwritten with the next
input character; leave replace mode with ESC.
- Miscellaneous Operations:
+ Miscellaneous Operations:
TAB toggle between ASCII and HEX section
- Yank and Put:
+ Yank and Put:
3ySPACE yank 3 characters
p insert contents of yank buffer
o replace text with content of yank buffer
P put back at end of file
- Undo, Redo:
+ Undo, Redo:
u undo last change
Note: Only the last change can be undone.
Therefore this commands toggles between the
last and second-t-last state of the buffer.
- Setting Options:
+ Setting Options:
With the :set command you can set options in bvi
Option Default Description
@@ -380,13 +400,14 @@ COMMAND SUMMARY
32 is displayed in the statusline as shown
in ascii(7) if unset rather in DOS-style (^A)
+
AUTHOR
bvi was developed by Gerhard Buergmann, Vienna, Austria
- Gerhard.Buergmann@altavista.net
+ Gerhard.Buergmann@puon.at
WWW
Bvi Homepage: http://bvi.sourceforge.net/
- Vi Pages: http://www.math.fu-berlin.de/~guckes/vi/
+ Vi Pages: http://www.guckes.net/vi/clones.php3
(all about Vi and its clones)
FILES
@@ -400,5 +421,4 @@ BUGS
SEE ALSO
vi(1), strings(1), ascii(5)
-
-3/Jan/2002 BVI Version 1.3.1 8
+3/Jan/2004 BVI Version 1.3.2
diff --git a/comm.c b/comm.c
index e3d5b8e..3c8ad62 100644
--- a/comm.c
+++ b/comm.c
@@ -9,11 +9,12 @@
* 2000-03-03 V 1.3.0 beta
* 2000-07-15 V 1.3.0 final
* 2001-10-10 V 1.3.1
+ * 2003-07-04 V 1.3.2
*
* NOTE: Edit this file with tabstop=4 !
*
- * Copyright 1996-2001 by Gerhard Buergmann
- * Gerhard.Buergmann@altavista.net
+ * Copyright 1996-2003 by Gerhard Buergmann
+ * gerhard@puon.at
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -39,7 +40,7 @@
# include
#endif
-#ifdef __MSDOS__
+#if defined(__MSDOS__) && !defined(DJGPP)
# include
# include
# define WRITE (O_WRONLY|O_CREAT|O_TRUNC|O_BINARY)
diff --git a/config.guess b/config.guess
old mode 100644
new mode 100755
index 6012b39..9b1384b
--- a/config.guess
+++ b/config.guess
@@ -1,9 +1,9 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002 Free Software Foundation, Inc.
-timestamp='2001-07-12'
+timestamp='2002-11-30'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -24,8 +24,9 @@ timestamp='2001-07-12'
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
-# Written by Per Bothner .
-# Please send patches to .
+# Originally written by Per Bothner .
+# Please send patches to . Submit a context
+# diff and a properly formatted ChangeLog entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
@@ -87,30 +88,40 @@ if test $# != 0; then
exit 1
fi
+trap 'exit 1' 1 2 15
-dummy=dummy-$$
-trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
-# CC_FOR_BUILD -- compiler used by this script.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
-set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int dummy(){}" > $dummy.c ;
- for c in cc gcc c89 ; do
- ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
- if test $? = 0 ; then
+# This shell variable is my proudest work .. or something. --bje
+
+set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ;
+(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old)
+ || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ;
+dummy=$tmpdir/dummy ;
+files="$dummy.c $dummy.o $dummy.rel $dummy" ;
+trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
- rm -f $dummy.c $dummy.o $dummy.rel ;
+ rm -f $files ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac'
+esac ;
+unset files'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
@@ -127,29 +138,30 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
- # Netbsd (nbsd) targets should (where applicable) match one or
+ # NetBSD (nbsd) targets should (where applicable) match one or
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
- # Determine the machine/vendor (is the vendor relevant).
- case "${UNAME_MACHINE}" in
- amiga) machine=m68k-unknown ;;
- arm32) machine=arm-unknown ;;
- atari*) machine=m68k-atari ;;
- sun3*) machine=m68k-sun ;;
- mac68k) machine=m68k-apple ;;
- macppc) machine=powerpc-apple ;;
- hp3[0-9][05]) machine=m68k-hp ;;
- ibmrt|romp-ibm) machine=romp-ibm ;;
- *) machine=${UNAME_MACHINE}-unknown ;;
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
- case "${UNAME_MACHINE}" in
- i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep __ELF__ >/dev/null
@@ -166,12 +178,62 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
;;
esac
# The OS release
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit 0 ;;
+ amiga:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hp300:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ macppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvmeppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ pmax:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sgi:OpenBSD:*:*)
+ echo mipseb-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ wgrisc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:OpenBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -180,6 +242,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
+ eval $set_cc_for_build
cat <$dummy.s
.data
\$Lformat:
@@ -205,10 +268,9 @@ main:
jsr \$26,exit
.end main
EOF
- eval $set_cc_for_build
- $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
+ $CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null
if test "$?" = 0 ; then
- case `./$dummy` in
+ case `$dummy` in
0-0)
UNAME_MACHINE="alpha"
;;
@@ -227,9 +289,15 @@ EOF
2-307)
UNAME_MACHINE="alphaev67"
;;
+ 2-1307)
+ UNAME_MACHINE="alphaev68"
+ ;;
+ 3-1307)
+ UNAME_MACHINE="alphaev7"
+ ;;
esac
fi
- rm -f $dummy.s $dummy
+ rm -f $dummy.s $dummy && rmdir $tmpdir
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
Alpha\ *:Windows_NT*:*)
@@ -244,29 +312,11 @@ EOF
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit 0;;
- amiga:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit 0 ;;
- arc64:OpenBSD:*:*)
- echo mips64el-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- arc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- hkmips:OpenBSD:*:*)
- echo mips-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- pmax:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sgi:OpenBSD:*:*)
- echo mips-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- wgrisc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
exit 0 ;;
*:OS/390:*:*)
echo i370-ibm-openedition
@@ -288,6 +338,10 @@ EOF
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
+ DRS?6000:UNIX_SV:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7 && exit 0 ;;
+ esac ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
@@ -316,7 +370,7 @@ EOF
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
@@ -330,9 +384,6 @@ EOF
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
- atari*:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
@@ -359,18 +410,6 @@ EOF
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit 0 ;;
- sun3*:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
@@ -387,6 +426,7 @@ EOF
echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include /* for printf() prototype */
@@ -408,16 +448,21 @@ EOF
exit (-1);
}
EOF
- eval $set_cc_for_build
- $CC_FOR_BUILD $dummy.c -o $dummy \
- && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && rm -f $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
+ $CC_FOR_BUILD -o $dummy $dummy.c \
+ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
+ rm -f $dummy.c $dummy && rmdir $tmpdir
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit 0 ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit 0 ;;
@@ -478,6 +523,7 @@ EOF
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
@@ -489,9 +535,8 @@ EOF
exit(0);
}
EOF
- eval $set_cc_for_build
- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
+ rm -f $dummy.c $dummy && rmdir $tmpdir
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
@@ -500,7 +545,7 @@ EOF
fi
exit 0 ;;
*:AIX:*:[45])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
@@ -540,10 +585,8 @@ EOF
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
- case "${HPUX_REV}" in
- 11.[0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
@@ -552,12 +595,13 @@ EOF
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;;
esac
- fi ;;
- esac
- if [ "${HP_ARCH}" = "" ]; then
- sed 's/^ //' << EOF >$dummy.c
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include
@@ -590,11 +634,10 @@ EOF
exit (0);
}
EOF
- eval $set_cc_for_build
- (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
- if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
- rm -f $dummy.c $dummy
- fi ;;
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
+ rm -f $dummy.c $dummy && rmdir $tmpdir
+ fi ;;
esac
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
@@ -603,6 +646,7 @@ EOF
echo ia64-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
+ eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
int
@@ -628,9 +672,8 @@ EOF
exit (0);
}
EOF
- eval $set_cc_for_build
- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
+ rm -f $dummy.c $dummy && rmdir $tmpdir
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@@ -658,9 +701,6 @@ EOF
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit 0 ;;
- hppa*:OpenBSD:*:*)
- echo hppa-unknown-openbsd
- exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit 0 ;;
@@ -679,9 +719,6 @@ EOF
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit 0 ;;
- CRAY*X-MP:*:*:*)
- echo xmp-cray-unicos
- exit 0 ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
@@ -703,18 +740,12 @@ EOF
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
- CRAY-2:*:*:*)
- echo cray2-cray-unicos
- exit 0 ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
- hp300:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
@@ -725,10 +756,19 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
- *:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ # Determine whether the default compiler uses glibc.
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include
+ #if __GLIBC__ >= 2
+ LIBC=gnu
+ #else
+ LIBC=
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ rm -f $dummy.c && rmdir $tmpdir
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
exit 0 ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
@@ -739,11 +779,17 @@ EOF
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit 0 ;;
+ x86:Interix*:3*)
+ echo i586-pc-interix3
+ exit 0 ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit 0 ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
- echo i386-pc-interix
+ echo i586-pc-interix
exit 0 ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
@@ -764,20 +810,57 @@ EOF
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
mips:Linux:*:*)
- case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
- big) echo mips-unknown-linux-gnu && exit 0 ;;
- little) echo mipsel-unknown-linux-gnu && exit 0 ;;
- esac
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ rm -f $dummy.c && rmdir $tmpdir
+ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips64
+ #undef mips64el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mips64el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips64
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ rm -f $dummy.c && rmdir $tmpdir
+ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit 0 ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit 0 ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
@@ -786,7 +869,7 @@ EOF
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
@@ -819,7 +902,8 @@ EOF
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
- ld_supported_targets=`cd /; ld --help 2>&1 \
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
| sed -ne '/supported targets:/!d
s/[ ][ ]*/ /g
s/.*supported targets: *//
@@ -831,7 +915,7 @@ EOF
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit 0 ;;
+ exit 0 ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0 ;;
@@ -842,33 +926,30 @@ EOF
exit 0 ;;
esac
# Determine whether the default compiler is a.out or elf
- cat >$dummy.c <
-#ifdef __cplusplus
-#include /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
-#ifdef __ELF__
-# ifdef __GLIBC__
-# if __GLIBC__ >= 2
- printf ("%s-pc-linux-gnu\n", argv[1]);
-# else
- printf ("%s-pc-linux-gnulibc1\n", argv[1]);
-# endif
-# else
- printf ("%s-pc-linux-gnulibc1\n", argv[1]);
-# endif
-#else
- printf ("%s-pc-linux-gnuaout\n", argv[1]);
-#endif
- return 0;
-}
-EOF
eval $set_cc_for_build
- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
+ sed 's/^ //' << EOF >$dummy.c
+ #include
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #ifdef __INTEL_COMPILER
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ rm -f $dummy.c && rmdir $tmpdir
+ test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
;;
i*86:DYNIX/ptx:4*:*)
@@ -885,6 +966,23 @@ EOF
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit 0 ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit 0 ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit 0 ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit 0 ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -906,22 +1004,19 @@ EOF
UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
- (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
- (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit 0 ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
@@ -945,9 +1040,15 @@ EOF
# "miniframe"
echo m68010-convergent-sysv
exit 0 ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit 0 ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+ 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -964,9 +1065,6 @@ EOF
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
@@ -993,8 +1091,8 @@ EOF
echo ns32k-sni-sysv
fi
exit 0 ;;
- PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says
echo i586-unisys-sysv4
exit 0 ;;
*:UNIX_System_V:4*:FTX*)
@@ -1006,6 +1104,10 @@ EOF
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit 0 ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit 0 ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
@@ -1034,6 +1136,9 @@ EOF
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit 0 ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
@@ -1044,15 +1149,17 @@ EOF
echo `uname -p`-apple-darwin${UNAME_RELEASE}
exit 0 ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
- if test "${UNAME_MACHINE}" = "x86pc"; then
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
- echo `uname -p`-${UNAME_MACHINE}-nto-qnx
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit 0 ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit 0 ;;
- NSR-[KW]:NONSTOP_KERNEL:*:*)
+ NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
*:NonStop-UX:*:*)
@@ -1075,11 +1182,6 @@ EOF
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit 0 ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit 0 ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit 0 ;;
@@ -1103,6 +1205,7 @@ esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+eval $set_cc_for_build
cat >$dummy.c <
@@ -1217,9 +1320,8 @@ main ()
}
EOF
-eval $set_cc_for_build
-$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
-rm -f $dummy.c $dummy
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
+rm -f $dummy.c $dummy && rmdir $tmpdir
# Apollos put the system type in the environment.
diff --git a/config.h.in b/config.h.in
index a0cd505..214e077 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,47 +1,87 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
+/***** begin user configuration section *****/
-/* Define to `int' if doesn't define. */
-/* #undef mode_t */
-
-/* Define to `long' if doesn't define. */
-/* #undef off_t */
-
-/* Define to `int' if doesn't define. */
-/* #undef pid_t */
-
-/* Define to `unsigned' if doesn't define. */
-/* #undef size_t */
-
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define if you have the memmove function. */
-#undef HAVE_MEMMOVE
-
-/* Define if you have the strdup function. */
-#undef HAVE_STRDUP
-
-/* Define if you have the strtol function. */
-#undef HAVE_STRTOL
-
-/* Define if you have the strerror function. */
-#undef HAVE_STRERROR
-
-/* Define if you have the header file. */
-#undef HAVE_CURSES_H
-
-/* Define if you have the header file. */
-#undef HAVE_FCNTL_H
-
-/* Define if you have the header file. */
#undef HAVE_NCURSES_H
-/* Define if you have the header file. */
-#undef HAVE_UNISTD_H
+#undef HAVE_CURSES_H
-/* Define if you have the ncurses library (-lncurses). */
-#undef HAVE_LIBNCURSES
+#undef NO_SYSERRL
-/* Define if your tputs need putc(char) */
#undef NEED_PUTC_CHAR
+#undef HAVE_NCURSES_TERM_H
+
+/* Define if you have the header file. */
+#undef HAVE_FCNTL_H
+
+/* Define if you have the header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define if you have the `memmove' function. */
+#undef HAVE_MEMMOVE
+
+/* Define if you have the header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if you have the header file. */
+#undef HAVE_NCURSES_TERM_H
+
+/* Define if you have the header file. */
+#undef HAVE_STDINT_H
+
+/* Define if you have the header file. */
+#undef HAVE_STDLIB_H
+
+/* Define if you have the `strdup' function. */
+#undef HAVE_STRDUP
+
+/* Define if you have the `strerror' function. */
+#undef HAVE_STRERROR
+
+/* Define if you have the header file. */
+#undef HAVE_STRINGS_H
+
+/* Define if you have the header file. */
+#undef HAVE_STRING_H
+
+/* Define if you have the `strtol' function. */
+#undef HAVE_STRTOL
+
+/* Define if you have the header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define if you have the header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define if you have the header file. */
+#undef HAVE_TERMCAP_H
+
+/* Define if you have the header file. */
+#undef HAVE_TERMIOS_H
+
+/* Define if you have the header file. */
+#undef HAVE_TERMIO_H
+
+/* Define if you have the header file. */
+#undef HAVE_TERM_H
+
+/* Define if you have the header file. */
+#undef HAVE_UNISTD_H
+
+/* The size of a `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of a `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of a `void *', as computed by sizeof. */
+#undef SIZEOF_VOID_P
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to `int' if does not define. */
+#undef off_t
+
+/* Define to `unsigned int' if does not define. */
+#undef size_t
diff --git a/config.sub b/config.sub
old mode 100644
new mode 100755
index 578b302..f0675aa
--- a/config.sub
+++ b/config.sub
@@ -1,9 +1,9 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002 Free Software Foundation, Inc.
-timestamp='2001-06-08'
+timestamp='2002-11-30'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -29,7 +29,8 @@ timestamp='2001-06-08'
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
-# Please send patches to .
+# Please send patches to . Submit a context
+# diff and a properly formatted ChangeLog entry.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -117,7 +118,7 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
+ nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -223,26 +224,46 @@ esac
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
- tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
- | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
- | pyramid | mn10200 | mn10300 | tron | a29k \
- | 580 | i960 | h8300 \
- | x86 | ppcbe | mipsbe | mipsle | shbe | shle \
- | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
- | hppa64 \
- | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
- | alphaev6[78] \
- | we32k | ns16k | clipper | i370 | sh | sh[34] \
- | powerpc | powerpcle \
- | 1750a | dsp16xx | pdp10 | pdp11 \
- | mips16 | mips64 | mipsel | mips64el \
- | mips64orion | mips64orionel | mipstx39 | mipstx39el \
- | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
- | mips64vr5000 | mips64vr5000el | mcore | s390 | s390x \
- | sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \
- | v850 | c4x \
- | thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
- | pj | pjl | h8500 | z8k)
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+ | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k \
+ | m32r | m68000 | m68k | m88k | mcore \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64vr | mips64vrel \
+ | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | ns16k | ns32k \
+ | openrisc | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
+ | strongarm \
+ | tahoe | thumb | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xscale | xstormy16 | xtensa \
+ | z8k)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12)
@@ -265,31 +286,56 @@ case $basic_machine in
exit 1
;;
# Recognize the basic CPU types with company name.
- # FIXME: clean up the formatting here.
- vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
- | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
- | arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
- | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
- | xmp-* | ymp-* \
- | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
- | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
- | hppa2.0n-* | hppa64-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
- | alphaev6[78]-* \
- | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
- | clipper-* | orion-* \
- | sparclite-* | pdp10-* | pdp11-* | sh-* | sh[34]-* | sh[34]eb-* \
- | powerpc-* | powerpcle-* | sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
- | mips16-* | mips64-* | mipsel-* \
- | mips64el-* | mips64orion-* | mips64orionel-* \
- | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
- | mipstx39-* | mipstx39el-* | mcore-* \
- | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
- | [cjt]90-* \
- | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
- | thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
- | bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* \
+ | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \
+ | clipper-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* \
+ | m32r-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | mcore-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39 | mipstx39el \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+ | xtensa-* \
+ | ymp-* \
+ | z8k-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@@ -352,6 +398,10 @@ case $basic_machine in
basic_machine=ns32k-sequent
os=-dynix
;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
convex-c1)
basic_machine=c1-convex
os=-bsd
@@ -372,16 +422,8 @@ case $basic_machine in
basic_machine=c38-convex
os=-bsd
;;
- cray | ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- cray2)
- basic_machine=cray2-cray
- os=-unicos
- ;;
- [cjt]90)
- basic_machine=${basic_machine}-cray
+ cray | j90)
+ basic_machine=j90-cray
os=-unicos
;;
crds | unos)
@@ -396,6 +438,14 @@ case $basic_machine in
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
@@ -576,14 +626,6 @@ case $basic_machine in
basic_machine=m68k-atari
os=-mint
;;
- mipsel*-linux*)
- basic_machine=mipsel-unknown
- os=-linux-gnu
- ;;
- mips*-linux*)
- basic_machine=mips-unknown
- os=-linux-gnu
- ;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
@@ -598,6 +640,10 @@ case $basic_machine in
basic_machine=m68k-rom68k
os=-coff
;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
msdos)
basic_machine=i386-pc
os=-msdos
@@ -677,6 +723,10 @@ case $basic_machine in
basic_machine=hppa1.1-oki
os=-proelf
;;
+ or32 | or32-*)
+ basic_machine=or32-unknown
+ os=-coff
+ ;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
@@ -699,19 +749,19 @@ case $basic_machine in
pbb)
basic_machine=m68k-tti
;;
- pc532 | pc532-*)
+ pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
- pentium | p5 | k5 | k6 | nexgen)
+ pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
- pentiumpro | p6 | 6x86 | athlon)
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc
;;
pentiumii | pentium2)
basic_machine=i686-pc
;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-*)
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
@@ -726,15 +776,25 @@ case $basic_machine in
power) basic_machine=power-ibm
;;
ppc) basic_machine=powerpc-unknown
- ;;
+ ;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
- ;;
+ ;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
ps2)
basic_machine=i386-ibm
;;
@@ -752,10 +812,22 @@ case $basic_machine in
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
sequent)
basic_machine=i386-sequent
;;
@@ -763,7 +835,7 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
- sparclite-wrs)
+ sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
@@ -829,10 +901,22 @@ case $basic_machine in
basic_machine=i386-sequent
os=-dynix
;;
- t3e)
- basic_machine=t3e-cray
+ t3d)
+ basic_machine=alpha-cray
os=-unicos
;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic4x | c4x*)
+ basic_machine=tic4x-unknown
+ os=-coff
+ ;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
@@ -843,6 +927,10 @@ case $basic_machine in
tx39el)
basic_machine=mipstx39el-unknown
;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
tower | tower-32)
basic_machine=m68k-ncr
;;
@@ -867,8 +955,8 @@ case $basic_machine in
os=-vms
;;
vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
+ basic_machine=f301-fujitsu
+ ;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
@@ -889,17 +977,13 @@ case $basic_machine in
basic_machine=hppa1.1-winbond
os=-proelf
;;
- windows32)
- basic_machine=i386-pc
- os=-windows32-msvcrt
- ;;
- xmp)
- basic_machine=xmp-cray
- os=-unicos
- ;;
- xps | xps100)
+ xps | xps100)
basic_machine=xps100-honeywell
;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
@@ -920,13 +1004,6 @@ case $basic_machine in
op60c)
basic_machine=hppa1.1-oki
;;
- mips)
- if [ x$os = x-linux-gnu ]; then
- basic_machine=mips-unknown
- else
- basic_machine=mips-mips
- fi
- ;;
romp)
basic_machine=romp-ibm
;;
@@ -946,13 +1023,16 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
- sh3 | sh4)
+ sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele)
basic_machine=sh-unknown
;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
sparc | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
- cydra)
+ cydra)
basic_machine=cydra-cydrome
;;
orion)
@@ -967,10 +1047,6 @@ case $basic_machine in
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
- c4x*)
- basic_machine=c4x-none
- os=-coff
- ;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
@@ -1033,9 +1109,12 @@ case $os in
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1047,8 +1126,10 @@ case $os in
;;
esac
;;
+ -nto-qnx*)
+ ;;
-nto*)
- os=-nto-qnx
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
@@ -1087,14 +1168,20 @@ case $os in
-acis*)
os=-aos
;;
+ -atheos*)
+ os=-atheos
+ ;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
-ns2 )
- os=-nextstep2
+ os=-nextstep2
;;
-nsk*)
os=-nsk
@@ -1133,8 +1220,8 @@ case $os in
-xenix)
os=-xenix
;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
;;
-none)
;;
@@ -1167,10 +1254,11 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
+ # This must come before the *-dec entry.
pdp10-*)
os=-tops20
;;
- pdp11-*)
+ pdp11-*)
os=-none
;;
*-dec | vax-*)
@@ -1197,6 +1285,9 @@ case $basic_machine in
mips*-*)
os=-elf
;;
+ or32-*)
+ os=-coff
+ ;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
@@ -1260,19 +1351,19 @@ case $basic_machine in
*-next)
os=-nextstep3
;;
- *-gould)
+ *-gould)
os=-sysv
;;
- *-highlevel)
+ *-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
- *-sgi)
+ *-sgi)
os=-irix
;;
- *-siemens)
+ *-siemens)
os=-sysv4
;;
*-masscomp)
@@ -1344,7 +1435,7 @@ case $basic_machine in
-ptx*)
vendor=sequent
;;
- -vxsim* | -vxworks*)
+ -vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
-aux*)
@@ -1359,6 +1450,9 @@ case $basic_machine in
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
+ -vos*)
+ vendor=stratus
+ ;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
diff --git a/configure b/configure
index d5e08af..b3ad612 100755
--- a/configure
+++ b/configure
@@ -3171,7 +3171,7 @@ EOF
fi
-for ac_header in fcntl.h termcap.h termio.h termios.h unistd.h
+for ac_header in fcntl.h termcap.h termio.h termios.h unistd.h term.h ncurses/term.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
echo "$as_me:3177: checking for $ac_header" >&5
diff --git a/configure.in b/configure.in
index bc5152f..68076d8 100644
--- a/configure.in
+++ b/configure.in
@@ -44,7 +44,7 @@ AC_CHECK_TYPE(off_t, int)
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h termcap.h termio.h termios.h unistd.h)
+AC_CHECK_HEADERS(fcntl.h termcap.h termio.h termios.h unistd.h term.h ncurses/term.h)
dnl Check if ncurses requested
_cppflags="${CPPFLAGS}"
diff --git a/dosconf.h b/dosconf.h
index d5ba078..ad3fd8c 100644
--- a/dosconf.h
+++ b/dosconf.h
@@ -8,8 +8,8 @@
*
* NOTE: Edit this file with tabstop=4 !
*
- * Copyright 1996-1969 by Gerhard Buergmann
- * Gerhard.Buergmann@altavista.net
+ * Copyright 1996-2002 by Gerhard Buergmann
+ * Gerhard.Buergmann@puon.at
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
diff --git a/doscur.h b/doscur.h
index a410d66..d248ff9 100644
--- a/doscur.h
+++ b/doscur.h
@@ -1,7 +1,7 @@
/* DOSCUR.H - CURSES.H for TURBO C
*
- * Copyright 1996 by Gerhard Buergmann
- * Gerhard.Buergmann@altavista.net
+ * Copyright 1996-2002 by Gerhard Buergmann
+ * Gerhard.Buergmann@puon.at
*
* 1996-02-28 V 1.0.0
* 1998-04-12 V 1.0.1
@@ -146,4 +146,3 @@ void attrset(int);
#define ERR (-1)
-
\ No newline at end of file
diff --git a/dosio.c b/dosio.c
index 4511bfc..90cd281 100644
--- a/dosio.c
+++ b/dosio.c
@@ -10,8 +10,8 @@
*
* NOTE: Edit this file with tabstop=4 !
*
- * Copyright 1996-2000 by Gerhard Buergmann
- * Gerhard.Buergmann@altavista.net
+ * Copyright 1996-2002 by Gerhard Buergmann
+ * Gerhard.Buergmann@puon.at
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
diff --git a/edit.c b/edit.c
index ed8e8ba..328a0cd 100644
--- a/edit.c
+++ b/edit.c
@@ -8,9 +8,10 @@
* 2000-05-14 V 1.3.0 alpha
* 2000-07-15 V 1.3.0 final
* 2001-12-07 V 1.3.1
+ * 2003-07-04 V 1.3.2
*
- * Copyright 1996-2001 by Gerhard Buergmann
- * Gerhard.Buergmann@altavista.net
+ * Copyright 1996-2003 by Gerhard Buergmann
+ * gerhard@puon.at
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -861,7 +862,7 @@ do_ins_chg(start, arg, mode)
break;
}
mfree:
-#ifdef __MSDOS__
+#if defined(__MSDOS__) && !defined(DJGPP)
farfree(tempbuf);
#else
free(tempbuf);
diff --git a/html/bmore.html b/html/bmore.html
index 4081da7..86d9962 100644
--- a/html/bmore.html
+++ b/html/bmore.html
@@ -62,15 +62,17 @@ continuity. If bmore is reading from a file rather than a pipe,
the percentage of characters displayed so far is also shown.
bmore scrolls up to display one more screen line in
-response to a RETURN character; it displays another
-screenful in response to a SPACE character. Other commands are listed below.
+response to a RETURN character; it displays another
+screenful in response to a SPACE character. Other commands are listed below.
The screen is divided in three sections or panes: The byte
offset (extreme left), the hex pane (middle), and an ascii
pane (right) which shows as printable characters those
bytes in the hex pane. On an 80 column terminal there
will be sixteen hex values and their ASCII values on each
-screen line. Note that (as one would expect) the first
+screen line (can be changed with the -n option).
+
+Note that (as one would expect) the first
byte has the offset 0 (zero).
@@ -145,12 +147,13 @@ byte has the offset 0 (zero).
Equal lines will only displayed once, a star (*) is the placeholder
for one or more lines equal to the line above.
-
+
Back to the top
-
+
-Last update: Fri Oct 13 22:30:06 CEST 2000 by Gerhard Bürgmann
+Last update: October 13th 2000 by Gerhard Bürgmann,
+Purkersdorf/Austria