diff options
| author | Timo Savinen <tjsa@iki.fi> | 2005-09-22 15:39:00 +0000 |
|---|---|---|
| committer | Hadrien Dorio <hadrien.dorio@gmail.com> | 2017-12-16 00:23:56 +0100 |
| commit | 35d0e8a808dd1382d5236d1f6f8bfe62b2ebefee (patch) | |
| tree | e84242391375fab6b6e15963b4b1e0be5296b0bd /doc | |
| download | binary-block-editor-35d0e8a808dd1382d5236d1f6f8bfe62b2ebefee.tar.gz binary-block-editor-35d0e8a808dd1382d5236d1f6f8bfe62b2ebefee.zip | |
0.1.0
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/Makefile.am | 4 | ||||
| -rw-r--r-- | doc/Makefile.in | 492 | ||||
| -rw-r--r-- | doc/bbe.1 | 175 | ||||
| -rw-r--r-- | doc/bbe.info | 416 | ||||
| -rw-r--r-- | doc/bbe.texi | 413 |
5 files changed, 1500 insertions, 0 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..5d42458 --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,4 @@ +man_MANS = bbe.1 +info_TEXINFOS = bbe.texi + +EXTRA_DIST = $(man_MANS) $(info_TEXINFOS) diff --git a/doc/Makefile.in b/doc/Makefile.in new file mode 100644 index 0000000..48f5fd8 --- /dev/null +++ b/doc/Makefile.in @@ -0,0 +1,492 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = doc +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +INFO_DEPS = $(srcdir)/bbe.info +TEXINFO_TEX = $(top_srcdir)/config/texinfo.tex +am__TEXINFO_TEX_DIR = $(top_srcdir)/config +DVIS = bbe.dvi +PDFS = bbe.pdf +PSS = bbe.ps +HTMLS = bbe.html +TEXINFOS = bbe.texi +TEXI2DVI = texi2dvi +TEXI2PDF = $(TEXI2DVI) --pdf --batch +MAKEINFOHTML = $(MAKEINFO) --html +AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) +DVIPS = dvips +am__installdirs = "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)" +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(man_MANS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +ISODATE = @ISODATE@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +man_MANS = bbe.1 +info_TEXINFOS = bbe.texi +EXTRA_DIST = $(man_MANS) $(info_TEXINFOS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .dvi .html .info .pdf .ps .texi +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +.texi.info: + restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + am__cwd=`pwd` && cd $(srcdir) && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ + for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ + if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ + done; \ + else :; fi && \ + cd "$$am__cwd"; \ + if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $@ $<; \ + then \ + rc=0; \ + cd $(srcdir); \ + else \ + rc=$$?; \ + cd $(srcdir) && \ + $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ + fi; \ + rm -rf $$backupdir; exit $$rc + +.texi.dvi: + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2DVI) $< + +.texi.pdf: + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2PDF) $< + +.texi.html: + rm -rf $(@:.html=.htp) + if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $(@:.html=.htp) $<; \ + then \ + rm -rf $@; \ + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ + mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ + else \ + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ + rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ + exit 1; \ + fi +$(srcdir)/bbe.info: bbe.texi +bbe.dvi: bbe.texi +bbe.pdf: bbe.texi +bbe.html: bbe.texi +.dvi.ps: + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + $(DVIPS) -o $@ $< + +uninstall-info-am: + @$(PRE_UNINSTALL) + @if (install-info --version && \ + install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ + install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ + done; \ + else :; fi + @$(NORMAL_UNINSTALL) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ + (if cd "$(DESTDIR)$(infodir)"; then \ + echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ + rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ + else :; fi); \ + done + +dist-info: $(INFO_DEPS) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; \ + for base in $$list; do \ + case $$base in \ + $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$base; then d=.; else d=$(srcdir); fi; \ + for file in $$d/$$base*; do \ + relfile=`expr "$$file" : "$$d/\(.*\)"`; \ + test -f $(distdir)/$$relfile || \ + cp -p $$file $(distdir)/$$relfile; \ + done; \ + done + +mostlyclean-aminfo: + -rm -rf bbe.aux bbe.cp bbe.cps bbe.fn bbe.fns bbe.ky bbe.kys bbe.log bbe.pg \ + bbe.pgs bbe.tmp bbe.toc bbe.tp bbe.tps bbe.vr bbe.vrs \ + bbe.dvi bbe.pdf bbe.ps bbe.html + +maintainer-clean-aminfo: + @list='$(INFO_DEPS)'; for i in $$list; do \ + i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ + echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ + rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ + done +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ + done +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-info +check-am: all-am +check: check-am +all-am: Makefile $(INFO_DEPS) $(MANS) +installdirs: + for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: $(DVIS) + +html: html-am + +html-am: $(HTMLS) + +info: info-am + +info-am: $(INFO_DEPS) + +install-data-am: install-info-am install-man + +install-exec-am: + +install-info: install-info-am + +install-info-am: $(INFO_DEPS) + @$(NORMAL_INSTALL) + test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ + for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ + $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ + if test -f $$ifile; then \ + relfile=`echo "$$ifile" | sed 's|^.*/||'`; \ + echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \ + $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \ + else : ; fi; \ + done; \ + done + @$(POST_INSTALL) + @if (install-info --version && \ + install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ + install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ + done; \ + else : ; fi +install-man: install-man1 + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-aminfo \ + maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-aminfo mostlyclean-generic + +pdf: pdf-am + +pdf-am: $(PDFS) + +ps: ps-am + +ps-am: $(PSS) + +uninstall-am: uninstall-info-am uninstall-man + +uninstall-man: uninstall-man1 + +.PHONY: all all-am check check-am clean clean-generic dist-info \ + distclean distclean-generic distdir dvi dvi-am html html-am \ + info info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-man1 install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-aminfo maintainer-clean-generic mostlyclean \ + mostlyclean-aminfo mostlyclean-generic pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-info-am uninstall-man \ + uninstall-man1 + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/doc/bbe.1 b/doc/bbe.1 new file mode 100644 index 0000000..fef176d --- /dev/null +++ b/doc/bbe.1 @@ -0,0 +1,175 @@ +.\" hey, Emacs: -*- nroff -*- +.\" 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 of the License, 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. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this program; if not, write to the Free Software +.\" Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +.\" +.\" Please update the above date whenever this man page is modified. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins (default) +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp <n> insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.TH "BBE" "1" "August 24, 2005" "" "" +.SH "NAME" +bbe \- Binary block editor +.SH "SYNOPSIS" +.B bbe +.RI [ options ]... [input\-file]... + +.SH "DESCRIPTION" +\fBbbe\fP is a sed\-like editor for binary files. It performs binary transformations on the blocks of input stream. +.SH "OPTIONS" +\fBbbe\fP accepts the following options: +.TP +.BR \-b ", " \-\-block=\fIBLOCK\fP +Block definition. +.TP +.BR \-e ", " \-\-expression=\fICOMMAND\fR +Add the COMMAND to the commands to be executed. +.TP +.BR \-f ", " \-\-file=\fIscript\-file\fP +Add the contest of script\-file to commands. +.TP +.BR \-o ", " \-\-output=\fIname\fP +Write output to \fIname\fP instead of standard output. +.TP +.BR \-? ", " \-\-help +List all available options and their meanings. +.TP +.BR \-V ", " \-\-version +Show version of program. +.BR +.LP +BLOCK can be defined as: +.TP +N:M +Where N'th byte starts a M bytes long block (first byte is 0). +.TP +:M +Block length in input stream is M. +.TP +/start/:M +String \fIstart\fP starts M bytes long block. +.TP +/start/:/stop/ +String \fIstart\fP starts the block and block ends to string \fIstop\fR +.TP +/start/: +String \fIstart\fR starts the block and block will end at next occurence of \fIstart\fR. Only the first \fIstart\fR is included to the block. +.TP +:/stop/ +Block starts at the beginning of input stream (or at the end of previous block) and ends at the next occurrence of \fIstop\fR. String \fIstop\fR will be included to the block. +.P +Special value '$' of M means the end of stream. +.P +Default value for block is 0:$, meaning the whole input stream. +.P +Both \fIstart\fR and \fIstop\fR strings are included to block. Nonprintable characters can be escaped as +.IP +\\nnn +decimal +.IP +\\xnn +hexadecimal +.IP +\\0nnn +octal +.LP +Character '\\' can be escaped as '\\\\'. +.LP +Length (N and M) can be defined as decimal (n), hexadecimal (xn) or octal (0n) value. +.SH "COMMAND SYNOPSIS" +bbe has two type of commands: block and byte commands, both are allways related to current block. That means that the input stream outside of block remains untouched. +.LP +\fBBlock commands\fR +.TP +D [\fIn\fR] +Delete the \fIn\fR'th block. Without \fIn\fR, all found blocks are deleted from the output stream. +.TP +A \fIstring\fR +Append the string \fIstring\fR before the block. +.TP +I \fIstring\fR +Insert the string \fIstring\fR at the end of block. +.TP +J \fIn\fR +Skip \fIn\fR blocks before executing commands after this command. +.TP +L \fIn\fR +Leave all blocks unmodified starting from block number \fIn\fR. Affects only commands after this command. +.LP +\fBByte commands\fR +.br +\fIn\fR in byte commands is offset from the beginning of current block (starts from zero). +.TP +r \fIn\fR \fIstring\fR +Replace bytes starting at position \fIn\fR with string \fIstring\fR. +.TP +i \fIn\fR \fIstring\fR +Insert \fIstring\fR starting at position \fIn\fR. +.TP +s/\fIsearch\fR/\fIreplace\fR/ +Replace all occurrences of \fIsearch\fR with \fIreplace\fR. +.TP +y/\fIsource\fR/\fIdest\fR/ +Translate bytes in \fIsource\fR to the corresponding bytes in \fIdest\fR. \fISource\fR and \fIdest\fR must have equal length. +.TP +d \fIn\fR \fIm\fR +Delete \fIm\fR bytes starting from the offset \fIn\fR. +.TP +c \fIfrom\fR \fIto\fR +Convert bytes from format \fIfrom\fR to \fIto\fR. Currently supported formats are: +.IP +BCD +Binary coded decimal +.IP +ASC +Ascii +.TP +j \fIn\fR +Commands after the j\-command are ignored for first \fIn\fR bytes of the block. +.TP +l \fIn\fR +Commands after the l\-command are ignored from \fIn\fR'th byte of the block. +.TP +w \fIfile\fR +Write bytes from the current block to file \fIfile\fR. Commands before w\-command have effect to what will be written. +.LP +Nonvisible characters in strings can be escaped same way as in block definition strings. Character '/' in s and y commands can be any visible character. +.LP +Note that the D, A, I, c, s, i, y and d commands cause the length of input and output streams to be different. + +.SH "EXAMPLES" +.TP +bbe \-e "s/c:\\\\temp\\\\data1.txt/c:\\\\temp\\\\data2.txt/" file1 +all occurences of "c:\\temp\\data1.txt" in file file1 are changed to "c:\\temp\\data2.txt" +.TP +bbe \-b 0420:16 \-e "r 4 \\x12\\x4a" file1 +Two bytes starting at fifth byte of a 16 byte long block starting at offset 0420 (octal) in file1 are changed to hexadecimal values 12 and 4a. +.TP +bbe \-b :16 \-e "I \\x0a" file1 +New line character is added after every block, block length is 16. +.TP +bbe \-b "/\\x2f\\x34\\x6a/:/\\xff\\xff/" \-e "y/\\x2f\\x34\\x6a\\xff/____/" \-e "w /tmp/data" +Blocks between strings "\\x2f\\x34\\x6a" and "\\xff\\xff" are written to file /tmp/data. Before writing the block start and end strings are converted to ___ and __. +.SH "SEE ALSO" +.BR sed (1). + +.SH "AUTHOR" +Timo Savinen <tjsa@iki.fi >. diff --git a/doc/bbe.info b/doc/bbe.info new file mode 100644 index 0000000..a8c5a3f --- /dev/null +++ b/doc/bbe.info @@ -0,0 +1,416 @@ +This is bbe.info, produced by makeinfo version 4.7 from bbe.texi. + + This file documents the `bbe' - binary block editor + + Copyright (C) 2005 Timo Savinen + + Permission is granted to make and distribute verbatim copies of + this manual provided the copyright notice and this permission + notice are preserved on all copies. + + Permission is granted to copy and distribute modified versions of + this manual under the conditions for verbatim copying, provided + that the entire resulting derived work is distributed under the + terms of a permission notice identical to this one. + + Permission is granted to copy and distribute translations of this + manual into another language, under the above conditions for + modified versions. + + +File: bbe.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) + +bbe +*** + +This file documents the `bbe' - binary block editor + + Copyright (C) 2005 Timo Savinen + + Permission is granted to make and distribute verbatim copies of + this manual provided the copyright notice and this permission + notice are preserved on all copies. + + Permission is granted to copy and distribute modified versions of + this manual under the conditions for verbatim copying, provided + that the entire resulting derived work is distributed under the + terms of a permission notice identical to this one. + + Permission is granted to copy and distribute translations of this + manual into another language, under the above conditions for + modified versions. + +* Menu: + +* Overview:: Preliminary information. +* Samples:: Samples using `bbe'. +* Invoking bbe:: How to run `bbe'. +* bbe programs:: How `bbe' works. +* Problems:: Reporting bugs. + + +File: bbe.info, Node: Overview, Next: Samples, Prev: Top, Up: Top + +1 Preliminary information +************************* + +The `bbe' program is a sed-like editor for binary files. `bbe' performs +basic byte related transformations on blocks of input stream. `bbe' is +non-interactive command line tool and can be used as a part of a +pipeline. `bbe' makes only one pass over input stream. + + +File: bbe.info, Node: Samples, Next: Invoking bbe, Prev: Overview, Up: Top + +2 Samples using `bbe' +********************* + +Few examples of running `bbe': + +`bbe -b "/\x80\x50\x0e/:12" -e "d 0 3" -e "c BCD ASC" -e "I \x0a" -e "w /tmp/numbers" -o /dev/null /tmp/bdata' + Task here is to extract BCD coded numbers from the file + `/tmp/bdata' and write them in ascii format with newline to file + `/tmp/numbers'. 12 bytes long blocks containing the BCD-numbers + start with three byte sequence of values `0x80', `0x50' and + `0x0e'. First three bytes (the block start sequence) are removed + (`d 0 3') rest of the block is transformed from BCD to Ascii (`c + BCD ASC') and a newline character is inserted at the end of the + block (`I \x0a'). All transformed blocks are written to + `/tmp/numbers' (`w /tmp/numbers'). Nothing is written to the + output (`-o /dev/null'). +`bbe -b ":525" -e "i 524 \x0a" -o /tmp/data_with_nl /tmp/data' + A newline is added after every 525'th byte of the file + `/tmp/data'. Data with newlines is written to `/tmp/data_with_nl'. +`bbe -b ":526" -e "d 525 1" -o /tmp/data /tmp/data_with_nl' + Every 526'th byte (inserted newline in previous example) is + removed from the file `/tmp/data_with_nl'. Data without newlines + is written to `/tmp/data'. +`bbe -e "s/\x0d\x0a/\x0a/"' + Same effect as has command `dos2unix'. + + +File: bbe.info, Node: Invoking bbe, Next: bbe programs, Prev: Samples, Up: Top + +3 How to run `bbe' +****************** + +`bbe' accepts several commands to operate on blocks. Commands are +executed in the same order as they appear in command line or in a +script file. Order is significant, because the changes made by +previous commands are seen by next commands. + +* Menu: + +* Invocation:: Program invocation +* Block:: Block definition +* Commands:: bbe commands +* Limits:: Limitations + + +File: bbe.info, Node: Invocation, Next: Block, Up: Invoking bbe + +3.1 Program invocation +====================== + +The format for running the `bbe' program is: + + bbe OPTION ... + + `bbe' supports the following options: + +`-b BLOCK' +`--block=BLOCK' + Block definition. + +`-e COMMAND' +`--expression=COMMAND' + Add command to the commands to be executed. + +`-f SCRIPT-FILE' +`--file=SCRIPT-FILE' + Add commands from SCRIPT-FILE to the commands to be executed. + +`-o FILE' +`--output=FILE' + Write output to FILE instead of standard output. + +`-?' +`--help' + Print an informative help message describing the options and then + exit successfully. + +`-V' +`--version' + Print the version number of `bbe' and then exit successfully. + + All remaining options are names of input files, if no input files +are specified, then the standard input is read. + + +File: bbe.info, Node: Block, Next: Commands, Prev: Invocation, Up: Invoking bbe + +3.2 Block definition +==================== + +`bbe' devides the input stream to blocks defined by the `-b' option. If +block is not defined, the whole input stream is considered as one +block. Commands have effect only inside a block, rest of the input +stream remains untouched. Currently `bbe' supports only one block +definition per invocation. If input stream consists of different blocks, +several `bbe's can be combined in a pipeline. + + A block can be defined several ways: + +`N:M' + Block starts at offset N of input stream (first byte is 0). Block + is M bytes long. This definition allows only one block to be + defined. + +`:M' + The whole input stream is divided to M-size blocks. + +`/START/:/STOP/' + Blocks start with sequence START and end with sequence STOP. Both + START and STOP are included to blocks. + +`/START/:' + Blocks start with sequence START and ends at next occurrence of + START. Only the first START is included to block. + +`:/STOP/' + Blocks start at the beginning of input stream or after the end of + previous block. Block ends at first occurrence of STOP. Only the + last STOP is included to blocks. + + It is possible to use c-like byte values in N, M, START and STOP. +Values in START and STOP must be escaped with `\', `\' can be escaped +as `\\'. + + Byte values can be expressed in decimal, octal or hexadecimal e.g. +in START and STOP: + +`\123, \32 or \0' + Decimal values + +`\012, \08 or \0278' + Octal values + +`\x0a, \x67 or \xff' + Hexadecimal values + + Values of N and M can be given in decimal, octal and hexadecimal: + +`123, 32 or 112232' + Decimal values + +`0128, 08123 or 0' + Octal values + +`x456a, x167 or xffde' + Hexadecimal values + + +File: bbe.info, Node: Commands, Next: Limits, Prev: Block, Up: Invoking bbe + +3.3 `bbe' commands +================== + +Commands in `bbe' can be divided in two groups: Block related commands +and byte related commands. Block related commands operate at block +level e.g. remove a block. Byte related commands work allways inside a +block and they don't have effect beyond the block boundaries. + + Same escape codes for byte values in STRINGs can be used as in START +and STOP of block definition. + +Block commands are: +------------------- + +`A STRING' + Write the STRING to output stream before the block. + +`D [N]' + Delete the N'th block. If N is not defined all blocks are deleted + from output stream. *Note*: First block is number one. + +`I STRING' + Write the STRING to output stream after the block. + +`J N' + Commands appearing after this command have no effect until N + blocks are found. Means "Jump first N blocks". *Note*: Commands + that are defined before this command have effect on every block. + +`L N' + Commands appearing after this command have no effect after N + blocks are found. Means "Leave blocks after N'th block". *Note*: + Commands that are defined before this command have effect on every + block. + +Byte commands are: +------------------ + +*Note*: The N in byte commands is offset from the beginning of current +block, first byte is number zero. + +`c FROM TO' + Converts bytes from FROM to TO. Currently supported formats are: + `ASC' + Ascii + + `BCD' + Binary Coded Decimal + *Note:* Bytes, that cannot be converted are passed through as they + are. e.g. in ASC -> BCD conversion, ASCII characters not in range + `'0'' - `'9'' are not converted. + +`d N M' + Delete M bytes starting from the offset N. + +`i N STRING' + Insert STRING after byte number N. + +`j N' + Commands appearing after `j'-command have no effect concerning + bytes 0-N of the block. + +`l N' + Commands appearing after `l'-command have no effect concerning + bytes starting from the byte number N of the block. + +`r N STRING' + Replace bytes with STRING starting at the byte number N of the + block. + +`s/SEARCH/REPLACE/' + All occurences of SEARCH are replaced by REPLACE. REPLACE can be + empty. Separator `/' can be replaced by any character not present + in SEARCH or REPLACE. + +`w `file'' + Contents of blocks are written to file `file'. *Note*: Data + inserted by commands `A' and `I' are not written to file `file' + and `J' and `L' commands have no effect on `w'-commands. + +`y/SOURCE/DEST/' + Translate bytes in SOURCE to the corresponding bytes in DEST. + SOURCE and DEST must have equal length. Separator `/' can be + replaced by any character not present in SOURCE or DEST. + + +File: bbe.info, Node: Limits, Prev: Commands, Up: Invoking bbe + +3.4 Limitations +=============== + +At least in GNU/Linux `bbe' should be able to handle big files (>4GB), +other systems are not tested. + + There are however, some limitations in block and command definitions: + +_Strings in block definition_ +_Search string in `s' command_ + are limited to _16384_ bytes. +_Total data to be inserted by `s' and `i' commands_ + is _245760_ bytes, that means the total data in command + definitions, of course it can be inserted several times. + + +File: bbe.info, Node: bbe programs, Next: Problems, Prev: Invoking bbe, Up: Top + +4 How `bbe' works +***************** + +`bbe' scans the input stream just once, so the last block may differ +from the block definition, because `bbe' doesn't 'peek' the end of the +input stream. Last block may be shorter than defined, e.g. if block is +defined as `/string/:128' and if the end of input stream is found +before 128'th byte of the last block is reached, the last block remains +shorter. + +Basic execution cycle: +---------------------- + + 1. Start of the block is searched. If found, data before block is + written to output stream and step 2 is executed. + + 2. Block commands affecting the start of the block (`A', `D' and `J') + are executed. + + 3. The block is scanned byte by byte and all byte commands (lower + case letters) are executed. *Note*: Commands are executed on + results of previous commands, if e.g. the first byte of the block + is deleted, the following commands don't 'see' the removed byte. + + 4. When end of the block is reached the end of the block commands + (`I') are executed. + + 5. Next block is searched, data between the blocks is written to + output stream. + +Few examples: +------------- + +`echo "The quick brown fox jumps over a lazy dog" | bbe -b "/The/:21" -e "j 4" -e "s/ /X/"' + Output is + The quickXbrownXfoxXjumps over a lazy dog + The only block in this is + The quick brown fox j + All spaces in the block are converted to X's, before conversion + first 4 bytes are skipped. + +`echo "The quick brown fox jumps over a lazy dog" | bbe -b ":/ /" -e "J 1" -e "I \x0a"' + Output is: + The quick + brown + fox + jumps + over + a + lazy + dog + All blocks end at space, a newline character is inserted after + every block except the first block. + +`echo "The quick brown fox jumps over a lazy dog" | bbe -e "r 4 fast\x20" -e "s/f/c/"' + Output is: + The cast brown cox jumps over a lazy dog + Also the `f' in `fast' is converted to `c'. + +`echo "1234567890" | bbe -b ":1" -e "L 9" -e "I -"' + Output is + 1-2-3-4-5-6-7-8-9-0 + Minus is inserted after every 1 byte long block,but not after 9'th + block. + + +File: bbe.info, Node: Problems, Prev: bbe programs, Up: Top + +5 Reporting Bugs +**************** + +If you find a bug in `bbe', please send electronic mail to +<tjsa@iki.fi>. Include the version number, which you can find by +running `bbe --version'. Also include in your message the output that +the program produced and the output you expected. + + If you have other questions, comments or suggestions about `bbe', +contact the author via electronic mail to <tjsa@iki.fi>. The author +will try to help you out, although he may not have time to fix your +problems. + + + +Tag Table: +Node: Top766 +Node: Overview1811 +Node: Samples2201 +Node: Invoking bbe3599 +Node: Invocation4117 +Node: Block4980 +Node: Commands6784 +Node: Limits9572 +Node: bbe programs10123 +Node: Problems12406 + +End Tag Table diff --git a/doc/bbe.texi b/doc/bbe.texi new file mode 100644 index 0000000..b5d830e --- /dev/null +++ b/doc/bbe.texi @@ -0,0 +1,413 @@ +\input texinfo @c -*-texinfo-*- +@c This file uses the @command command introduced in Texinfo 4.0. +@c %**start of header +@setfilename bbe.info +@settitle bbe - binary block editor +@finalout +@c %**end of header + +@set VERSION 0.1.0 + +@copying +This file documents the @command{bbe} - binary block editor + +Copyright @copyright{} 2005 Timo Savinen + +@quotation +Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +are preserved on all copies. + +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions. +@end quotation +@end copying + +@titlepage +@title bbe +@subtitle binary block editor +@subtitle Version @value{VERSION} +@author by Timo Savinen + +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage + +@c All the nodes can be updated using the EMACS command +@c texinfo-every-node-update, which is normally bound to C-c C-u C-e. +@ifnottex +@node Top, Overview, (dir), (dir) +@top bbe + +@insertcopying +@end ifnottex + + +@c All the menus can be updated with the EMACS command +@c texinfo-all-menus-update, which is normally bound to C-c C-u C-a. +@menu +* Overview:: Preliminary information. +* Samples:: Samples using @command{bbe}. +* Invoking bbe:: How to run @command{bbe}. +* bbe programs:: How @command{bbe} works. +* Problems:: Reporting bugs. +@end menu + +@node Overview, Samples, Top, Top +@chapter Preliminary information +@cindex greetings +@cindex overview + +The @command{bbe} program is a sed-like editor for binary files. @command{bbe} +performs basic byte related transformations on blocks of input stream. @command{bbe} is non-interactive command line tool and +can be used as a part of a pipeline. @command{bbe} makes only one pass over input stream. + +@node Samples, Invoking bbe, Overview, Top +@chapter Samples using @command{bbe} +@cindex sample + +Few examples of running @command{bbe}: + +@table @samp +@item bbe -b "/\x80\x50\x0e/:12" -e "d 0 3" -e "c BCD ASC" -e "I \x0a" -e "w /tmp/numbers" -o /dev/null /tmp/bdata +Task here is to extract BCD coded numbers from the file @file{/tmp/bdata} and write them +in ascii format with newline to file @file{/tmp/numbers}. +12 bytes long blocks containing the BCD-numbers start with three byte sequence of +values @samp{0x80}, @samp{0x50} and @samp{0x0e}. First three bytes (the block start sequence) +are removed (@samp{d 0 3}) rest of the block is transformed from BCD to Ascii (@samp{c BCD ASC}) and a newline character is +inserted at the end of the block (@samp{I \x0a}). +All transformed blocks are written to @file{/tmp/numbers} (@samp{w /tmp/numbers}). Nothing is written to +the output (@samp{-o /dev/null}). +@* + +@item bbe -b ":525" -e "i 524 \x0a" -o /tmp/data_with_nl /tmp/data +A newline is added after every 525'th byte of the file @file{/tmp/data}. Data with newlines is written to @file{/tmp/data_with_nl}. +@* + +@item bbe -b ":526" -e "d 525 1" -o /tmp/data /tmp/data_with_nl +Every 526'th byte (inserted newline in previous example) is removed from the file @file{/tmp/data_with_nl}. Data without newlines is written to @file{/tmp/data}. +@* + +@item bbe -e "s/\x0d\x0a/\x0a/" +Same effect as has command @command{dos2unix}. +@end table + +@node Invoking bbe, bbe programs, Samples, Top +@chapter How to run @command{bbe} +@cindex running bbe +@cindex using + +@command{bbe} accepts several commands to operate on blocks. Commands are +executed in the same order as they appear in command line or in a script file. +Order is significant, because the changes made by previous commands are +seen by next commands. + +@menu +* Invocation:: Program invocation +* Block:: Block definition +* Commands:: bbe commands +* Limits:: Limitations +@end menu + +@node Invocation, Block, , Invoking bbe +@section Program invocation +@cindex options + +The format for running the @command{bbe} program is: + +@example +bbe @var{option} @dots{} +@end example + +@code{bbe} supports the following options: + +@c Formatting copied from the Texinfo 4.0 manual. +@table @code +@item -b @var{BLOCK} +@itemx --block=@var{BLOCK} +Block definition. + + +@item -e @var{COMMAND} +@itemx --expression=@var{COMMAND} +Add command to the commands to be executed. + + +@item -f @var{script-file} +@itemx --file=@var{script-file} +Add commands from @var{script-file} to the commands to be executed. + + +@item -o @var{file} +@itemx --output=@var{file} +Write output to @var{file} instead of standard output. + + +@item -? +@itemx --help +Print an informative help message describing the options and then exit +successfully. + + +@item -V +@itemx --version +Print the version number of @command{bbe} and then exit successfully. +@end table + +All remaining options are names of input files, if no input files are specified, then the standard input is read. + +@node Block, Commands, Invocation, Invoking bbe +@section Block definition +@cindex block + +@command{bbe} devides the input stream to blocks defined by the @code{-b} option. If block is +not defined, the whole input stream is considered as one block. Commands have effect only inside a block, rest of the input stream +remains untouched. Currently @command{bbe} supports only one block definition per invocation. If input stream consists of different blocks, +several @command{bbe}s can be combined in a pipeline. + +A block can be defined several ways: + +@table @code +@item @var{N}:@var{M} +Block starts at offset @var{N} of input stream (first byte is 0). Block is @var{M} bytes long. This definition allows +only one block to be defined. + +@item :@var{M} +The whole input stream is divided to @var{M}-size blocks. + +@item /@var{start}/:/@var{stop}/ +Blocks start with sequence @var{start} and end with sequence @var{stop}. Both @var{start} and @var{stop} are included to blocks. + +@item /@var{start}/: +Blocks start with sequence @var{start} and ends at next occurrence of @var{start}. Only the first @var{start} is included to block. + +@item :/@var{stop}/ +Blocks start at the beginning of input stream or after the end of previous block. Block ends at first occurrence of @var{stop}. +Only the last @var{stop} is included to blocks. +@end table + +It is possible to use c-like byte values in @var{N}, @var{M}, @var{start} and @var{stop}. +Values in @var{start} and @var{stop} must be escaped with @code{\}, @code{\} can be escaped as @code{\\}. + +Byte values can be expressed in decimal, octal or hexadecimal e.g. in @var{start} and @var{stop}: + +@table @code +@item \123, \32 or \0 +Decimal values + +@item \012, \08 or \0278 +Octal values + +@item \x0a, \x67 or \xff +Hexadecimal values +@end table + +Values of @var{N} and @var{M} can be given in decimal, octal and hexadecimal: + +@table @code +@item 123, 32 or 112232 +Decimal values + +@item 0128, 08123 or 0 +Octal values + +@item x456a, x167 or xffde +Hexadecimal values +@end table + +@node Commands, Limits, Block, Invoking bbe +@section @command{bbe} commands +@cindex commands + +Commands in @command{bbe} can be divided in two groups: Block related commands +and byte related commands. Block related commands operate at block level e.g. remove a block. +Byte related commands work allways inside a block and they don't have effect beyond the block boundaries. + +Same escape codes for byte values in @var{string}s can be used as in @var{start} and @var{stop} of block definition. + +@subheading Block commands are: + +@table @code +@item A @var{string} +Write the @var{string} to output stream before the block. + +@item D [@var{N}] +Delete the @var{N}'th block. If @var{N} is not defined all blocks are deleted from output stream. +@strong{Note}: First block is number one. + +@item I @var{string} +Write the @var{string} to output stream after the block. + +@item J @var{N} +Commands appearing after this command have no effect until @var{N} blocks are found. Means "Jump first @var{N} blocks". +@strong{Note}: Commands that are defined before this command have effect on every block. + +@item L @var{N} +Commands appearing after this command have no effect after @var{N} blocks are found. Means "Leave blocks after @var{N}'th block". +@strong{Note}: Commands that are defined before this command have effect on every block. +@end table + +@subheading Byte commands are: + +@strong{Note}: The @var{n} in byte commands is offset from the beginning of current block, first byte is number zero. + +@table @code +@item c @var{from} @var{to} +Converts bytes from @var{from} to @var{to}. Currently supported formats are: +@table @code +@item ASC +Ascii + +@item BCD +Binary Coded Decimal +@end table +@strong{Note:} Bytes, that cannot be converted are passed through as they are. e.g. in ASC -> BCD conversion, ASCII characters not +in range @code{'0'} -- @code{'9'} are not converted. + +@item d @var{n} @var{m} +Delete @var{m} bytes starting from the offset @var{n}. + +@item i @var{n} @var{string} +Insert @var{string} after byte number @var{n}. + +@item j @var{n} +Commands appearing after @code{j}-command have no effect concerning bytes 0-@var{n} of the block. + +@item l @var{n} +Commands appearing after @code{l}-command have no effect concerning bytes starting from the byte number @var{n} of the block. + +@item r @var{n} @var{string} +Replace bytes with @var{string} starting at the byte number @var{n} of the block. + +@item s/@var{search}/@var{replace}/ +All occurences of @var{search} are replaced by @var{replace}. @var{replace} can be empty. Separator @code{/} can be replaced by any +character not present in @var{search} or @var{replace}. + +@item w @file{file} +Contents of blocks are written to file @file{file}. @strong{Note}: Data inserted by commands @code{A} and @code{I} +are not written to file @file{file} and @code{J} and @code{L} commands have no effect on @code{w}-commands. + +@item y/@var{source}/@var{dest}/ +Translate bytes in @var{source} to the corresponding bytes in @var{dest}. @var{source} and @var{dest} must have equal length. +Separator @code{/} can be replaced by any character not present in @var{source} or @var{dest}. +@end table + +@node Limits, , Commands, Invoking bbe +@section Limitations +@cindex big files +@cindex limits + +At least in GNU/Linux @command{bbe} should be able to handle big files (>4GB), other +systems are not tested. + +There are however, some limitations in block and command definitions: + +@table @emph +@item Strings in block definition +@itemx Search string in @code{s} command +are limited to @emph{16384} bytes. +@* + +@item Total data to be inserted by @code{s} and @code{i} commands +is @emph{245760} bytes, that means the total data in command definitions, of course it can be inserted several times. +@* +@end table + + +@node bbe programs, Problems, Invoking bbe, Top +@chapter How @command{bbe} works + +@command{bbe} scans the input stream just once, so the last block may differ from the block definition, because @command{bbe} doesn't +'peek' the end of the input stream. Last block may be shorter than defined, e.g. if block is defined as @samp{/string/:128} +and if the end of input stream is found before 128'th byte of the last block is reached, the last block remains shorter. + +@subheading Basic execution cycle: + +@enumerate +@item +Start of the block is searched. If found, data before block is written to output stream and +step 2 is executed. + +@item +Block commands affecting the start of the block (@code{A}, @code{D} and @code{J}) are executed. + +@item +The block is scanned byte by byte and all byte commands (lower case letters) are executed. +@strong{Note}: Commands are executed on results of previous commands, if e.g. the first byte of the block is deleted, +the following commands don't 'see' the removed byte. + +@item +When end of the block is reached the end of the block commands (@code{I}) are executed. + +@item +Next block is searched, data between the blocks is written to output stream. +@end enumerate + +@subheading Few examples: + +@table @samp +@item echo "The quick brown fox jumps over a lazy dog" | bbe -b "/The/:21" -e "j 4" -e "s/ /X/" +Output is +@example +The quickXbrownXfoxXjumps over a lazy dog +@end example +The only block in this is +@example +The quick brown fox j +@end example +All spaces in the block are converted to X's, before conversion first 4 bytes are skipped. + +@item echo "The quick brown fox jumps over a lazy dog" | bbe -b ":/ /" -e "J 1" -e "I \x0a" +Output is: +@example +The quick +brown +fox +jumps +over +a +lazy +dog + +@end example +All blocks end at space, a newline character is inserted after every block except the first block. + +@item echo "The quick brown fox jumps over a lazy dog" | bbe -e "r 4 fast\x20" -e "s/f/c/" +Output is: +@example +The cast brown cox jumps over a lazy dog +@end example +Also the @code{f} in @code{fast} is converted to @code{c}. + +@item echo "1234567890" | bbe -b ":1" -e "L 9" -e "I -" +Output is +@example +1-2-3-4-5-6-7-8-9-0 +@end example +Minus is inserted after every 1 byte long block,but not after 9'th block. +@end table + + +@node Problems, , bbe programs, Top +@chapter Reporting Bugs +@cindex bugs +@cindex problems + +If you find a bug in @command{bbe}, please send electronic mail to +@email{tjsa@@iki.fi}. Include the version number, which you can find by +running @w{@samp{bbe --version}}. Also include in your message the +output that the program produced and the output you expected.@refill + +If you have other questions, comments or suggestions about +@command{bbe}, contact the author via electronic mail to +@email{tjsa@@iki.fi}. The author will try to help you out, although he +may not have time to fix your problems. + +@contents +@bye |

