1
0
Fork 0
mirror of https://github.com/vbatts/bvi.git synced 2024-11-21 16:15:43 +00:00

bvi-1.3.2.src.tar.gz

This commit is contained in:
Gerhard Bürgmann 2005-01-07 00:00:00 +00:00 committed by Vincent Batts
parent 16baacb54f
commit 12a0ed970c
63 changed files with 2580 additions and 1159 deletions

17
CHANGES
View file

@ -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
====================

View file

@ -9,13 +9,14 @@ Claudio Nieder <claudio@chili.symmetrix.ch> Makefile
Nico Schmidt <Nico.Schmidt@ipk.fhg.de> r-bug fix
Steve Waltner <swaltner@lsil.com> Mac OS X support
Andre Wobst <Andre.Wobst@Physik.Uni-Augsburg.de> AIX fixes
SimoN <simontdd@netzero.net> bmore: subshell support fixes
SimoN <simontdd@netzero.net> bmore: subshell support fixes, DJGPP support
Packages:
Christian "naddy" Weisgerber <naddy@mips.rhein-neckar.de> Source RPM
Christian Kurz <shorty@jupiter.rhein-neckar.de> Debian package
Stijn de Bekker <stijn@debekker.org> Debian package
Troy Engel <tengel@sonic.net> i386 RPM package
Thomas Steudten <thomas@steudten.com> RH alpha and x86 RPM package
Doc:
Sven Guckes <guckes@math.fu-berlin.de>

View file

@ -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

6
README
View file

@ -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

View file

@ -5,3 +5,7 @@
#undef HAVE_CURSES_H
#undef NO_SYSERRL
#undef NEED_PUTC_CHAR
#undef HAVE_NCURSES_TERM_H

View file

@ -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();
}

View file

@ -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()
{
#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()
{
#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
}

19
bmore.1
View file

@ -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 .

198
bmore.c
View file

@ -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 <locale.h>
#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,24 +134,47 @@ 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 '-':
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();
default:
usage();
}
i++;
}
}
n++;
break;
case '+': /* +cmd */
@ -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) {
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 (!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;
}

871
bmore.c.old Normal file
View file

@ -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 <sys/types.h>
#ifdef HAVE_LOCALE_H
# include <locale.h>
#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);
}

29
bmore.h
View file

@ -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 <sys/stat.h>
#include <setjmp.h>
#ifdef __MSDOS__
#if defined(__MSDOS__) && !defined(DJGPP)
# include "patchlev.h"
# include "dosconf.h"
# include <alloc.h>
@ -48,12 +49,18 @@
# include <unistd.h>
# if HAVE_NCURSES_H
# include <ncurses.h>
# include <ncurses/term.h>
# else
# include <curses.h>
# endif
# if HAVE_TERM_H
# include <term.h>
# else
# if HAVE_NCURSES_TERM_H
# include <ncurses/term.h>
# endif
# endif
#endif
/* defines for filemode */
#define ERROR -1
@ -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();

200
bmore.man
View file

@ -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­
-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.
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,
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
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 _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
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
command.
´´ Single quote. Go to the point from which the
last search started. If no search has been per­
' 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­
!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­
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­
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.
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
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 mmoorree is reading from a pipe, mmoorree simply
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

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

8
bvi.1
View file

@ -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"

7
bvi.c
View file

@ -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 */

11
bvi.h
View file

@ -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 <sys/stat.h>
#include <setjmp.h>
#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

146
bvi.man
View file

@ -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:
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 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
@ -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
@ -224,7 +246,7 @@ COMMAND SUMMARY
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.
@ -291,7 +313,6 @@ COMMAND SUMMARY
`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:
H jump to first line on screen ("top")
L jump to last line on screen ("low")
@ -327,7 +348,6 @@ COMMAND SUMMARY
\0 or \n
B back to previous string delimited with a
nonprinting char
Corrections during insert:
^H erase last character (backspace)
erase your erase character, same as ^H (backspace)
@ -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

7
comm.c
View file

@ -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 <fcntl.h>
#endif
#ifdef __MSDOS__
#if defined(__MSDOS__) && !defined(DJGPP)
# include <io.h>
# include <dir.h>
# define WRITE (O_WRONLY|O_CREAT|O_TRUNC|O_BINARY)

406
config.guess vendored Normal file → Executable file
View file

@ -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 <bothner@cygnus.com>.
# Please send patches to <config-patches@gnu.org>.
# Originally written by Per Bothner <per@bothner.com>.
# Please send patches to <config-patches@gnu.org>. 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
# 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 <<EOF >$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 <stdio.h> /* 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 <sys/systemcfg.h>
@ -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,8 +585,6 @@ 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`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
@ -552,11 +595,12 @@ 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
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
@ -590,10 +634,9 @@ EOF
exit (0);
}
EOF
eval $set_cc_for_build
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
(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
rm -f $dummy.c $dummy && rmdir $tmpdir
fi ;;
esac
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
@ -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 <unistd.h>
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 <features.h>
#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: *//
@ -842,33 +926,30 @@ EOF
exit 0 ;;
esac
# Determine whether the default compiler is a.out or elf
cat >$dummy.c <<EOF
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <features.h>
#ifdef __cplusplus
#include <stdio.h> /* 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]);
LIBC=gnu
# else
printf ("%s-pc-linux-gnulibc1\n", argv[1]);
LIBC=gnulibc1
# endif
# else
printf ("%s-pc-linux-gnulibc1\n", argv[1]);
LIBC=gnulibc1
# endif
#else
printf ("%s-pc-linux-gnuaout\n", argv[1]);
#ifdef __INTEL_COMPILER
LIBC=gnu
#else
LIBC=gnuaout
#endif
#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
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' </usr/options/cb.name`
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
elif /bin/uname -X 2>/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,7 +1091,7 @@ EOF
echo ns32k-sni-sysv
fi
exit 0 ;;
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit 0 ;;
@ -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 <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
@ -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.

View file

@ -1,47 +1,87 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
/***** begin user configuration section *****/
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef mode_t */
#undef HAVE_NCURSES_H
/* Define to `long' if <sys/types.h> doesn't define. */
/* #undef off_t */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef pid_t */
/* Define to `unsigned' if <sys/types.h> 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 <curses.h> header file. */
#undef HAVE_CURSES_H
#undef NO_SYSERRL
#undef NEED_PUTC_CHAR
#undef HAVE_NCURSES_TERM_H
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the <ncurses.h> header file. */
#undef HAVE_NCURSES_H
/* Define if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define if you have the `memmove' function. */
#undef HAVE_MEMMOVE
/* Define if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define if you have the <ncurses/term.h> header file. */
#undef HAVE_NCURSES_TERM_H
/* Define if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define if you have the <stdlib.h> 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 <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have the `strtol' function. */
#undef HAVE_STRTOL
/* Define if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define if you have the <termcap.h> header file. */
#undef HAVE_TERMCAP_H
/* Define if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
/* Define if you have the <termio.h> header file. */
#undef HAVE_TERMIO_H
/* Define if you have the <term.h> header file. */
#undef HAVE_TERM_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the ncurses library (-lncurses). */
#undef HAVE_LIBNCURSES
/* The size of a `int', as computed by sizeof. */
#undef SIZEOF_INT
/* Define if your tputs need putc(char) */
#undef NEED_PUTC_CHAR
/* 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 <sys/types.h> does not define. */
#undef off_t
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t

290
config.sub vendored Normal file → Executable file
View file

@ -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 <config-patches@gnu.org>.
# Please send patches to <config-patches@gnu.org>. 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
@ -702,16 +752,16 @@ case $basic_machine in
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-*)
@ -735,6 +785,16 @@ case $basic_machine in
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
;;
@ -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)
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,9 +1023,12 @@ 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
;;
@ -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,12 +1168,18 @@ case $os in
-acis*)
os=-aos
;;
-atheos*)
os=-atheos
;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
-nova*)
os=-rtmk-nova
;;
-ns2 )
os=-nextstep2
;;
@ -1167,6 +1254,7 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
;;
@ -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
;;
@ -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/"`
;;

2
configure vendored
View file

@ -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

View file

@ -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}"

View file

@ -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

View file

@ -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)


View file

@ -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

7
edit.c
View file

@ -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);

View file

@ -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.
<p>
<strong>bmore</strong> 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 <font color="#aaaaaa"><b>RETURN</b></font> character; it displays another
screenful in response to a <font color="#aaaaaa"><b>SPACE</b></font> character. Other commands are listed below.
<P>
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 <b>-n</b> option).
<p>
Note that (as one would expect) the first
byte has the offset 0 (zero).
<P>
<center>
@ -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.
</p>
<p><font size="-1">
<p><small>
<a class="btop" href="#top">
<img border="0" width="16" height="7" src="gif/up.gif"
alt="Back to the top">Back to the top</a>
</font>
</small>
<hr noshade>
<i>Last update: Fri Oct 13 22:30:06 CEST 2000 by Gerhard B&uuml;rgmann</i>
<i>Last update: October 13<sup>th</sup> 2000 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -57,11 +57,19 @@ height="62" border="0"></a>
<p>
<table>
<tr><th valign="top">-a</th><td>ASCII mode</td></tr>
<tr><th valign="top">-c</th><td>Clear before displaying. Redrawing the screen
instead of scrolling. Can be useful, if you change the number of
displayed lines.</td></tr>
<tr><th valign="top">-d</th><td>Display error messages rather than ringing the
terminal bell if an unrecognized command is used.
This is helpful for inexperienced users.
</td></tr>
<tr><th valign="top">-i</th><td>Ignore case for searching.</td></tr>
<tr><th valign="top"><nobreak>-n <i>lines</i></nobreak></th>
<td>Displays the indicated number of <i>lines</i> in each screenful,
rather than the default (the number of lines in the terminal screen less two).</td></tr>
<tr><th valign="top">-w <i>cols</i></th><td>
Display number of <i>cols</i> (bytes of data) in each line.</td></tr>
<tr><th valign="top">+<I>linenumber</i></th>
<td>Start up at <I>linenumber</i></td></tr>
<tr><th valign="top">+/<font color="#FF0000">ASCII-pattern</font></th>
@ -122,12 +130,13 @@ With the <tt><b>-a</b></tt> option the display looks like this:
</td></tr></table>
</center>
<p> &nbsp;</p>
<p><font size="-1">
<p><small>
<a class="btop" href="#top">
<img border="0" width="16" height="7" src="gif/up.gif"
alt="Back to the top">Back to the top</a>
</font>
</small>
<hr noshade>
<i>Last update: Fri Oct 13 21:38:17 CEST 2000 by Gerhard B&uuml;rgmann</i>
<i>Last update: January 4<sup>th</sup> 2004 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -202,7 +202,8 @@ Usually not available in vi but in ex (without the <I>m</I> - modifier).
ALT="Back to the top">Back to the top</A>
</FONT>
<HR NOSHADE>
<I>Last update: October 30<SUP>th</SUP> 1999 by Gerhard B&uuml;rgmann</I>
<I>Last update: October 30<SUP>th</SUP> 1999 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</I>
</BODY></HTML>

View file

@ -110,7 +110,8 @@
ALT="Back to the top">Back to the top</A>
</FONT>
<HR NOSHADE>
<I>Last update: October 30<SUP>th</SUP> 1999 by Gerhard B&uuml;rgmann</I>
<I>Last update: October 30<SUP>th</SUP> 1999 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</I>
</BODY></HTML>

View file

@ -18,6 +18,7 @@
</p>
<p>
<font color="#ffffff" class="thl">Download<br></font>
<a class="ths" href="new132.html">New in 1.3.2</a><br>
<a class="ths" href="new131.html">New in 1.3.1</a><br>
<a class="ths" href="new130.html">New in 1.3.0</a><br>
<a class="ths" href="new120.html">New in 1.2.0</a><br>
@ -57,31 +58,41 @@ height="62" border="0"></a>
NOTE: All packages are compressed with the GNU gzip program. You
can download it from <a href="ftp://ftp.gnu.org/gnu/gzip/">ftp://ftp.gnu.org/gnu/gzip/</a>.
<p>
Current stable release of bvi is <b>1.3.1</b>
(Check out what's <a href="new131.html">new</a>):
Current stable release of bvi is <b>1.3.2</b>
(Check out what's <a href="new132.html">new</a>):
<p>
<h3>Sources</h3>
<ul>
<li><a href="http://download.sourceforge.net/bvi/bvi-1.3.1.src.tar.gz">bvi-1.3.1.src.tar.gz</a>
<li><a href="http://prdownloads.sourceforge.net/bvi/bvi-1.3.2.src.tar.gz">bvi-1.3.2.src.tar.gz</a>
&nbsp; (168k)</li>
<li><a href="http://download.sourceforge.net/bvi/bvi-1.3.0.src.tar.gz">bvi-1.3.0.src.tar.gz</a>
<li><a href="http://prdownloads.sourceforge.net/bvi/bvi-1.3.1.src.tar.gz">bvi-1.3.1.src.tar.gz</a>
&nbsp; (165k)</li>
<li><a href="http://prdownloads.sourceforge.net/bvi/bvi-1.3.0.src.tar.gz">bvi-1.3.0.src.tar.gz</a>
&nbsp; (144k)</li>
</ul>
<h3>Packages</h3>
<ul>
<li><a href="http://packages.debian.org/stable/editors/bvi.html">Debian</a>
<h3>Executables</h3>
<ul>
<li>Linux: &nbsp; <a href="http://download.sourceforge.net/bvi/bvi-1.3.1-linux_static_elf.tar.gz">bvi-1.3.1-linux_static_elf.tar.gz</a>
&nbsp; (338k)</li>
<li>Linux: &nbsp; <a href="http://download.sourceforge.net/bvi/bvi-1.3.0-linux_static_elf.tar.gz">bvi-1.3.0-linux_static_elf.tar.gz</a>
<li>Linux: &nbsp; <a href="http://prdownloads.sourceforge.net/bvi/bvi-1.3.1-linux_static_elf.tar.gz">bvi-1.3.1-linux_static_elf.tar.gz</a>
&nbsp; (354k)</li>
<li>Solaris: &nbsp; <a href="http://prdownloads.sourceforge.net/bvi/bvi-1.3.1-solaris.tar.gz">bvi-1.3.1-solaris.tar.gz</a>
&nbsp; (107k)</li>
<li>SunOS 4.1.3: &nbsp; <a href="http://prdownloads.sourceforge.net/bvi/bvi-1.3.1-sun4.tar.gz">bvi-1.3.1-sun4.tar.gz</a>
&nbsp; (110k)</li>
<li>Linux: &nbsp; <a href="http://prdownloads.sourceforge.net/bvi/bvi-1.3.0-linux_static_elf.tar.gz">bvi-1.3.0-linux_static_elf.tar.gz</a>
&nbsp; (338k)</li>
</ul>
<p><font size="-1">
<p><small>
<a class="btop" href="#top">
<img border="0" width="16" height="7" src="gif/up.gif"
alt="Back to the top">Back to the top</a>
</font>
</small>
<hr noshade>
<i>Last update: February 12<sup>th</sup> 2002 by Gerhard B&uuml;rgmann</i>
<i>Last update: January 18<sup>th</sup> 2004 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -188,7 +188,8 @@ of the command!
ALT="Back to the top">Back to the top</A>
</FONT>
<HR NOSHADE>
<I>Last update: September 30<SUP>th</SUP> 1999 by Gerhard B&uuml;rgmann</I>
<I>Last update: September 30<SUP>th</SUP> 1999 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</I>
</BODY></HTML>

View file

@ -198,10 +198,10 @@ Schreibweise angegeben werden. Auch bei Eingabe von genau acht 0 und 1
Werten wird der Byte - Wert bin&auml;r interpretiert.<BR>
Beispiel:<BR>
<BLOCKQUOTE CLASS="examp">
<B><TT>:100,500and 01A </TT><FONT COLOR=#AAAAAA>RETURN</FONT></B><BR>
<B><TT>:03FA,01000or 00001000 </TT><FONT COLOR=#AAAAAA>RETURN</FONT></B><BR>
<B><TT>:.rr 3 </TT><FONT COLOR=#AAAAAA>RETURN</FONT></B><BR>
<B><TT>:'a,$sl 1 </TT><FONT COLOR=#AAAAAA>RETURN</FONT></B><BR>
<B><TT>:100,500and 01A </TT><FONT COLOR="#AAAAAA">RETURN</FONT></B><BR>
<B><TT>:03FA,01000or 00001000 </TT><FONT COLOR="#AAAAAA">RETURN</FONT></B><BR>
<B><TT>:.rr 3 </TT><FONT COLOR="#AAAAAA">RETURN</FONT></B><BR>
<B><TT>:'a,$sl 1 </TT><FONT COLOR="#AAAAAA">RETURN</FONT></B><BR>
</BLOCKQUOTE>
<p><font size="-1">
<a class="btop" href="#top">
@ -209,6 +209,7 @@ Beispiel:<BR>
alt="Back to the top">Back to the top</a>
</font>
<hr noshade>
<i>Last update: Thu Jun 01 12:00:00 CEST 2000 by Gerhard B&uuml;rgmann</i>
<i>Last update: June 1<sup>st</sup> 2000 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -1,10 +1,6 @@
<!DOCTYPE html PUBLIC "-//W3C/DTD HTML 3.2 Final//EN">
<html><head>
<title>BVI - Binary VIsual editor</title>
<script language="JavaScript">
<!--
if(top.frames.length!=0){top.location=location;}// -->
</script>
<link rel=stylesheet type="text/css" href="bvi.css">
<meta name="description" content="Bvi stands for Binary VIsual editor.
Bvi is a display oriented editor for binary files.
@ -14,7 +10,11 @@ hexadecimal, linux, octal, patch, more, unix, solaris, sunos, visual, vi">
<meta name="robots" content="INDEX,FOLLOW">
<meta name="author" content="Gerhard Buergmann">
<meta name="publisher" content="Gerhard Buergmann">
</head><body bgcolor="#ffffff" background="gif/bg2.gif">
<script language="JavaScript">
<!--
if(top.frames.length!=0){top.location=location;}// -->
</script>
</head><body background="gif/bg2.gif">
<a name="top"></a>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th width="1%" valign="top"><img src="gif/dot.gif" width="130" height="1" alt="">
@ -49,13 +49,17 @@ Deutsche<br>Beschreibung
Sitemap
</a></p>
<p><a class="thl" href="http://sourceforge.net/projects/bvi/">
Project Page
</a></p>
<hr noshade width="60%">
<p><a class="thl" href="http://www.math.fu-berlin.de/~guckes/vi/">
<p><a class="thl" href="http://www.guckes.net/vi/clones.php3">
VI and Clones
</a></p>
<p><a class="thl" href="http://spin.ch/~tpo/linux/hexeds.html">
<p><a class="thl" href="http://sourcepole.com/sources/reviews/hexeds.xml">
Hex-Editors
</a></p>
@ -66,7 +70,7 @@ Hex-Editors
<img src="http://sourceforge.net/sflogo.php?group_id=16427&type=1" width="88" height="31" border="0" alt="SourceForge Logo"></a>
</p>
</TH>
</th>
<td width=1%><img src="gif/dot.gif" width="40" height="1" alt=""></td>
<td width=99%>
<center>
@ -84,16 +88,17 @@ If you never heard about <strong>vi</strong>, maybe <strong>bvi</strong> is not
choice for you.
<p>
<h3>Original site: <a href="http://bvi.sourceforge.net/">http://bvi.sourceforge.net</a></h3>
<h1 align="center">Current: Version 1.3.2</h1>
You can download source and compiled versions from the
<a href="download.html">download page</a>.<br>
Check out whats <a href="new131.html">new in 1.3.1</a>!
Check out whats <a href="new132.html">new in 1.3.2</a>!
<p>
<b>Newsgroup:</b> <a href="news:comp.editors">comp.editors</a>
<p>
<b>Mailing List:</b>
<b>Mailing List</b> (very low traffic):
<blockquote>
To join this list, simply send a blank email to
<a href="mailto:bvi-subscribe@yahoogroups.com">bvi-subscribe@yahoogroups.com</a>.
@ -102,23 +107,23 @@ Simply reply this message and your subscription will be complete.
</blockquote>
<strong>Bvi</strong> was developed by Gerhard B&uuml;rgmann and is published
under the GNU Public License. Current stable version is 1.3.1.
under the GNU Public License. Current stable version is 1.3.2.
<strong>Bvi</strong> is running on most UNIX - like operating systems and
on MSDOS.
<p>
If you want to contact me:<br>
Gerhard B&uuml;rgmann, Vienna ( <a href="http://www.purkersdorf-online.at/">Purkersdorf</a> ) / Austria / Europe<br>
E-mail: <a href="mailto:gerhard.buergmann@altavista.net">
Gerhard.Buergmann@altavista.net</a>
E-mail: <a href="mailto:gerhard@puon.at"> gerhard@puon.at</a><br>
Have a look at <a href="http://www.meta-chrom.com/">Meta Chrom Kennzeichenhalter</a>
<p>
<font size="-1">
<small>
<a class="btop" href="#top">
<img border="0" width="16" height="7" src="gif/up.gif"
alt="Back to the top">Back to the top</a>
</font>
</small>
<hr noshade>
<i>Last update: February 12<sup>th</sup> 2002 by Gerhard B&uuml;rgmann</i>
<i>Last update: January 8<sup>th</sup> 2004 by Gerhard B&uuml;rgmann</i>
</p>
</td></tr></table>

View file

@ -59,9 +59,9 @@ for cursor movement.
<li>Download the source package from the Download Page</li>
<li>Unzip the package with the command:</li>
<pre class="examp">
# gunzip -c bvi-1.3.1.src.tar.gz | tar xvf
# gunzip -c bvi-1.3.2.src.tar.gz | tar xvf
</pre>
<li>Change to the directory <tt class="examp">bvi-1.3.1</tt> and type
<li>Change to the directory <tt class="examp">bvi-1.3.2</tt> and type
<pre class="examp">
# ./configure
# make
@ -91,12 +91,19 @@ You will find now four new commands:
files from your file system.<br>
You can remove the program binaries and object files from the
source code directory by typing `<tt class="examp">make clean</tt>'.
To also remove the files that `<TT CLASS="examp">configure</tt>' created
To also remove the files that `<tt class="examp">configure</tt>' created
(so you can compile the package for
a different kind of computer), type `<tt class="examp">make distclean</tt>'. </li>
</ol>
<h2>MSDOS</h2>
Beginning with <b>version 1.3.2</b> you may use the DJGPP environment to
compile <b>bvi</b> for working under both Win32 and DOS.
<p>
The MSDOS version (Borland C) exists for historical reasons and is not
supported anymore:
<blockquote>
<p>
You have to convert the sourcefiles from the UNIX textformat to
the MSDOS textformat first. This can be done e.g. by loading and
saving them with the MSDOS standard editor `edit'.
@ -112,21 +119,21 @@ be able to convert it to a .COM file.
<li>Download the source package from the Download Page</li>
<li>Unzip the package with the command:
<pre class="examp">
gunzip -c bvi-1.3.1.src.tar.gz | tar xvf
gunzip -c bvi-1.3.2.src.tar.gz | tar xvf
</pre></li>
<li> Load the tcconfig file (located in the <TT>bc</TT> subdirectory
for Borland - C).</li>
<li> Press F9-Make</li>
</ol>
The MSDOS version exists for historical reasons and is not really
supported anymore.
<p><font size="-1">
</blockquote>
<p><small>
<a class="btop" href="#top">
<img border="0" width="16" height="7" src="gif/up.gif"
alt="Back to the top">Back to the top</a>
</font>
</small>
<hr noshade>
<i>Last update: February 12<sup>th</sup> 2002 by Gerhard B&uuml;rgmann</i>
<i>Last update: February 12<sup>th</sup> 2004 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -1,4 +1,5 @@
<xmp>
BMORE(1) BMORE(1)
@ -6,8 +7,9 @@ NAME
bmore - browse through a binary file
SYNOPSIS
bmore [ -adi ] [ +linenumber ] [ +/ASCII-pattern ] [
+\Hex-pattern ] [ filename ... ]
bmore [ -acdi ] [ -n lines ] [ -w cols ] [ +linenumber ] [
+/ASCII-pattern ] [ +\Hex-pattern ] [ filename ... ]
DESCRIPTION
more is a filter that displays the contents of a binary
@ -44,21 +46,32 @@ OPTIONS
-a ASCII mode: no hex representation of the contents.
Non printable characters are displayed as a dot (.)
-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.
-i Ignore case for searching.
-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).
-w cols
Display number of cols in each line.
+linenumber
Start up at linenumber.
+/ASCII-pattern
Start up at the line containing the regular
expression 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.
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
@ -105,7 +118,6 @@ USAGE
v Drop into the bvi(1) editor at the current off-
set of the current file.
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.
@ -129,6 +141,7 @@ USAGE
last search started. If no search has been per-
formed in the current file, go to the beginning
of the file.
!command Invoke a shell to execute command. The charac-
ters % and !, when used within command are
replaced with the current filename and the pre-
@ -147,6 +160,7 @@ USAGE
within a file, go to the beginning of the file.
If more is reading from a pipe, more simply
rings the terminal bell.
:f Display the current filename and offset number.
:q
@ -155,17 +169,13 @@ USAGE
. Dot. Repeat the previous command.
AUTHOR
bmore was developed by Gerhard Buergmann, Vienna, Austria
Gerhard.Buergmann@altavista.net
FILES
/etc/termcap terminal data base
/usr/local/share/bmore.help help file
/usr/local/share/bmore.help
help file
SEE ALSO
bvi(1), termcap(5)
13/Oct/2000 BMORE Version 1.3.0
3 Jan 2004
</xmp>

View file

@ -3,14 +3,14 @@ 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.0
bvi-1.3.2
SYNOPSIS
bvi [-R] [-c cmd] [-b begin] [-e end] [-s size] [-f script] file...
bview [-R] [-c cmd] [-b begin] [-e end] [-s size] [-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...
@ -24,23 +24,27 @@ OPTIONS
files, preventing accidental overwriting with a write
command.
-b begin
causes bvi to load a file not from the start but from
offset {begin}.
offset begin.
-e end
causes bvi to load a file not till end but till address
{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.
causes bvi not to load the complete file but only size
bytes.
-c cmd
{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).
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
@ -68,8 +72,8 @@ COMPARISON
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 stream
of bytes. The characters "newline" and "carriage return"
@ -118,10 +122,10 @@ 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
@ -221,7 +225,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
@ -243,7 +247,7 @@ COMMAND SUMMARY
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.
@ -310,7 +314,6 @@ COMMAND SUMMARY
`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:
H jump to first line on screen ("top")
L jump to last line on screen ("low")
@ -346,7 +349,6 @@ COMMAND SUMMARY
\0 or \n
B back to previous string delimited with a
nonprinting char
Corrections during insert:
^H erase last character (backspace)
erase your erase character, same as ^H (backspace)
@ -399,13 +401,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.linuxave.net/
Vi Pages: http://www.math.fu-berlin.de/~guckes/vi/
Bvi Homepage: http://bvi.sourceforge.net/
Vi Pages: http://www.guckes.net/vi/clones.php3
(all about Vi and its clones)
FILES
@ -419,6 +422,5 @@ BUGS
SEE ALSO
vi(1), strings(1), ascii(5)
13/Oct/2000 BVI Version 1.3.0 8
3/Jan/2004 BVI Version 1.3.2
</xmp>

View file

@ -18,6 +18,7 @@
</p>
<p>
<a class="thl" href="download.html">Download</a><br>
<a class="ths" href="new132.html">New in 1.3.2</a><br>
<a class="ths" href="new131.html">New in 1.3.1</a><br>
<a class="ths" href="new130.html">New in 1.3.0</a><br>
<font color="#ffffff" class="ths">New in 1.2.0<br></font>
@ -144,12 +145,13 @@ height="62" border="0"></a>
<LI>Local settings according to the environment variable LANG
will be evaluated (see setlocal(3)).
</UL>
<p><font size="-1">
<p><small>
<a class="btop" href="#top">
<img border="0" width="16" height="7" src="gif/up.gif"
alt="Back to the top">Back to the top</a>
</font>
</small>
<hr noshade>
<i>Last update: Thu Jun 01 12:00:00 CEST 2000 by Gerhard B&uuml;rgmann</i>
<i>Last update: June, 1<sup>st</sup> 2000 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -18,6 +18,7 @@
</p>
<p>
<a class="thl" href="download.html">Download</a><br>
<a class="ths" href="new132.html">New in 1.3.2</a><br>
<a class="ths" href="new131.html">New in 1.3.1</a><br>
<font color="#ffffff" class="ths">New in 1.3.0<br></font>
<a class="ths" href="new120.html">New in 1.2.0</a><br>
@ -91,12 +92,13 @@ which is displayed on the screen.
<li>Debian bug #68436 (Buffer overflow in io.c) fixed
</UL>
</UL>
<p><font size="-1">
<p><small>
<a class="btop" href="#top">
<img border="0" width="16" height="7" src="gif/up.gif"
alt="Back to the top">Back to the top</a>
</font>
</small>
<hr noshade>
<i>Last update: Thu Oct 12 20:51:06 CEST 2000 by Gerhard B&uuml;rgmann</i>
<i>Last update: October 12<sup>th</sup> 2000 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -18,6 +18,7 @@
</p>
<p>
<a class="thl" href="download.html">Download</a><br>
<a class="ths" href="new132.html">New in 1.3.2</a><br>
<font color="#ffffff" class="ths">New in 1.3.1<br></font>
<a class="ths" href="new130.html">New in 1.3.0</a><br>
<a class="ths" href="new120.html">New in 1.2.0</a><br>
@ -85,12 +86,13 @@ This is a bugfix release.
<li>subshell support fixes</li>
</ul>
<p><font size="-1">
<p><small>
<a class="btop" href="#top">
<img border="0" width="16" height="7" src="gif/up.gif"
alt="Back to the top">Back to the top</a>
</font>
</small>
<hr noshade>
<i>Last update: February 12<sup>th</sup> 2002 by Gerhard B&uuml;rgmann</i>
<i>Last update: February 12<sup>th</sup> 2002 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

93
html/new132.html Normal file
View file

@ -0,0 +1,93 @@
<!DOCTYPE html PUBLIC "-//W3C/DTD HTML 3.2 Final//EN">
<html><head>
<title>BVI: CHANGES in bvi 1.3.2</title>
<link rel=stylesheet type="text/css" href="bvi.css">
</head><body bgcolor="#ffffff" background="gif/bg2.gif">
<a name="top"></a>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td width="1%" valign="top" align="center">
<img src="gif/dot.gif" width="130" height="1" alt="">
<hr noshade width="60%">
<p>
<a class="thl" href="index.html">Home</a><br>
</p>
<p>
<a class="thl" href="quick.html">Quick Tutorial</a><br>
</p>
<p>
<a class="thl" href="download.html">Download</a><br>
<font color="#ffffff" class="ths">New in 1.3.2<br></font>
<a class="ths" href="new131.html">New in 1.3.1</a><br>
<a class="ths" href="new130.html">New in 1.3.0</a><br>
<a class="ths" href="new120.html">New in 1.2.0</a><br>
</p>
<p>
<a class="thl" href="install.html">Installation</a><br>
</p>
<p>
<a class="thl" href="overview.html">Command Overview</a><br>
</p>
<p>
<a class="thl" href="bmore.html">bmore</a><br>
</p>
<p>
<a class="thl" href="german.html">Deutsche Beschreibung</a><br>
</p>
<hr noshade width="60%">
</td>
<td width="1%"><img src="gif/dot.gif" width="40" height="1" alt=""></td>
<td width="99%">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td width="99%">
<font class="head">CHANGES in bvi 1.3.2</font>
</td>
<td align="right" valign="bottom" width="116" rowspan="2">
<a href="index.html">
<img src="gif/bvi_s.gif" alt="BVI" width="116"
height="62" border="0"></a>
</td></tr>
<tr><td valign="bottom">
<hr noshade>
</td></tr></table>
<p>
This is a bugfix release.
<p>
<b><font color="red">BVI:</font></b>
<ul>
<li> ported to compile under DJGPP v2.0 w/ PDCURSES (by simoN)</li>
<p>
<li>some minor fixes</li>
<p>
</ul>
<p><br></p>
<b><font color="red">BMORE:</font></b></li>
<ul>
<li>configure: checking term.h and ncurses/term.h</li>
<p>
<li>cast in bmore.c in putline();</li>
<p>
<li>fixed multiple file handling for "bmore" (by simoN)</li>
<p>
<li>renamed several local screen processing routines to avoid compiler conflicts</li>
<p>
<li>several minor fixes to "bmore" code (by simoN)</li>
<p>
<li>reset tty after CTRL-C in bmore</li>
</ul>
<p><br></p>
<p><small>
<a class="btop" href="#top">
<img border="0" width="16" height="7" src="gif/up.gif"
alt="Back to the top">Back to the top</a>
</small>
<hr noshade>
<i>Last update: January 8<sup>th</sup> 2004 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -62,19 +62,19 @@ the standard ascii vi.
<P>
<CENTER>
<TABLE WIDTH=70%>
<TR BGCOLOR=#CCCCFF><TD>Commands shown in blue frames are commands which
<TR BGCOLOR="#CCCCFF"><TD>Commands shown in blue frames are commands which
are available in both bvi and vi, but with a slightly different
behavior.</TD></TR>
<TR BGCOLOR=#CCFFCC><TD>Green frames are used for commands which are
<TR BGCOLOR="#CCFFCC"><TD>Green frames are used for commands which are
equal in both bvi and vi.</TD></TR>
<TR BGCOLOR=#FFCCCC><TD>Red frames are used for missing commands</TD></TR>
<TR BGCOLOR="#FFCCCC"><TD>Red frames are used for missing commands</TD></TR>
</TABLE>
</CENTER>
<P>
Special keys are displayed in a gray font, e.g.
<FONT COLOR=#AAAAAA><B>RETURN</B></FONT>,
<FONT COLOR=#AAAAAA><B>ARROW_UP</B></FONT> or
<FONT COLOR=#AAAAAA><B>CTRL</B></FONT>.
<font color="#aaaaaa"><b>RETURN</b></font>,
<font color="#aaaaaa"><b>ARROW_UP</b></font> or
<font color="#aaaaaa"><b>CTRL</b></font>.
<H3>Topics:</H3>
<P>
@ -91,6 +91,7 @@ Special keys are displayed in a gray font, e.g.
alt="Back to the top">Back to the top</a>
</font>
<hr noshade>
<i>Last update: Thu Jun 01 12:00:00 CEST 2000 by Gerhard B&uuml;rgmann</i>
<i>Last update: June 1<sup>st</sup> 2000 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -96,6 +96,7 @@ Examples:
alt="Back to the top">Back to the top</a>
</font>
<hr noshade>
<i>Last update: Thu Jun 01 12:00:00 CEST 2000 by Gerhard B&uuml;rgmann</i>
<i>Last update: Thu Jun 01 12:00:00 CEST 2000 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -125,6 +125,7 @@ the whole remaining file has to be moved one position backwards.
alt="Back to the top">Back to the top</a>
</font>
<hr noshade>
<i>Last update: Thu Jun 01 12:00:00 CEST 2000 by Gerhard B&uuml;rgmann</i>
<i>Last update: June 1<sup>st</sup> 2000 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -1,113 +0,0 @@
<HTML><HEAD>
<TITLE>BVI Editing Files</TITLE>
<LINK REL=STYLESHEET TYPE="text/css" HREF="bvi.css">
</HEAD><BODY BGCOLOR=#ffffff BACKGROUND="gif/bg2.gif">
<A NAME="top"></A>
<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR><TD WIDTH=1% VALIGN=TOP ALIGN=CENTER><IMG SRC="gif/dot.gif" WIDTH=130 HEIGHT=1>
<HR NOSHADE WIDTH=60%>
<P>
<A CLASS="thl" HREF="index.html">Home</A>
</P>
<P>
<A CLASS="thl" HREF="quick.html">Quick Tutorial</A>
<FONT COLOR=#FFFFFF CLASS="ths">Editing Files<BR></FONT>
<A CLASS="ths" HREF="qt_search.html">Search Commands</A>
<A CLASS="ths" HREF="qt_bit.html">Bit-wise Operations</A>
<A CLASS="ths" HREF="qt_find.html">Find and Replace</A>
<A CLASS="ths" HREF="qt_yank.html">Yank and Put</A>
<A CLASS="ths" HREF="qt_set.html">Settings</A>
</P>
<P>
<A CLASS="thl" HREF="download.html">Download</A>
</P>
<HR NOSHADE WIDTH=60%>
</TD>
<TD WIDTH=1%><IMG SRC="gif/dot.gif" WIDTH=40 HEIGHT=1></TD>
<TD WIDTH=99%>
<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=0 BORDER=0>
<TR><TD WIDTH=99%>
<FONT CLASS=head>Quick Tutorial</FONT><BR>
<FONT CLASS=sub>Editing Files</FONT>
</TD><TD ALIGN=RIGHT VALIGN=BOTTOM WIDTH=116 ROWSPAN=2>
<IMG SRC="gif/bvi_s.gif" ALT="BVI" WIDTH="116" HEIGHT="62">
</TD></TR>
<TR><TD VALIGN=BOTTOM>
<HR NOSHADE>
</TD></TR></TABLE>
<P>
Inserting or deleting bytes can be dangerous on some kind of files,
because binary files are mostly executables, database files or maybe
graphic files. So you must not shift the remaining bytes to another
address.
Therefor commands for inserting or deleting bytes are disabled by
default.
You can use the <B>r</B> command to change a single byte, or
the <B>R</B> command to replace multiple characters. You can use a
numeric prefix for both commands.
<P>
You can add characters at the end of the file using the <B>A</B> command.
If you start with an empty file, you can create a binary file from
scratch. If the cursor is in the ASCII section of the screen and you
type <B><TT>100Ax</TT><FONT COLOR=#AAAAAA>ESC</FONT></B>, you create a file
which contents 100 x'es.
<P>
The <B>D</B> command can be used to truncate a file at a certain position.
Since there are no lines in a binary file, the <B>D</B> command deletes
to end of file.
<P>
If you have to edit a binary file where it does not matter to move bytes
to a different address, you can enable the insert and delete commands by
typing <B>:set memmove</B>.
Now you are able to use the <B>i</B> command for inserting bytes, the
<B>x</B> or <B>X</B> command to delete the byte over or before the cursor
and those types of <B>d</B> commands, which does not rely on text lines
(e.g. <B>d<FONT COLOR=#AAAAAA>SPACE</FONT></B>, <B>df<TT>C</TT>, d/<TT>xyz</TT>,
d$, d'a, d<TT>n</TT>G</B>).
<P>
All edits can be undone by pressing the <B>u</B> key.
<H4>Using ex (colon) commands</H4>
The edit commands of the <B>ex</B> editor are usually not available in
standard <B>vi</B> implementations (<TT>:i[nsert], :a[ppend]</TT>
and <TT>:c[hange]</TT>). In <B><FONT COLOR=#FF0000>bvi</B></FONT>
they <I>are</I> available with extended options. There are five
modifiers <TT>a[scii], b[inary], d[ecimal], h[exadecimal]</TT> and
<TT>o[ctal]</TT> (ascii is default). Therefor you can insert, append
or change data in all five representations.
<P>
<B>Example:</B><BR>
you would like to append a file with data available in decimal
representation:
<BLOCKQUOTE><PRE>
:a d
0 12 3 128 255 17 0 0 255 255
23 24 25 128 6 6 6
.
</PRE></BLOCKQUOTE>
A line with only a period (.) in it will terminate the command.
<BR>
You must not type values greater than a byte value (255 decimal, FF hex).
This causes an abandon of the command.<BR>
Pressing the <FONT COLOR=#888888>RETURN</FONT> key does <I>not</I> insert
a newline - character into the file. If you use <B>:i a</B> (insert
ascii) you can use the special characters \n, \r, \t and \0.
<P>
An additional advantage is, that all typed bytes are inserted into the
file at once. If you insert characters in vi - mode, for every byte typed,
the whole remaining file has to be moved one position backwards.
<P>
<FONT SIZE=-1>
<A CLASS="btop" HREF="#top"><IMG BORDER=0 WIDTH=16 HEIGHT=7 SRC="gif/up.gif"
ALT="Back to the top">Back to the top</A>
</FONT>
<HR NOSHADE>
<I>Last update: 17 - 06 - 2000 by Gerhard B&uuml;rgmann</I>
</TD></TR></TABLE>
</BODY>
</HTML>

View file

@ -93,6 +93,7 @@ is currently not implemented.
alt="Back to the top">Back to the top</a>
</font>
<hr noshade>
<i>Last update: Fri Jun 30 22:33:20 CEST 2000 by Gerhard B&uuml;rgmann</i>
<i>Last update: Fri Jun 30 22:33:20 CEST 2000 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -139,6 +139,7 @@ written back into the original file.
alt="Back to the top">Back to the top</a>
</font>
<hr noshade>
<i>Last update: Sun Jul 09 21:57:38 CEST 2000 by Gerhard B&uuml;rgmann</i>
<i>Last update: Sun Jul 09 21:57:38 CEST 2000 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -110,6 +110,7 @@ are line oriented, therefor <B>not</B> useful for binary files and
alt="Back to the top">Back to the top</a>
</font>
<hr noshade>
<i>Last update: Thu Jun 01 12:00:00 CEST 2000 by Gerhard B&uuml;rgmann</i>
<i>Last update: Thu Jun 01 12:00:00 CEST 2000 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -121,6 +121,7 @@ Abbreviation: <B><TT>:set wl=4<FONT COLOR=#AAAAAA>RETURN</FONT></TT></B>
alt="Back to the top">Back to the top</a>
</font>
<hr noshade>
<i>Last update: Thu Jun 01 12:00:00 CEST 2000 by Gerhard B&uuml;rgmann</i>
<i>Last update: Thu Jun 01 12:00:00 CEST 2000 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -127,6 +127,7 @@ NOTE: There are currently no namend buffers available.
alt="Back to the top">Back to the top</a>
</font>
<hr noshade>
<i>Last update: Thu Jun 01 12:00:00 CEST 2000 by Gerhard B&uuml;rgmann</i>
<i>Last update: June 1<sup>st</sup> 2000 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -194,6 +194,7 @@ You should use at most two of the three address options to avoid ambiguity!
alt="Back to the top">Back to the top</a>
</font>
<hr noshade>
<i>Last update: Thu Oct 19 20:58:31 CEST 2000 by Gerhard B&uuml;rgmann</i>
<i>Last update: October 19<sup>th</sup> 2000 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -110,7 +110,8 @@
ALT="Back to the top">Back to the top</A>
</FONT>
<HR NOSHADE>
<I>Last update: October 30<SUP>th</SUP> 1999 by Gerhard B&uuml;rgmann</I>
<I>Last update: October 30<SUP>th</SUP> 1999 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</I>
</BODY></HTML>

View file

@ -88,6 +88,9 @@ height="62" border="0"></a>
</li>
<ul>
<li>
<a class="thl" href="new132.html">New in 1.3.2</a><br>
</li>
<li>
<a class="thl" href="new131.html">New in 1.3.1</a><br>
</li>
<li>
@ -145,12 +148,13 @@ height="62" border="0"></a>
<ul>
</ul>
</ul><p>
<p><font size="-1">
<p><small>
<a class="btop" href="#top">
<img border="0" width="16" height="7" src="gif/up.gif"
alt="Back to the top">Back to the top</a>
</font>
</small>
<hr noshade>
<i>Last update: February 12<sup>th</sup> 2002 by Gerhard B&uuml;rgmann</i>
<i>Last update: January 8<sup>th</sup> 2004 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</i>
</td></tr></table>
</body></html>

View file

@ -135,7 +135,8 @@ of the command!
ALT="Back to the top">Back to the top</A>
</FONT>
<HR NOSHADE>
<I>Last update: October 30<SUP>th</SUP> 1999 by Gerhard B&uuml;rgmann</I>
<I>Last update: October 30<SUP>th</SUP> 1999 by Gerhard B&uuml;rgmann,
<a class="btop" href="http://www.purkersdorf-online.at/">Purkersdorf</a>/Austria</I>
</BODY></HTML>

View file

@ -56,7 +56,7 @@ dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
-c) instcmd=$cpprog
shift
continue;;
@ -79,7 +79,7 @@ while [ x"$1" != x ]; do
shift
continue;;
-s) stripcmd="$stripprog"
-s) stripcmd=$stripprog
shift
continue;;
@ -106,7 +106,7 @@ done
if [ x"$src" = x ]
then
echo "install: no input file specified"
echo "$0: no input file specified" >&2
exit 1
else
:
@ -116,7 +116,7 @@ if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
if [ -d "$dst" ]; then
instcmd=:
chmodcmd=""
else
@ -128,17 +128,17 @@ else
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
if [ -f "$src" ] || [ -d "$src" ]
then
:
else
echo "install: $src does not exist"
echo "$0: $src does not exist" >&2
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
echo "$0: no destination specified" >&2
exit 1
else
:
@ -147,16 +147,16 @@ else
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
if [ -d "$dst" ]
then
dst="$dst"/`basename $src`
dst=$dst/`basename "$src"`
else
:
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
@ -165,48 +165,48 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
IFS="${IFS-$defaultIFS}"
oIFS="${IFS}"
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS=$oIFS
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
pathcomp=$pathcomp$1
shift
if [ ! -d "${pathcomp}" ] ;
if [ ! -d "$pathcomp" ] ;
then
$mkdirprog "${pathcomp}"
$mkdirprog "$pathcomp"
else
:
fi
pathcomp="${pathcomp}/"
pathcomp=$pathcomp/
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
$doit $instcmd "$dst" &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
dstfile=`basename "$dst"`
else
dstfile=`basename $dst $transformbasename |
dstfile=`basename "$dst" $transformbasename |
sed $transformarg`$transformbasename
fi
@ -214,20 +214,24 @@ else
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
dstfile=`basename "$dst"`
else
:
fi
# Make a temp file name in the proper directory.
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/#inst.$$#
rmtmp=$dstdir/#rm.$$#
# Trap to clean up temp files at exit.
trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
$doit $instcmd "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits
@ -235,17 +239,38 @@ else
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
# Now remove or move aside any old file at destination location. We try this
# two ways since rm can't unlink itself on some systems and the destination
# file might be busy for other reasons. In this case, the final cleanup
# might fail but the new file should still install successfully.
{
if [ -f "$dstdir/$dstfile" ]
then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
$doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
{
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
fi &&
# The final little trick to "correctly" pass the exit status to the exit trap.
exit 0
{
(exit 0); exit
}

21
io.c
View file

@ -1,4 +1,4 @@
/* IO.C - file in/out and alloc subroutines for BVI
/* io.c - file in/out and alloc subroutines for BVI
*
* 1996-02-28 V 1.0.0
* 1999-01-20 V 1.1.0
@ -7,11 +7,12 @@
* 1999-10-15 V 1.2.0 final
* 2000-03-23 V 1.3.0 beta
* 2000-08-17 V 1.3.0 final
* 2004-01-04 V 1.3.2
*
* NOTE: Edit this file with tabstop=4 !
*
* Copyright 1996-2000 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
@ -275,6 +276,15 @@ bvi_init(dir)
return;
}
#ifdef DJGPP
strcpy(rcpath, "c:");
strcpy(rcpath, dir);
poi = strrchr(rcpath, '\\');
*poi = '\0';
strcat(rcpath, "\\BVI.RC");
read_rc(rcpath);
read_rc("BVI.RC");
#else
strncpy(rcpath, getenv("HOME"), MAXCMD - 8);
rcpath[MAXCMD - 8] = '\0';
strcat(rcpath, "/.bvirc");
@ -286,6 +296,7 @@ bvi_init(dir)
if (stat(rcpath, &buf) == 0) {
if (buf.st_uid == getuid()) read_rc(rcpath);
}
#endif
}
@ -327,7 +338,11 @@ do_shell()
{
addch('\n');
savetty();
#ifdef DJGPP
system("");
#else
system(shell);
#endif
resetty();
}

View file

@ -4,8 +4,6 @@
# Created: 1993-05-16
# Public domain
# $Id: mkinstalldirs,v 1.1 2001/05/22 14:43:50 akim Exp $
errstatus=0
dirmode=""
@ -14,20 +12,59 @@ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
# process command line arguments
while test $# -gt 0 ; do
case "${1}" in
case $1 in
-h | --help | --h*) # -h for help
echo "${usage}" 1>&2; exit 0 ;;
echo "$usage" 1>&2
exit 0
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
dirmode="${1}"
shift ;;
-- ) shift; break ;; # stop option processing
-* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option
* ) break ;; # first non-opt arg
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
case $dirmode in
'')
if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
fi
;;
*)
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
fi
;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
@ -37,7 +74,7 @@ do
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
@ -51,9 +88,8 @@ do
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=""
chmod $dirmode "$pathcomp" || lasterr=$?
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
@ -70,5 +106,6 @@ exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation:3
# sh-indentation: 2
# End:
# mkinstalldirs ends here

View file

@ -1 +1 @@
#define VERSION "1.3.1"
#define VERSION "1.3.2"

23
re.c
View file

@ -9,8 +9,8 @@
* 2000-04-25 V 1.3.0 beta
* 2000-09-29 V 1.3.0 final
*
* 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
@ -268,7 +268,8 @@ do_substitution(delim, line, startpos, endpos)
} else {
if ((n = hexchar()) < 0) {
emsg("Badly formed replacement pattern");
return 0; }
return 0;
}
repl_pat[pat_len] = n;
pat_len++;
}
@ -291,9 +292,9 @@ do_substitution(delim, line, startpos, endpos)
if (strchr(cmd, 'c')) conf = 1;
}
if ((strchr("\\#", ch) && loc == ASCII)
|| (strchr("/?", ch) && loc == HEX))
|| (strchr("/?", ch) && loc == HEX)) {
toggle();
}
startpos--;
move(maxy, 0);
refresh();
@ -377,15 +378,16 @@ searching(ch, line, startpos, endpos, flag)
if (line[0] == '\0' && again == 0) {
emsg(noprev);
return 0L; }
return 0L;
}
ignore_case = (P(P_IC));
magic = P(P_MA);
start_addr--;
if ((strchr("\\#", ch) && loc == ASCII)
|| (strchr("/?", ch) && loc == HEX))
|| (strchr("/?", ch) && loc == HEX)) {
toggle();
}
if (!strchr("Nn", ch)) {
m[0] = ch;
m[1] = '\0';
@ -439,11 +441,12 @@ searching(ch, line, startpos, endpos, flag)
if (flag & 1) {
emsg(notfound);
} else {
if (P(P_TE))
if (P(P_TE)) {
sprintf(string, "No match to %s", sdir == FORWARD ? "BOTTOM" : "TOP");
else
} else {
sprintf(string, "Address search hit %s without matching pattern",
sdir == FORWARD ? "BOTTOM" : "TOP");
}
emsg(string);
}
} else {

View file

@ -6,8 +6,8 @@
* 2000-04-25 V 1.3.0 beta
* 2000-07-12 V 1.3.0 final
*
* 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

4
script Normal file
View file

@ -0,0 +1,4 @@
set mm
0,20d
w! %.new
q

11
set.c
View file

@ -9,10 +9,11 @@
* 1999-07-02 V 1.2.0 beta
* 1999-08-14 V 1.2.0 final
* 2000-07-15 V 1.3.0 final
* 2001-10-10 V 1.3.1 cast for alloc_buf
* 2001-10-10 V 1.3.1
* 2003-07-03 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
@ -52,7 +53,7 @@ struct param params[] = {
{ "window", "window", 25, "", P_NUM },
{ "wordlength", "wl", 4, "", P_NUM },
{ "wrapscan", "ws", TRUE, "", P_BOOL },
#ifdef __MSDOS__
#if defined(__MSDOS__) && !defined(DJGPP)
{ "color", "co", 7, "", P_NUM },
#endif
{ "", "", 0, "", 0, } /* end marker */
@ -122,7 +123,7 @@ doset(arg)
params[i].nvalue = strtol(s, &s, 10);
}
params[i].flags |= P_CHANGED;
#ifdef __MSDOS__
#if defined(__MSDOS__) && !defined(DJGPP)
if (i == P_CO) {
textcolor(P(P_CO) & 0x07);
textbackground((P(P_CO) & 0xf0) >> 4);

4
set.h
View file

@ -2,8 +2,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
*
* 1998-03-14 V 1.0.0
* 1999-01-14 V 1.1.0