aboutsummaryrefslogtreecommitdiffstats
diff options
context:
-rw-r--r--.hg_archival.txt2
-rw-r--r--Make.rules2
-rw-r--r--README7
-rw-r--r--lib/libdvbsec/dvbsec_api.c17
-rw-r--r--util/Makefile2
-rw-r--r--util/alevt/COPYRIGHT297
-rw-r--r--util/alevt/ChangeLog535
-rw-r--r--
'rem' style='width: 0.0%;'/> -rw-r--r--util/alevt/Makefile130
-rw-r--r--util/alevt/README72
-rw-r--r--util/alevt/README.OLD78
-rw-r--r--util/alevt/ReadmeGR28
-rw-r--r--util/alevt/TODO12
-rw-r--r--util/alevt/alevt-cap.153
-rw-r--r--util/alevt/alevt-cap.c280
-rw-r--r--util/alevt/alevt-date.141
-rw-r--r--util/alevt/alevt-date.c225
-rw-r--r--util/alevt/alevt.160
-rw-r--r--util/alevt/alevt.desktop9
-rw-r--r--util/alevt/bdf2xbm.c212
-rw-r--r--util/alevt/cache.c229
-rw-r--r--util/alevt/cache.h41
-rw-r--r--util/alevt/dllist.h55
-rw-r--r--util/alevt/exp-gfx.c258
-rw-r--r--util/alevt/exp-html.c299
-rw-r--r--util/alevt/exp-txt.c226
-rw-r--r--util/alevt/export.c364
-rw-r--r--util/alevt/export.h66
-rw-r--r--util/alevt/fdset.c97
-rw-r--r--util/alevt/fdset.h28
-rw-r--r--util/alevt/font.c5
-rw-r--r--util/alevt/font.h19
-rw-r--r--util/alevt/hamm.c229
-rw-r--r--util/alevt/hamm.h7
-rw-r--r--util/alevt/help.c83
-rw-r--r--util/alevt/help.h8
-rw-r--r--util/alevt/icon.xbm17
-rw-r--r--util/alevt/lang.c393
-rw-r--r--util/alevt/lang.h28
-rw-r--r--util/alevt/main.c221
-rw-r--r--util/alevt/misc.c66
-rw-r--r--util/alevt/misc.h32
-rw-r--r--util/alevt/os.h7
-rw-r--r--util/alevt/search.c127
-rw-r--r--util/alevt/search.h16
-rw-r--r--util/alevt/ui.c721
-rw-r--r--util/alevt/ui.h35
-rw-r--r--util/alevt/vbi.c942
-rw-r--r--util/alevt/vbi.h47
-rw-r--r--util/alevt/vt.h62
-rw-r--r--util/alevt/vt900.out29
-rw-r--r--util/alevt/vt901.out29
-rw-r--r--util/alevt/vt902.out29
-rw-r--r--util/alevt/vt903.out29
-rw-r--r--util/alevt/vt904.out29
-rw-r--r--util/alevt/vt905.out29
-rw-r--r--util/alevt/vt906.out29
-rw-r--r--util/alevt/vt907.out29
-rw-r--r--util/alevt/vt908.out29
-rw-r--r--util/alevt/vt909.out29
-rw-r--r--util/alevt/vt910.out29
-rw-r--r--util/alevt/vt911.out29
-rw-r--r--util/alevt/vt912.out29
-rw-r--r--util/alevt/vt913.out29
-rw-r--r--util/alevt/vt914.out29
-rw-r--r--util/alevt/vt915.out29
-rw-r--r--util/alevt/vtxt-iso8859-7.bdf5768
-rw-r--r--util/alevt/vtxt-koi8.bdf5906
-rw-r--r--util/alevt/vtxt-latin-1.bdf5906
-rw-r--r--util/alevt/vtxt-latin-2.bdf5906
-rw-r--r--util/alevt/xio.c1156
-rw-r--r--util/alevt/xio.h80
-rw-r--r--util/atsc_epg/Makefile16
-rw-r--r--util/atsc_epg/README12
-rw-r--r--util/atsc_epg/atsc_epg.c1249
-rw-r--r--util/femon/femon.c57
-rw-r--r--util/gotox/Makefile17
-rw-r--r--util/gotox/gotox.c145
-rw-r--r--util/scan/dvb-c/at-Kabel-Braunau26
-rw-r--r--util/scan/dvb-c/at-Kabelsignal38
-rw-r--r--util/scan/dvb-c/at-KarrerNet18
-rw-r--r--util/scan/dvb-c/hu-Digikabel24
-rw-r--r--util/scan/dvb-c/nl-Casema3
-rw-r--r--util/scan/dvb-c/nl-Ziggo14
-rw-r--r--util/scan/dvb-c/nl-Ziggo-Zwolle26
-rw-r--r--util/scan/dvb-c/se-comhem22
-rw-r--r--util/scan/dvb-s/Agila2_C-146.0E60
-rw-r--r--util/scan/dvb-s/Amos-4w114
-rw-r--r--util/scan/dvb-s/Apstar6_C-134.0E15
-rw-r--r--util/scan/dvb-s/AsiaSat2_C-100.5E51
-rw-r--r--util/scan/dvb-s/AsiaSat3S_C-105.5E152
-rw-r--r--util/scan/dvb-s/Asiasat4_C-122.2E27
-rw-r--r--util/scan/dvb-s/Astra-23.5E66
-rw-r--r--util/scan/dvb-s/Atlantic-Bird-1-12.5W46
-rw-r--r--util/scan/dvb-s/Atlantic-Bird-3-5.0W4
-rw-r--r--util/scan/dvb-s/Chinastar1_C-87.5E15
-rw-r--r--util/scan/dvb-s/Insat2E_C-83.0E93
-rw-r--r--util/scan/dvb-s/Insat3A_C-93.5E66
-rw-r--r--util/scan/dvb-s/Insat4A_C-83.0E93
-rw-r--r--util/scan/dvb-s/Insat4B_C-93.5E51
-rw-r--r--util/scan/dvb-s/Intelsat-1002-1.0W17
-rw-r--r--util/scan/dvb-s/Intelsat8_C-166.0E39
-rw-r--r--util/scan/dvb-s/JCSat3A_C-128.0E18
-rw-r--r--util/scan/dvb-s/Measat3_C-91.5E54
-rw-r--r--util/scan/dvb-s/Nilesat101+102-7.0W73
-rw-r--r--util/scan/dvb-s/PalapaC2_C-113.0E39
-rw-r--r--util/scan/dvb-s/ST1_C-80.0E27
-rw-r--r--util/scan/dvb-s/Sirius-5.0E57
-rw-r--r--util/scan/dvb-s/Telecom2-8.0W17
-rw-r--r--util/scan/dvb-s/Telkom1_C-108.0E48
-rw-r--r--util/scan/dvb-s/Telstar-12-15.0W32
-rw-r--r--util/scan/dvb-s/Telstar10_C-76.5E63
-rw-r--r--util/scan/dvb-s/Telstar12-15.0W26
-rw-r--r--util/scan/dvb-s/Telstar18_C-138.0E18
-rw-r--r--util/scan/dvb-s/Thaicom1A_C-120.0E24
-rw-r--r--util/scan/dvb-s/Thaicom2_C-78.5E33
-rw-r--r--util/scan/dvb-s/Thaicom5_C-78.5E69
-rw-r--r--util/scan/dvb-s/Thor-1.0W32
-rw-r--r--util/scan/dvb-s/Vinasat1_C-132.0E12
-rw-r--r--util/scan/dvb-t/au-AdelaideFoothills12
-rw-r--r--util/scan/dvb-t/au-Bendigo41
-rw-r--r--util/scan/dvb-t/au-Devonport19
-rw-r--r--util/scan/dvb-t/au-FraserCoast-Bundaberg12
-rw-r--r--util/scan/dvb-t/au-Goulburn-Rocky_Hill19
-rw-r--r--util/scan/dvb-t/au-Hervey_Bay-Ghost_Hill16
-rw-r--r--util/scan/dvb-t/au-Perth2
-rw-r--r--util/scan/dvb-t/au-SunshineCoast2
-rw-r--r--util/scan/dvb-t/au-Sutherland20
-rw-r--r--util/scan/dvb-t/be-Brussels6
-rw-r--r--util/scan/dvb-t/cz-All41
-rw-r--r--util/scan/dvb-t/cz-Brno10
-rw-r--r--util/scan/dvb-t/cz-Domazlice3
-rw-r--r--util/scan/dvb-t/cz-Klet4
-rw-r--r--util/scan/dvb-t/cz-Ostrava3
-rw-r--r--util/scan/dvb-t/cz-Plzen8
-rw-r--r--util/scan/dvb-t/cz-Praha7
-rw-r--r--util/scan/dvb-t/de-Baden-Wuerttemberg15
-rw-r--r--util/scan/dvb-t/de-Bayern28
-rw-r--r--util/scan/dvb-t/de-Berlin7
-rw-r--r--util/scan/dvb-t/de-Brandenburg4
-rw-r--r--util/scan/dvb-t/de-Bremen4
-rw-r--r--util/scan/dvb-t/de-Hamburg10
-rw-r--r--util/scan/dvb-t/de-Hessen12
-rw-r--r--util/scan/dvb-t/de-Mecklenburg-Vorpommern10
-rw-r--r--util/scan/dvb-t/de-Niedersachsen23
-rw-r--r--util/scan/dvb-t/de-Nordrhein-Westfalen10
-rw-r--r--util/scan/dvb-t/de-Rheinland-Pfalz4
-rw-r--r--util/scan/dvb-t/de-Saarland4
-rw-r--r--util/scan/dvb-t/de-Sachsen5
-rw-r--r--util/scan/dvb-t/de-Sachsen-Anhalt7
-rw-r--r--util/scan/dvb-t/de-Schleswig-Holstein14
-rw-r--r--util/scan/dvb-t/de-Thueringen4
-rw-r--r--util/scan/dvb-t/es-Albacete16
-rw-r--r--util/scan/dvb-t/es-Alfabia1
-rw-r--r--util/scan/dvb-t/es-BaixoMinho16
-rw-r--r--util/scan/dvb-t/es-Collserola16
-rw-r--r--util/scan/dvb-t/es-Granada8
-rw-r--r--util/scan/dvb-t/es-Huesca8
-rw-r--r--util/scan/dvb-t/es-Muros-Noia9
-rw-r--r--util/scan/dvb-t/es-Pamplona9
-rw-r--r--util/scan/dvb-t/es-Santiago_de_Compostela9
-rw-r--r--util/scan/dvb-t/es-Vitoria-Gasteiz8
-rw-r--r--util/scan/dvb-t/fi-Smedsbole13
-rw-r--r--util/scan/dvb-t/fr-Laval12
-rw-r--r--util/scan/dvb-t/fr-Rochefort-sur-mer14
-rw-r--r--util/scan/dvb-t/hr-All24
-rw-r--r--util/scan/dvb-t/hr-Zagreb3
-rw-r--r--util/scan/dvb-t/hu-Budapest8
-rw-r--r--util/scan/dvb-t/hu-Debrecen8
-rw-r--r--util/scan/dvb-t/hu-Gyor8
-rw-r--r--util/scan/dvb-t/hu-Kabhegy8
-rw-r--r--util/scan/dvb-t/hu-Kekes8
-rw-r--r--util/scan/dvb-t/hu-Kiskoros8
-rw-r--r--util/scan/dvb-t/hu-Nagykanizsa-Ujudvar8
-rw-r--r--util/scan/dvb-t/hu-Pecs8
-rw-r--r--util/scan/dvb-t/hu-Szeged8
-rw-r--r--util/scan/dvb-t/hu-Szentes8
-rw-r--r--util/scan/dvb-t/hu-Tokaj8
-rw-r--r--util/scan/dvb-t/hu-Uzd8
-rw-r--r--util/scan/dvb-t/hu-Vasvar-Hegyhatsal8
-rw-r--r--util/scan/dvb-t/it-Montevergine18
-rw-r--r--util/scan/dvb-t/lt-All39
-rw-r--r--util/scan/dvb-t/ro-Bucharest5
-rw-r--r--util/scan/dvb-t/se-Ornskoldsvik_As1
-rw-r--r--util/scan/dvb-t/se-Skelleftea1
-rw-r--r--util/scan/dvb-t/sk-BanskaBystrica3
-rw-r--r--util/scan/dvb-t/sk-Bardejov5
-rw-r--r--util/scan/dvb-t/sk-Bratislava3
-rw-r--r--util/scan/dvb-t/sk-Kosice3
-rw-r--r--util/scan/dvb-t/sk-Michalovce5
-rw-r--r--util/scan/dvb-t/sk-Namestovo5
-rw-r--r--util/scan/dvb-t/sk-Poprad5
-rw-r--r--util/scan/dvb-t/sk-RimavskaSobota5
-rw-r--r--util/scan/dvb-t/sk-Trencin5
-rw-r--r--util/scan/dvb-t/sk-VelkyKrtis5
-rw-r--r--util/scan/dvb-t/sk-Zilina5
-rw-r--r--util/scan/dvb-t/uk-Redruth13
-rw-r--r--util/scan/dvb-t/uk-StocklandHill15
-rw-r--r--util/scan/dvb-t/uk-Storeton15
-rw-r--r--util/scan/dvb-t/uk-WinterHill18
-rw-r--r--util/scan/dvb-t/vn-Hanoi5
-rw-r--r--util/scan/dvb-t/vn-Thaibinh5
-rw-r--r--util/scan/scan.c11
-rw-r--r--util/szap/Makefile2
-rw-r--r--util/szap/azap.c27
-rw-r--r--util/szap/czap.c91
-rw-r--r--util/szap/szap.c97
-rw-r--r--util/szap/tzap.c73
-rw-r--r--util/szap/util.c126
-rw-r--r--util/szap/util.h24
210 files changed, 35932 insertions, 637 deletions
diff --git a/.hg_archival.txt b/.hg_archival.txt
index 64b0306..51d57ab 100644
--- a/.hg_archival.txt
+++ b/.hg_archival.txt
@@ -1,2 +1,2 @@
repo: d9fe7e17226f8e321aa80a015fc8d53f33b265d7
-node: 2d700fe04e4386a32e37f3a1291cacafd375aa60
+node: 7de0663facd92bbb9049aeeda3dcba9601228f30
diff --git a/Make.rules b/Make.rules
index e867c3a..3410d7b 100644
--- a/Make.rules
+++ b/Make.rules
@@ -35,7 +35,7 @@ libdir ?= $(prefix)/lib
sharedir ?= $(prefix)/share
ifneq ($(DESTDIR),)
-DESTDIR = $(DESTDIR)/
+DESTDIR := $(DESTDIR)/
endif
ifeq ($(V),1)
diff --git a/README b/README
index ad29647..0870a66 100644
--- a/README
+++ b/README
@@ -15,6 +15,8 @@ util/dvbnet - Control digital data network interfaces.
util/dvbtraffic - Monitor traffic on a digital device.
util/femon - Monitor the tuning on a digital TV device.
util/zap - *Just* tunes a digital device - really intended for developers.
+util/gotox - Simple Rotor control utility
+util/alevt - Teletext capture and display utility
Hardware Specific Utilities:
util/av7110_loadkeys - Load remote keys into an av7110 based card
@@ -36,5 +38,10 @@ For convenience, dvb-apps contains a copy of the DVB API include
files as they are contained in the linuxtv-dvb-1.? release
and the 2.6.x Linux kernel.
+AleVT is not compiled by the main Makefile, because it depends on external
+libraries which might not be available in your system (see util/alevt/README for
+details). If you have the required libraries, to compile AleVT go to util/alevt/
+and type "make".
+
Johannes Stezenbach <js@convergence.de>
Andrew de Quincey <adq_dvb@lidskialf.net>
diff --git a/lib/libdvbsec/dvbsec_api.c b/lib/libdvbsec/dvbsec_api.c
index 5f2ae22..62d225e 100644
--- a/lib/libdvbsec/dvbsec_api.c
+++ b/lib/libdvbsec/dvbsec_api.c
@@ -537,19 +537,12 @@ int dvbsec_diseqc_goto_rotator_bearing(struct dvbfe_handle *fe,
}
// generate the command
- if (integer < -256) {
- return -EINVAL;
- } else if (integer < 0) {
- integer = -integer;
- data[3] = 0xf0;
- } else if (integer < 256) {
- data[3] = 0x00;
- } else if (integer < 512) {
- integer -= 256;
- data[3] = 0x10;
- } else {
- return -EINVAL;
+ if (integer < 0.0) {
+ data[3] = 0xD0; // West is a negative angle value
+ } else if (integer >= 0.0) {
+ data[3] = 0xE0; // East is a positive angle value
}
+ integer = abs(integer);
data[3] |= ((integer / 16) & 0x0f);
integer = integer % 16;
data[4] |= ((integer & 0x0f) << 4) | fraction;
diff --git a/util/Makefile b/util/Makefile
index c7a83db..db9e63d 100644
--- a/util/Makefile
+++ b/util/Makefile
@@ -3,6 +3,7 @@
.PHONY: all clean install
all clean install:
+ $(MAKE) -C atsc_epg $@
$(MAKE) -C av7110_loadkeys $@
$(MAKE) -C dib3000-watch $@
$(MAKE) -C dst-utils $@
@@ -15,4 +16,5 @@ all clean install:
$(MAKE) -C szap $@
$(MAKE) -C ttusb_dec_reset $@
$(MAKE) -C gnutv $@
+ $(MAKE) -C gotox $@
$(MAKE) -C zap $@
diff --git a/util/alevt/COPYRIGHT b/util/alevt/COPYRIGHT
new file mode 100644
index 0000000..17930ea
--- /dev/null
+++ b/util/alevt/COPYRIGHT
@@ -0,0 +1,297 @@
+This message applies to all files within the archive:
+
+ Copyright (C) 1998,1999,2000 Edgar Toernig (froese@gmx.de)
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License Version 2 as
+ published by the Free Software Foundation.
+
+ 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.
+
+
+And here's the GNU GPL V2:
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
diff --git a/util/alevt/ChangeLog b/util/alevt/ChangeLog
new file mode 100644
index 0000000..896ddc3
--- /dev/null
+++ b/util/alevt/ChangeLog
@@ -0,0 +1,535 @@
+Thu Feb 11 22:05:00 MET 2010 (1.7.0)
+
+ - redesigned version:
+ - outfile, new starting methods, libzvbi implementation
+ - lots of bug fixes, all patches available in the Internet applied
+ - extensive code cleanup
+
+Mon Dec 3 03:11:07 MET 2007 (1.6.2)
+
+ - compilation fixes for newer gcc
+ - makefile tweaks (man vs share/man, /usr/X11R6 vs /usr, etc)
+ - default device changed to /dev/vbi0
+ - adapt to current v4l2 api
+ - some minor fixes collected during the past years
+
+ This is a build-time update to conform to newer compilers and
+ system environments. If you have a running AleVT there's no
+ reason to update. The only real fix is in the html-exporter
+ which was producing broken html (missing double-quotes).
+
+Thu Jan 23 01:53:10 MET 2003
+
+ - Fixed a bug in contrib/cap-all.c (fdset_init before vbi_open)
+ - Expaned cap-all.c to show how to save in two formats simultaneously.
+
+Tue Aug 20 05:22:16 MEST 2002 (1.6.1)
+
+ - Removed the bttv-warning from the help pages ;-)
+
+Mon Jul 23 18:34:32 MEST 2001
+
+ - Fixed bug in ui.c - found by <pawel@sakowski.eu.org>.
+ - When clicking on page numbers accept sub-page numbers too.
+
+Sat Dec 23 15:12:11 MET 2000
+
+ - Fixed 'double height last line' bug in export.c reported by
+ <Matthias.Kleinmann@urz.uni-heidelberg.de>
+
+Thu Oct 12 02:19:31 MEST 2000
+
+ - The &nbsp; fix was wrong. Removed it.
+
+Wed Oct 11 19:41:38 MEST 2000 (1.6.0)
+
+ - Some documentation tweaks.
+ - Release. Made it 1.6 because of V4l2 API.
+
+Thu Sep 21 21:07:12 MEST 2000
+
+ - Removed old bttv-only decoder. Only the v4l2-based stays.
+ If the device does not support v4l2, default parameters
+ appropriate for the bttv-driver are taken.
+ - Subpage cycling (up/down and 2nd wheel) stays in the current
+ page.
+
+Sat Sep 16 23:52:12 MEST 2000
+
+ - Experimental v4l2 interface added.
+ - Finetune defaults to 1 now. Works best for me. Tell me
+ if you don't like it.
+ - Russian patch still not added :-/
+ - Fixed the bug in xio.c that Ben Smithurst
+ <ben@scientia.demon.co.uk> found.
+ - Added the dual-wheel-mouse patch from Holger Fitzner.
+
+Tue May 30 03:09:24 MEST 2000
+
+ - As Matto Fransen <matto@matto.nl> reported: the ; after &nbsp
+ in exp-html is missing. fixed that.
+
+Tue May 9 20:21:52 MEST 2000
+
+ - Removed the -oldbttv/-newbttv options. If your driver has
+ a buffer size different from that in the current bttv you
+ either have to support the VBISIZE ioctl or change the source.
+ (Tried to implement an autodetect by non-blocking reads but
+ that confuses the driver that much that it no longers gives
+ reasonable data.)
+ - Added a compression option to the png export filter and
+ changed the default compression level to the lib's default.
+ The prev default of 9 was way to slow.
+
+Wed May 3 19:18:55 MEST 2000
+
+ - Added a smaller font. Made out of the neep9 font from
+ the really great jmk-fonts (http://www.pobox.com/~jmknoble).
+
+Sat Apr 29 02:36:41 MEST 2000
+
+ - Fixed SEGV in export.c:adjust.
+ - Fixed a possible buffer overrun in exp-txt.c
+
+Thu Nov 4 21:18:52 MET 1999 (1.5.1)
+
+ - Added os.h. That way alevt compiles right out of the
+ box on all BSD systems (I hope *g*).
+ - Fixed the DST bug in alevt-date.
+ - Put vtwiz.pl in contrib, a perl/tk/set-tv script to
+ launch alevt written by Joern Borgert.
+
+Tue Oct 26 23:55:09 MEST 1999 (1.5.1-pre1)
+
+ - Added timeout option to alevt-cap.
+ - Use install instead of cp in the Makefile.
+ - Added -I/usr/local/include and -L/usr/local/lib
+ in the Makefile.
+ - Changed #ifdef FREEBSD to #ifdef BSD.
+ - exchanged contrib/paul-export.patch with
+ paul.fmt_page.c (a replacement for export.c:fmt_page())
+ and paul.fmt_page.patch (the same in form of a
+ patch file).
+ - Some doc corrections.
+
+Thu Oct 14 02:49:48 MEST 1999
+
+ - Added FREEBSD patches.
+
+Fri Oct 8 23:36:45 MEST 1999 (1.5.0)
+
+ - Updated the documentation.
+
+ So, what's new since 1.4.9 (nearly 4 months ago)?
+ Two major things: full latin-2 support and export
+ filters for alevt-cap and alevt itself.
+
+ For the latin-2 support page enhancement packets
+ have to be decoded and some latin-1 pages may
+ benefit from that, too. Note: if you select
+ latin-2 everything is latin-2, even cut'n paste.
+ (new cmdline option -charset latin-1|2)
+
+ The export filters allow saving pages in different
+ formats. At the moment there's ascii (with and with-
+ out color), html, png, and ppm. The png filter
+ requires libpng. If you don't have it (or don't want
+ png support) just remove the WITH_PNG from the
+ Makefile. To save the currently displayed page just
+ press 's'. See alevt-cap(1) for the format string.
+
+ Preview: 1.5.1 will have the FreeBSD patches and
+ any bug fixes. (But not more *g*).
+
+Fri Oct 8 02:06:35 MEST 1999 (1.5.0-pre4)
+
+ Finally I could get away from my Playstation and
+ work a little bit on alevt *g*
+
+ - Tried to change alevt-date with freebsd patches from
+ Thomas Runge <runge@rostock.zgdv.de>. They do not
+ have the timezone and daylight variables. But I do
+ not have tm_gmtoff. So it's commented out for the
+ moment.
+ - Made font.[ch] so that only one copy of the fonts is
+ in the executable when including export modules
+ (exp-gfx.c uses them). Had to tweak the makefile.
+ - Added 's' for saving pages to files. Prompts for
+ a format string and a filename and saves the
+ currently displayed page.
+ (Formerly, 's' and 'S' were aliases for '/' and '?'
+ (searching))
+ - Found a bug in export.c regarding double height lines.
+ - Added a patch to the contrib dir to pass the URL you
+ click on to netscape.
+
+ The documentation updates are still missing. That's
+ the last thing to do for 1.5.0. But that's so boring...
+
+Fri Aug 20 21:28:18 MEST 1999
+
+ Back from holidays and time for alevt...
+
+ - Added html, png, and ppm export modules from Paul.
+ - Fixed the return status for export_output.
+ - Tweaked the makefile for libpng support.
+ - Added the export howto to the contrib dir.
+ - Added Paul's fmt_page routine to contrib as a patch
+ to export.c
+ - Added "-format help" to list all output formats and
+ its options.
+
+ Still to do: update man page of alevt-cap, add export
+ to alevt, add erc to alevt-cap.
+
+ Oh, btw, alevt is running on FreeBSD with the bt848
+ driver from Roger Hardiman <roger@cs.strath.ac.uk> *g*.
+ I wonder if it's possible to port his driver to linux.
+ Maybe it runs better then bttv... (I still get reports
+ with stuck xawtvs ...)
+
+Mon Jul 19 01:15:50 MEST 1999 (1.5.0-pre3)
+
+ - Added export modules. It's gotten much to complex.
+
+ A lot of things still to do: add other formats [Paul?],
+ add documentation, add format-help, add export to alevt,
+ add erc to alevt-cap, ...
+
+Mon Jul 12 00:09:03 MEST 1999
+
+ - Added an incomplete 20x24 font to the contrib dir.
+
+Tue Jun 29 00:46:03 MEST 1999 (1.5.0-pre2)
+
+ - Added lanugage tables from Radoslaw.
+ - Added new latin-2 font from Radoslaw.
+ - Fixed a bug with hold graphics. There's still one bug
+ on CNN's page 100 (has to do with set-after behaviour of
+ color select in hold graphics mode). The last line of the
+ earth should be blue-blue-green not blue-green-green.
+ AleVT always uses set-at behaviour. Afaik, this combination
+ (hold + set-after) is the only way to see the difference
+ between set-at and set-after. Set-after will blow up the
+ code so I will leave it as it is.
+ - vbi now collects all pkt26 and enhances the page before
+ it is passed on. Seem's to work.
+
+Tue Jun 22 22:13:45 MEST 1999 (1.5.0-pre1)
+
+ - Fixed hamm24. And, it should be fast now *g*
+ - Moved the language conversion parts to lang.c
+ - Added additional lang_chars for use with the latin-2 charset.
+ - Added -charset latin-1/2 option.
+ - Added pkt x/26 decoding. ... and noticed, that these packets
+ are sent between line 0 and 1. FUCK. Now I have to save
+ all x/26 until the page is complete. But not today... :-(
+
+ Things are getting more and more uglier. The right thing
+ to do would be to make a big font with all possible chars
+ (including cyrillic, arabic, smoothed graphics, ...).
+ That would mean to make each char in vtp->data 16 bit.
+ And then add an attribute word for each char so that the
+ enhanced attributes work, too. Searching and cut & paste
+ would be more complicated... but the worst, the pages
+ will be much bigger (4 times larger). Really bad for
+ the cache and god knows for what else...
+ Is it worth all the trouble??? I don't need that!
+
+Tue Jun 15 01:25:40 MEST 1999
+
+ - Changed .specs file again. I previously changed alevt.spec
+ instead of alevt.spec.in :-(
+
+Mon Jun 14 23:45:48 MEST 1999 (1.4.9)
+
+ - Made a very simple capture program (alevt-cap). Just collects
+ the given pages and writes them to disk in ASCII.
+ I will only accept bug reports/fixes, no enhancement requests
+ at the moment *g*
+ (I can't believe it; I even wrote a man page...)
+ - Changed the subpage delimiter on the command line from '/' to '.'
+ The old one ('/') is still accepted. (Reason: alevt-cap uses
+ the page number as part of the filename and a / is inconvenient.
+ And I already wanted to let you enter subpages with the keypad
+ and the '.' would be a nice key for that.)
+ - Tweaked the .specs file... (Btw, alevt-date and alevt-cap should
+ not be installed in the X11 tree.)
+
+Thu Jun 10 22:13:40 MEST 1999
+
+ - moved the hamming decoding and associated table to hamm.c
+ - played with pkt26 to support polish stations. not finished.
+
+Tue Jun 8 21:00:42 MEST 1999
+
+ - Added -[no]bell option. And the 'b' key.
+ - Replaced all xio_bell calls with appropriate status messages.
+
+Sat Jun 5 00:42:19 MEST 1999 (1.4.8)
+
+ - Shit. Just after the release I found a bug. The header line
+ isn't updated as it should :-( (Just affects parallel mode
+ transmission, so no new version, yet.)
+ - Created mailing list. Either go to http://alevt.listbot.com/
+ or write mail to alevt-subscribe@listbot.com.
+ - Added bttv-patch to the contrib dir for those who don't want
+ to wait for bttv-0.6.5.
+
+Fri Jun 4 17:19:41 MEST 1999 (1.4.7)
+
+ - Added autodetection of VBIBUF_SIZE (only with newer bttv, 0.6.5).
+ - Forgot to close vbi_fd in vbi_close :-/
+ - Made ERC on by default. If the page has no errors it
+ costs nothing and if it has you'll turn it on anyway.
+ - Changed parameters of EV_HEADER.
+ - Removed XAWTV_HACKS.
+ - Updated some docu.
+ - Modified the contrib samples to reflect previous API changes.
+
+Fri May 28 20:16:44 MEST 1999
+
+ - Added status messages.
+ - Added EV_TIMER event.
+ - Added channel change detection (only with newer bttv, 0.6.5).
+ Sends EV_RESET event. The XAWTV_HACKS can be removed *phww*.
+ Now the cache is automatically cleared if you switch to a
+ new channel. It even works with a SAT receiver connected to
+ Video-In.
+
+Thu May 27 23:54:32 MEST 1999 (1.4.6 unofficial)
+
+ - Cache reset didn't reset npages and hi_subno.
+ - Added XAWTV_HACKS, that is: alevt scans for a window with
+ the _XAWTV_STATION property and registers for property changes.
+ Result: when switching channels in xawtv, the cache is cleared.
+ (This is just an ugly hack. Xawtv must already be running
+ when alevt is started. If you quit and restart xawtv, it no
+ longer works. There's no method to detect if the monitored
+ xawtv is really the one controlling our /dev/vbi, etc...)
+ Added on request of Paul Ortyl <ortylp@key.net.pl>.
+ - Added error reduction circuit. It's part of the cache.
+ Errors in a new page are replaced by characters/lines from
+ an already cached (older) page. May be toggled by pressing
+ 'e' (editor is now on 'E'). It's not enabled by default
+ because it takes some CPU time. Idea by Paul Ortyl.
+ - TODO: clean up. document new features. add status messages.
+
+Sun May 23 19:13:07 MEST 1999 (1.4.5)
+
+ - New spec file from Karsten Hopp <karsten.hopp@delix.de>
+ - Changed it even further *g*
+ - Fixed a bug with graphics selection of double height lines.
+ - Documented the -oldbttv option in the man page. Now it's in
+ every page. This should finally halve the mails I get.
+ (For the other halve I have to write alevt-capture *g*)
+
+Sat May 8 02:41:21 MEST 1999
+
+ - Ehhh, changed u32 typedef from unsigned long to unsigned int.
+ Same for s32. The Alpha's longs are 64 bits.
+ Thanks to Sdruddin Rejeb <rejeb@dpmail.epfl.ch>.
+ (There's something strange with this in the X libs. They are
+ sometimes very lazy about ints and longs. Someone with an
+ Alpha should check the cut & paste, both, text and graphics
+ selections.)
+
+Thu Apr 29 22:38:37 MEST 1999
+
+ - Updated contrib/t1.c
+ - Added ':' as a subpage delimiter for clicking (2:7 is the same as 2/7)
+
+Mon Apr 19 19:40:09 MEST 1999
+
+ - Switched the scrolling direction of the wheel
+
+Mon Mar 29 01:23:06 MEST 1999 (1.4.4)
+
+ - fixed DST bug in alevt-date
+ - added crude latin-2 support. 'make FONT=latin-2' should be enough.
+ (found the stuff on the website http://www.penguin.cz/~marvin/ of
+ Daniel Smolik <smolikdan@email.cz>. I don't know if he is the one
+ who made the font).
+
+Wed Mar 17 20:53:59 MET 1999
+
+ - added timeout to alevt-date
+
+Fri Feb 19 18:22:53 MET 1999 (1.4.3>
+
+ - Makefile changes.
+
+Fri Jan 29 18:01:27 MET 1999
+
+ - fixed bug in dllist.h. dl_insert_first(h, dl_remove(n)) was only
+ working due to gcc implementation details.
+
+Mon Jan 25 18:33:42 MET 1999 (1.4.2)
+
+ - fixed 'clear cache'. no longer removes the help pages.
+ - made next/prev key/button to skip missing pages.
+ - added support for wheeled mice. (I heard it's really cool *g*)
+ - problem with subpages > 0xff fixed.
+
+Thu Jan 21 17:31:46 MET 1999 (1.4.1)
+
+ - added man pages from Thomas Schoepf <schoepf@usa.net>.
+ - added rpm-spec file from Mario Mikocevic <mozgy@times.hr>.
+ (looks a little bit odd, but I don't know very much about rpms)
+ - minor option fix in alevt-date (people are really using it!?!)
+
+Tue Jan 5 03:50:08 MET 1999 (1.4.0)
+
+ - should be 1.3.10 but that gives problems with the help pages :-(
+ - fixed varargs for alpha
+ - default is now -newbttv (aka -fuckbttv). use -oldbttv for v<0.5.20.
+
+Sat Jan 2 21:40:54 MET 1999
+
+ - small patches to alevt-date (-vbi options and tzset fix)
+ - played with pkt8/30. what a mess. MTV is 25:13 ahead *g*
+
+Wed Dec 30 19:30:14 MET 1998 (1.3.9)
+
+ - slightly modified the pll (may need further tuning)
+
+Wed Dec 30 05:27:26 MET 1998 (1.3.8)
+
+ - added pll (-finetune auto). try -debug for status msgs.
+
+Tue Dec 29 05:15:53 MET 1998 (1.3.7)
+
+ - added finetune option (see README)
+ - you may now type -newbttv instead of -fuckbttv *g*
+
+Mon Dec 28 19:36:32 MET 1998 (1.3.6)
+
+ - Makefile: R5 -> R6 :-(
+ - vbi.c now works without cache.c
+ - added alevt-date (set system time from teletext)
+ - bug in option parsing (error reporting)
+
+Thu Dec 17 19:56:16 MET 1998 (1.3.5)
+
+ - added -L/usr/X11R6/lib in Makefile
+ - put some blurb (in german) in contrib.
+
+Thu Dec 17 05:01:34 MET 1998 (1.3.4)
+
+ - added class hints on (invisible) leader window to make docking
+ in wmaker easier. instant name for leader is "VTLeader" and for
+ the viewing windows "VTPage"
+ - made the icon a little bit smaller
+
+Mon Dec 14 23:05:41 MET 1998 (1.3.3)
+
+ Release 1.3.3
+
+ - added spanish/portuguese charset decoding
+ - added similar looking glyphs for czech
+ - minor changes on the font
+ - middle click on current page number opens new parent window
+ - case dependant search if the pattern begins with a '!'
+ - line editing may be aborted with ^C
+
+Sun Dec 13 17:55:32 MET 1998 (1.3.2)
+
+ - when there were multiple windows of the same page, cycling through
+ the subpages changed all windows. fixed.
+ - hilight the found text (make it the selection).
+ - slightly modified the hilight colors.
+ - default window size set to 41x25 (looks better).
+ - rewrote the editor.
+
+Sun Dec 13 07:03:10 MET 1998 (1.3.1)
+
+ - fixed one command line option
+ - corrected bug in searching
+
+Sat Dec 12 20:27:03 MET 1998 (1.3.0)
+
+ Release 1.3.0
+
+ - searching is now ready (still need a status line for error msgs).
+ - set SIGPIPE to SIG_DFL. some shells (KDE) set it to SIG_IGN and then
+ the timer task won't be killed on exit.
+ - updated the help pages.
+ - I'm frustrated! BTTV_VERSION doesn't work on /dev/vbi. So no
+ autodetection of driver version. Added -fuckbttv option instead.
+
+Fri Dec 11 19:36:03 MET 1998 (1.2.5)
+
+ - reworked national charset (lang) handling. everthing now done in vbi.c.
+ the rest just deals with latin-1.
+ - first version of searching (functional, but dirty. needs more work.)
+
+Thu Dec 10 20:06:27 MET 1998 (1.2.4)
+
+ - new file edline.c (line editor for the menu line. start for searching...)
+ - blinking cursor
+ - added an 48x48 icon from Ulf Rompe
+ - added pasting into the line editor (insert key).
+ - release ownership of XA_PRIMARY when deselecting selection.
+
+Tue Dec 8 21:26:26 MET 1998 (1.2.3)
+
+ - new file ui.c (most user interface stuff from main.c)
+ - rewrote option parsing
+ - allow specification of child windows on command line. now
+ it's possible to regenerate the complete window layout by
+ the commandline (may be of some use for session management).
+ - some spelling fixes in the help pages from Mark Bryars
+
+Mon Dec 7 16:59:28 MET 1998 (1.2.2)
+
+ - reworked hidden handling in xio.c
+
+Sun Dec 6 19:54:10 MET 1998 (1.2.1)
+
+ - class name changed! from Alevt to AleVT.
+ - window/icon title shows current page number
+ - changed the icon to a 64 pixel width one. not nice but ...
+ - added a small mini icon for the title bar. is there a property I can set?
+ - pressing on the CPN puts the page on hold
+ - pressing on the violet * reveals concealed text
+ - added simple menu if no FastText menu is present
+ - allow subpages to be specified on the command line (eg 100/4)
+
+Sat Dec 5 20:59:51 MET 1998 (1.2.0)
+
+ Release 1.2.0
+
+ - finished the help pages.
+ - added command line handling
+ - added user geometry handling in xio.c
+
+Sat Dec 5 02:28:16 MET 1998 (1.1.2)
+
+ - allow magazin 9 (help system)
+ - start box char after a pagenumber selects subpage 1 (hack)
+ - added a crude page editor (just to create the help pages. not for users.)
+ - started with the online help system (sounds great, hehe)
+
+Tue Dec 1 20:19:53 MET 1998 (1.1.1)
+
+ - added concept of parent and child windows. now, the middle mouse
+ button changes the contens of the child window. if there isn't
+ one, it is created.
+ - Middle mouse button on x/y (subpage cycling) selects the previous
+ subpage. (updating the child with subpages is hairy...)
+
+Sun Nov 29 23:34:18 MET 1998 (1.1.0)
+
+ Release 1.1.0
+
+ - removed most of the recovery for single bad lines (does too much harm)
+ - changed handling of parallel mode transmission (untested. unused in .de)
+ - added selection (text & graphic!). try pasting into xpaint :-)
+ - added cache-clear function ('c')
+ - click on x/y selects the next subpage
+ - some minor tweaks
+ - added an icon bitmap.
+
+Wed Nov 24 23:33:34 MET 1998 (1.0.0)
+
+ First Release 1.0.0
diff --git a/util/alevt/EXPORT.HOWTO b/util/alevt/EXPORT.HOWTO
new file mode 100644
index 0000000..b9fba67
--- /dev/null
+++ b/util/alevt/EXPORT.HOWTO
@@ -0,0 +1,84 @@
+HOW TO IMPLEMENT A NEW EXPORT MODULE:
+
+As an example look at exp-txt.c (it implements two modules which
+are pretty similar).
+
+You have to create one exported structure (struct export_module).
+This structure holds the following data:
+
+1. The name of the format (example: "ascii").
+
+2. The default extension to use for building filenames ("txt").
+
+3. A list of module options. It's a 0 terminated array of char
+pointers, one for each option (similar to argv of main).
+If an option string contains a '=', it is an option that
+requires an argument. The part after the '=' is ignored at
+the moment. Later, I want to add help messages that show
+these options strings and then the part after the '=' becomes
+useful.
+If you do not have local options, set this field to 0.
+
+4. The number of bytes for local data in the export structure.
+There you may store data collected during option parsing or
+for whatever you want.
+Don't use global variables for storing this data! With
+alevt-cap you may give:
+
+alevt-cap -format ascii,color 100 -format ascii 100
+
+to save the page in two different formats. Using global
+vars would inhibit this. The data area in struct export
+starts at the 'data' field. You have to cast it to the
+appropriate type (see the D macro in exp-txt.c).
+If you do not need local data, set this field to 0.
+
+5. An open function (or call it constructor). It is called
+when your module is needed and it is passed a struct export
+(the instance). This function may be used to initialize
+the local data in the export struct.
+If all goes well return 0. Else call export_error (see
+below) and return -1.
+If you do not need an open function, set this field to 0.
+
+6. A close function (or call it destructor). It is called
+when your module is no longer needed. If you allocated
+memory in the open func, this is the place to free it.
+If you do not need a close function, set it to 0.
+
+7. An option function. It is called for each module option
+the user has given. It is passed an option number (first
+option in the option-array gives 1, ...) and a char pointer
+to the argument for that option (0 if the option does not
+need an arg). The argument pointer keeps valid until the
+close function is called.
+If all goes well, return 0. Else call export_error and
+return -1.
+If you gave an option list at point 3 you have to specify
+this function. Else set it to 0.
+
+8. An output function. It is called to produce the output.
+It is given the file name to use and a fmt_page pointer.
+The fmt_page contains an interpreted image of the page.
+There are no control chars in it. It uses the character
+set defined by the two fonts.
+These function may be called consecutive for multiple
+pages. Don't expect one output for one open/close.
+Return codes as above... (0: ok, -1: error).
+
+The export_error function: If one of your functions wants to
+report an error, it has to use the export_error function.
+It's a printf like function to set error messages. In alevt-cap
+these messages are printed to stderr, in alevt they will be
+shown in the status line (so don't make them too long).
+
+The last step is to add your export_module structure to the
+list of modules in export.c (at the top).
+Please, make sure that this structure is the only exported
+symbol. All other things should be static.
+
+That's all. A structure describing your module and 4 functions
+(open, close, option, output) to implement it. Shouldn't be too
+complicated.
+
+Ciao, ET.
diff --git a/util/alevt/Makefile b/util/alevt/Makefile
new file mode 100644
index 0000000..2f7c8da
--- /dev/null
+++ b/util/alevt/Makefile
@@ -0,0 +1,130 @@
+VER=1.7.0
+OPT=-O -g -w
+DEFS=-DWITH_PNG
+DEFS+=-DUSE_LIBZVBI
+FONT=vtxt
+MAN_DIR=man
+DESTDIR=
+PREFIX=/usr
+HOSTCC=$(CC)
+CFLAGS=$(OPT) -DVERSION=\"$(VER)\" $(DEFS) -I$(USR_X11R6)/include
+EXPOBJS=export.o exp-txt.o exp-html.o exp-gfx.o font.o
+OBJS=main.o ui.o xio.o fdset.o vbi.o cache.o help.o search.o misc.o hamm.o lang.o $(EXPOBJS)
+TOBJS=alevt-date.o vbi.o fdset.o misc.o hamm.o lang.o
+COBJS=alevt-cap.o vbi.o fdset.o misc.o hamm.o lang.o $(EXPOBJS)
+
+ifneq ($(findstring WITH_PNG,$(DEFS)),)
+EXPLIBS=-lpng -lz -lm
+endif
+
+ifneq ($(findstring USE_LIBZVBI,$(DEFS)),)
+ZVBILIB=-lzvbi -lpthread
+EXPLIBS+=$(ZVBILIB)
+endif
+
+all: alevt alevt-date alevt-cap alevt.1 alevt-date.1 alevt-cap.1
+
+alevt: $(OBJS)
+ $(CC) $(OPT) $(OBJS) -o alevt -L$(PREFIX)/lib -L$(PREFIX)/lib64 -lX11 $(EXPLIBS)
+
+alevt-date: $(TOBJS)
+ $(CC) $(OPT) $(TOBJS) -o alevt-date $(ZVBILIB)
+
+alevt-cap: $(COBJS)
+ $(CC) $(OPT) $(COBJS) -o alevt-cap $(EXPLIBS)
+
+font.o: font1.xbm font2.xbm font3.xbm font4.xbm
+fontsize.h: font1.xbm font2.xbm font3.xbm font4.xbm
+ fgrep -h "#define" font1.xbm font2.xbm font3.xbm font4.xbm >fontsize.h
+
+font1.xbm: bdf2xbm $(FONT)-latin-1.bdf
+ ./bdf2xbm font1 <$(FONT)-latin-1.bdf >font1.xbm
+
+font2.xbm: bdf2xbm $(FONT)-latin-2.bdf
+ ./bdf2xbm font2 <$(FONT)-latin-2.bdf >font2.xbm
+
+font3.xbm: bdf2xbm vtxt-koi8.bdf
+ ./bdf2xbm font3 <vtxt-koi8.bdf >font3.xbm
+
+font4.xbm: bdf2xbm vtxt-iso8859-7.bdf
+ ./bdf2xbm font4 <vtxt-iso8859-7.bdf >font4.xbm
+
+bdf2xbm: bdf2xbm.c
+ $(HOSTCC) bdf2xbm.c -o bdf2xbm
+
+clean:
+ rm -f *.o page*.txt a.out core bdf2xbm font?.xbm fontsize.h
+ rm -f alevt alevt-date alevt-cap
+
+rpm-install: all
+ install -m 0755 alevt ${RPM_BUILD_ROOT}$(USR_X11R6)/bin
+ install -m 0755 alevt-date ${RPM_BUILD_ROOT}$(USR_X11R6)/bin
+ install -m 0755 alevt-cap ${RPM_BUILD_ROOT}$(USR_X11R6)/bin
+ install -m 0644 alevt.1 ${RPM_BUILD_ROOT}$(USR_X11R6)/$(MAN)/man1
+ install -m 0644 alevt-date.1 ${RPM_BUILD_ROOT}$(USR_X11R6)/$(MAN)/man1
+ install -m 0644 alevt-cap.1 ${RPM_BUILD_ROOT}$(USR_X11R6)/$(MAN)/man1
+ install -d 0755 $(RPM_BUILD_ROOT)$(USR_X11R6)/include/X11/pixmaps
+ install -m 0644 alevt.png $(RPM_BUILD_ROOT)$(USR_X11R6)/include/X11/pixmaps
+
+install: all
+ install -m 0755 alevt $(DESTDIR)$(PREFIX)/bin
+ install -m 0755 alevt-date $(DESTDIR)$(PREFIX)/bin
+ install -m 0755 alevt-cap $(DESTDIR)$(PREFIX)/bin
+ install -m 0644 alevt.1 $(DESTDIR)$(PREFIX)/share/man/man1
+ install -m 0644 alevt-date.1 $(DESTDIR)$(PREFIX)/share/man/man1
+ install -m 0644 alevt-cap.1 $(DESTDIR)$(PREFIX)/share/man/man1
+ install -m 0644 alevt.png $(DESTDIR)$(PREFIX)/share/pixmaps
+ install -m 0644 alevt.desktop $(DESTDIR)$(PREFIX)/share/applications
+
+uninstall: clean
+ rm -f /usr/bin/alevt /usr/bin/alevt-cap /usr/bin/alevt-date \
+ /usr/share/pixmaps/alevt.png /usr/share/applications/alevt.desktop \
+ /usr/share/man/man1/alevt.1 /usr/share/man/man1/alevt-cap.1 \
+ /usr/share/man/man1/alevt-date.1
+
+depend:
+ makedepend -Y -- $(CFLAGS_none) -- *.c 2>/dev/null
+
+tar-html: alevt.1 alevt-date.1 alevt-cap.1
+ for i in alevt.1 alevt-date.1 alevt-cap.1 ; do \
+ j=`basename $$i .1` ; \
+ j=`basename $$j .1x` ; \
+ nroff -man $$i | { \
+ echo "<HTML><HEAD><TITLE>AleVT</TITLE></HEAD><BODY>" ; \
+ man2html -bare -uelem U -nodepage ; \
+ echo "</B0DY></HTML>" ; \
+ } | sed -e "s,</B> <B>, ,g" -e "s,</U> <U>, ,g" >~/exit/alevt/$$j.html ;\
+ done
+
+tar: tar-html clean
+ sed s/VERSION/$(VER)/g <alevt.lsm.in >~/exit/alevt/alevt-$(VER).lsm
+ sed s/VERSION/$(VER)/g <alevt.spec.in >alevt.spec
+ cd .. ;\
+ ln -s alevt alevt-$(VER) ;\
+ tar vcfz ~/exit/alevt/alevt-$(VER).tar.gz alevt-$(VER)/* ;\
+ rm alevt-$(VER)
+ cat <CHANGELOG >~/exit/alevt/changes
+
+# DO NOT DELETE
+
+alevt-cap.o: vt.h misc.h fdset.h dllist.h vbi.h cache.h lang.h export.h
+alevt-date.o: os.h vt.h misc.h fdset.h dllist.h vbi.h cache.h lang.h
+cache.o: misc.h dllist.h cache.h vt.h help.h
+exp-gfx.o: lang.h misc.h vt.h export.h font.h fontsize.h
+exp-html.o: lang.h misc.h vt.h export.h
+exp-txt.o: os.h export.h vt.h misc.h
+export.o: vt.h misc.h export.h
+fdset.o: dllist.h misc.h fdset.h
+font.o: font1.xbm font2.xbm font3.xbm font4.xbm
+hamm.o: vt.h misc.h hamm.h
+help.o: vt.h misc.h vt900.out vt901.out vt902.out vt903.out vt904.out vt905.out
+help.o: vt906.out vt907.out vt908.out vt909.out vt910.out vt911.out vt912.out
+lang.o: misc.h vt.h lang.h
+main.o: vt.h misc.h fdset.h dllist.h xio.h vbi.h cache.h lang.h ui.h
+main.o: search.h
+misc.o: misc.h
+search.o: vt.h misc.h cache.h dllist.h search.h
+ui.o: vt.h misc.h xio.h dllist.h vbi.h cache.h lang.h fdset.h
+ui.o: search.h export.h ui.h
+vbi.o: os.h vt.h misc.h vbi.h dllist.h cache.h lang.h fdset.h hamm.h
+xio.o: vt.h misc.h dllist.h xio.h fdset.h lang.h icon.xbm font.h fontsize.h
diff --git a/util/alevt/README b/util/alevt/README
new file mode 100644
index 0000000..83985f0
--- /dev/null
+++ b/util/alevt/README
@@ -0,0 +1,72 @@
+Hi,
+
+this software is not just a program, it's moreover a legend.
+It is THE protagonist of all videotext applications under Linux.
+
+During the past 10 years the video standards, the APIs, the kernel
+have seen lots of changes.
+But unfortunately this program has NOT seen much maintenance.
+The results of that misfit appearance are:
+
+1. lots of forks flying around in the Internet
+2. lots of patches flying around, some good, some disgusting, some out of time
+3. lots of cruft which is completely outdated or obsolete for other reasons
+
+To handle all that in one big effort I decided to redesign the program
+completely, enlarging its capabilities for DVB-S at the same time.
+
+So here are the changes:
+
+1. Erasure of old help pages and rename / reorganize / update the rest
+-> redesign of the online help system / implying alevt-date and alevt-cap
+
+2. Erasure of old outdated integers, functions, parameters:
+
+- bell, big_buf, debug, display, editor, erc, fine_tune, newbttv,
+- oldbttv
+
+3. Coding style cleanups (no superfluous comments, not more than
+ 80 characters per column, no uncommented code.
+
+4. No strange characters in the outfile, latin alphabet in purity instead.
+
+5. Alevt can be started in 4 modes now if you are running it in DVB mode:
+
+- by service id (sid)
+- by teletext pid (ttpid)
+- by channel name
+- without parameter
+
+6. Starting it in DVB mode on the command line it presents you
+a table with human readable values such as sid, teletext pid,
+PMT (Program Map Table), provider name, service name, language, service type.
+This makes it easier for you to start multiple teletext windows
+in multiple console sessions manually.
+
+If working with a script and the option -o (outfile) you can
+also start multiple teletext windows of all channels in a transponder.
+I develop a GUI using TCL / TK 8.5 and Iwidgets 4.01 to do that and other
+tasks graphically (i. e. by mouse click).
+
+7. If you install the program on the command line by typing "make &
+ make install" there is an uninstaller now to revert the installation:
+ "make uninstall".
+
+ENJOY IT!
+
+Uwe Bugla, February 11th, 2010.
+
+External dependencies
+
+AleVT needs some system libraries to be installed in your system.
+They are zlib, libX11, libpng and libzvbi.
+
+Credits go to:
+- Andreas Rottmann from debian.org for compiler fixes and
+ other kinds of investigation.
+- Francesco Lavra for supplying a kernel patch to avoid kernel demux
+ incompatibilities with kernels >= 2.6.32
+- Andy Walls for helpful investigation in kernelspace
+- Edgar Toernig for providing the source version 1.6.2 and doing all the
+ development for the basic versions
+- Tom Zoerner for the implementation of libzvbi
diff --git a/util/alevt/README.OLD b/util/alevt/README.OLD
new file mode 100644
index 0000000..4fb0e41
--- /dev/null
+++ b/util/alevt/README.OLD
@@ -0,0 +1,78 @@
+Hi, Menden, 21 Sep 2000
+
+ This program decodes and displays Videotext/Teletext from a
+ /dev/vbi device.
+
+
+COMPILE & INSTALL:
+
+ There's nothing to configure. A simple 'make' is all.
+ If you do not want png support remove the WITH_PNG in
+ the Makefile. Additionally, if you want a smaller font
+ uncomment the "FONT=neep9" line.
+
+ It gives you 'alevt', 'alevt-date', and 'alevt-cap' and
+ their man pages 'alevt.1x', 'alevt-date.1', and 'alevt-cap.1'.
+
+ You can install them where ever you want (i.e. /usr/local/bin).
+ The programs are self-contained and require no other files.
+
+ NOTE: Be careful with 'make install'. It's just for me :-)
+
+
+PROBLEMS:
+
+ If you have a lot of decoding errors (lot of these lightning symbols)
+ you may try pressing the 'f' and 'F' key. This allows fine tuning of
+ the decoder circuit. There's also a -finetune command line option.
+ This should only be necessary on really bad signals.
+
+ Maybe, I add autotuning later...
+
+ UPDATE: added autotuning. It's the default. If you add -debug the
+ the actions of the pll are printed to stdout.
+
+ To get the old (pre finetune) behaviour start it with -finetune 0.
+
+ UPDATE: disabled autotuning *g* sometimes it's too jumpy...
+
+
+ALEVT-DATE:
+ I added a little tool to set the system time from the videotext
+ time. The date is not interpreted (not even transmitted on some
+ channels). So it allows only adjustment of +/-12 hours.
+ The default allowed adjustment is limited to +/-2 hours (use
+ -delta to change). Without the -set option it just display
+ the date in the format of the date command. Look at strftime(3)
+ for possible control sequences you may use in the -format option.
+
+
+HACKING:
+
+ If you want to play with the font size, you may resize it with
+ xv (xv font1.xbm). Just make sure, that its width is a multiple of
+ 32 and its height a multiple of 8. A simple make will create
+ a version of AleTV with the new font. Warning: a make clean
+ will erase font1.xbm. The next make will recreate font.xbm from
+ vtxt.bdf.
+
+ AleVT has a built in page editor. If you start it with -editor
+ you may press 'E' to invoke it. For the usage you have to consult
+ the sources. (It's very crude!)
+
+
+TODO: (no specific order)
+
+ - Error correction in alevt-cap
+ - Better language support. Internal 16-bit charset.
+ - Separated graphics.
+ - Rewrite the whole stuff. A networked teletext daemon and clients
+ that connect to it for display, capture, cgi, ...
+
+
+NEWER VERSIONS:
+
+ The primary site of AleVT is http://goron.de/~froese
+
+Have fun,
+Edgar Toernig (froese@gmx.de)
diff --git a/util/alevt/ReadmeGR b/util/alevt/ReadmeGR
new file mode 100644
index 0000000..68d32c2
--- /dev/null
+++ b/util/alevt/ReadmeGR
@@ -0,0 +1,28 @@
+29-9-2003
+
+ÅëëçíéêÜ ãéá ôï ALEVT
+Ç ðñïóèÞêç Åëëçíéêþí Ýãéíå ôñïðïðïéþíôáò ôï patch alevt-1.6.3.rus.diff ðïõ âñßóêåôå óôï öÜêåëï
+contrib óôá sources ôïõ alevt-1.6.3
+
+ÎåêéíÞóôå ôï ðñüãñáììá ìå ôçí ðáñÜìåôñï
+
+alevt -charset iso8859-7
+
+ç
+
+alevt -charset el
+
+ÄïõëåéÝò ðïõ Ý÷ïõí íá ãßíïõí:
+Êáëýôåñïò ó÷åäéáóìüò ôïõ font file vtxt-iso8859-7.bdf
+ïé Áããëéêïß ÷áñáêôÞñåò ìïéÜæïõí óáí bold óå ó÷Ýóç ìå ôïõò Åëëçíéêïýò êáé õðÜñ÷ïõí
+êÜðïéá ìéêñÜ ðñïâëçìáôÜêéá ìå ôïõò graphics (0x01 -0x1f)
+
+¸ëåã÷ïò ãéá ôï áí áðåéêïíßæïíôáé óùóôÜ üëïé ïé ÷áñáêôÞñåò
+
+¼ðïéïò èÝëåé íá âïçèÞóåé ðáñáêáëþ íá ìïõ óôåßëåé ôçò áëëáãÝò ôïõ óôï sl45sms@yahoo.gr
+Áí êÜðïéïò êÜíåé åêôåôáìÝíåò áëëáãÝò ðïõ äåí áöïñïýí ôá ÅëëçíéêÜ èá ðñÝðåé íá ôéò óôåßëåé êáé
+óôïí óõããñáöÝá ôïõ ðñïãñÜììáôïò
+
+ÍåüôåñÜ áñ÷åßá ôïõ ðáñüíôïò èá ìðïñåßôå íá âñßóêåôå óôï http://go.to/sl45sms/alevt/index.html
+
+ÓêáñâÝëçò Ðáíáãéþôçò
diff --git a/util/alevt/TODO b/util/alevt/TODO
new file mode 100644
index 0000000..4b56676
--- /dev/null
+++ b/util/alevt/TODO
@@ -0,0 +1,12 @@
+Hi, these are issues that I unfortunately cannot resolve myself:
+
+1. graphical menu written in GKT2, to be used in general connection with
+ the outfile (-o) option.
+
+2. for usage without script and outfile option:
+ DVB monitoring demon helping the program to rewrite the PAT when the
+ external player software has chosen a channel which is part of a
+ new transponder.
+ At the moment alevt hangs when the transponder is changed.
+
+Uwe Bugla, February 11th, 2010.
diff --git a/util/alevt/alevt-cap.1 b/util/alevt/alevt-cap.1
new file mode 100644
index 0000000..2af1879
--- /dev/null
+++ b/util/alevt/alevt-cap.1
@@ -0,0 +1,53 @@
+.TH alevt-cap 1 "February 07, 2010"
+.SH NAME
+alevt-cap \- capture teletext windows.
+.SH SYNOPSIS
+.B alevt-cap
+.RI [ options ]
+.br
+.SH DESCRIPTION
+This manual page documents briefly the
+.B alevt-cap
+commands.
+.PP
+\fBalevt-cap\fP is a program to capture teletext pages.
+.SH OPTIONS
+.TP
+.B \-cs -charset <latin-1/2/koi8-r/iso-8859-7>
+character set
+.TP
+.B \-f -format <fmt[,options]>
+format to save
+.TP
+.B \-f help -format help
+lists available storage formats
+.TP
+.B \-h -help
+print this page
+.TP
+.B \-n -name <filename>
+page name to save
+.B \-t -timeout <secs>
+timeout
+.TP
+.B \-s -sid <sid>
+service pid
+.TP
+.B \-t -ttpid <ttpid>
+teletext pid
+.TP
+.B \-v -vbi <vbidev>
+vbi device
+.TP
+Sequence: /dev/vbi; /dev/vbi0; /dev/video0; /dev/dvb/adapter0/demux0
+.TP
+ppp.ss stands for a page number and an optional
+subpage number (example: 123.4).
+.TP
+.SH SEE ALSO
+.BR alevt-date (1) , alevt (1).
+.br
+.SH AUTHOR
+alevt-cap was written by Edgar Toernig <froese@gmx.de>.
+.PP
+This manual page was written by Uwe Bugla <uwe.bugla@gmx.de>.
diff --git a/util/alevt/alevt-cap.c b/util/alevt/alevt-cap.c
new file mode 100644
index 0000000..9e0c3bd
--- /dev/null
+++ b/util/alevt/alevt-cap.c
@@ -0,0 +1,280 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <locale.h>
+#include <signal.h>
+#include <unistd.h>
+#include "vt.h"
+#include "misc.h"
+#include "fdset.h"
+#include "vbi.h"
+#include "lang.h"
+#include "dllist.h"
+#include "export.h"
+
+static volatile int timed_out = 0;
+static char *channel;
+char *outfile = "";
+u_int16_t sid;
+
+
+struct req
+{
+ struct dl_node node[1];
+ char *name; // file name
+ char *pgno_str; // the pgno as given on the cmdline
+ int pgno, subno; // decoded pgno
+ struct export *export; // export data
+ struct vt_page vtp[1]; // the capture page data
+};
+
+
+static void usage(FILE *fp, int exitval)
+{
+ fprintf(fp, "\nUsage: %s [options] ppp.ss...\n", prgname);
+ fprintf(fp,
+ "\n"
+ " Valid options:\t\tDefault:\n"
+ " -cs -charset\t\tlatin-1\n"
+ " <latin-1/2/koi8-r/iso8859-7>\n"
+ " -f -format <fmt,options>\tascii\n"
+ " -f help -format help\n"
+ " -h -help\n"
+ " -n -name <filename>\t\tttext-%%s.%%e\n"
+ " -s -sid <sid>\t\t(none;dvb only)\n"
+ " -to -timeout <secs>\t\t(none)\n"
+ " -t -ttpid <ttpid>\t\t(none;dvb only)\n"
+ " -v -vbi <vbidev>\t\t/dev/vbi\n"
+ " \t\t/dev/vbi0\n"
+ " \t\t/dev/video0\n"
+ " \t\t/dev/dvb/adapter0/demux0\n"
+ "\n"
+ " ppp.ss stands for a page number and an\n"
+ " optional subpage number (ie 123.4).\n"
+ );
+ exit(exitval);
+}
+
+
+static void exp_help(FILE *fp)
+{
+ struct export_module **ep;
+ char **cp, c;
+
+ fprintf(fp,
+ "\nSyntax: -format Name[,Options]\n"
+ "\n"
+ " Name\tExt.\tOptions\n"
+ " --------------------------------\n"
+ );
+ for (ep = modules; *ep; ep++)
+ {
+ fprintf(fp, " %-7s\t.%-4s", (*ep)->fmt_name, (*ep)->extension);
+ for (c = '\t', cp = (*ep)->options; cp && *cp; cp++, c = ',')
+ fprintf(fp, "%c%s", c, *cp);
+ fprintf(fp, "\n");
+ }
+ fprintf(fp,
+ "\n"
+ "Common options: reveal,hide\n"
+ "Example: -format ansi,reveal,bg=none\n"
+ "\n"
+ );
+ exit(0);
+}
+
+
+static int arg_pgno(char *p, int *subno)
+{
+ char *end;
+ int pgno;
+
+ *subno = ANY_SUB;
+ if (*p)
+ {
+ pgno = strtol(p, &end, 16);
+ if ((*end == ':' || *end == '/' || *end == '.') && end[1])
+ *subno = strtol(end + 1, &end, 16);
+ if (*end == 0)
+ if (pgno >= 0x100 && pgno <= 0x899)
+ if (*subno == ANY_SUB || (*subno >= 0x00 && *subno <= 0x3f7f))
+ return pgno;
+ }
+ fatal("%s: invalid page number", p);
+}
+
+
+static int option(int argc, char **argv, int *ind, char **arg)
+{
+ static struct { char *nam, *altnam; int arg; } opts[] = {
+ { "-charset", "-cs", 1 },
+ { "-format", "-f", 1 },
+ { "-help", "-h", 0 },
+ { "-name", "-n", 1 },
+ { "-sid", "-s", 1 },
+ { "-timeout", "-to", 1 },
+ { "-ttpid", "-t", 1 },
+ { "-vbi", "-v", 1 },
+ };
+ int i;
+
+ if (*ind >= argc)
+ return 0;
+
+ *arg = argv[(*ind)++];
+ for (i = 0; i < NELEM(opts); ++i)
+ if (streq(*arg, opts[i].nam) || streq(*arg, opts[i].altnam))
+ {
+ if (opts[i].arg)
+ if (*ind < argc)
+ *arg = argv[(*ind)++];
+ else
+ fatal("option %s requires an argument", *arg);
+ return i+1;
+ }
+
+ if (**arg == '-')
+ {
+ fatal("%s: invalid option", *arg);
+ usage(stderr, 2);
+ }
+
+ return -1;
+}
+
+
+static void event(struct dl_head *reqs, struct vt_event *ev)
+{
+ struct req *req, *nxt;
+
+ switch (ev->type)
+ {
+ case EV_PAGE: // new page
+ {
+ struct vt_page *vtp = ev->p1;
+
+ for (req = PTR reqs->first; nxt = PTR req->node->next; req = nxt)
+ if (req->pgno == vtp->pgno)
+ if (req->subno == ANY_SUB || req->subno == vtp->subno)
+ {
+ *req->vtp = *vtp;
+ dl_insert_last(reqs + 1, dl_remove(req->node));
+ }
+ }
+ }
+}
+
+
+int main(int argc, char **argv)
+{
+ char *vbi_name = NULL;
+ int timeout = 0;
+ char *fname = "ttext-%s.%e";
+ char *out_fmt = "ascii";
+ struct export *fmt = 0;
+ int opt, ind;
+ char *arg;
+ struct vbi *vbi;
+ struct req *req;
+ struct dl_head reqs[2]; // simple linear lists of requests & captures
+ int ttpid = -1;
+
+ setlocale (LC_CTYPE, "");
+ setprgname(argv[0]);
+
+ fdset_init(fds);
+ dl_init(reqs); // the requests
+ dl_init(reqs+1); // the captured pages
+
+ ind = 1;
+ while (opt = option(argc, argv, &ind, &arg))
+ switch (opt)
+ {
+ case 1: // charset
+ if (streq(arg, "latin-1") || streq(arg, "1"))
+ latin1 = 1;
+ else if (streq(arg, "latin-2") || streq(arg, "2"))
+ latin1 = 0;
+ else if (streq(arg, "koi8-r") || streq(arg, "koi"))
+ latin1 = KOI8;
+ else if (streq(arg, "iso8859-7") || streq(arg, "el"))
+ latin1 = GREEK;
+ else
+ fatal("bad charset (not latin-1/2/koi8-r/iso8859-7)");
+ break;
+ case 2: // format
+ if (streq(arg, "help") || streq(arg, "?") || streq(arg, "list"))
+ exp_help(stdout);
+ out_fmt = arg;
+ fmt = 0;
+ break;
+ case 3: // help
+ usage(stdout, 0);
+ break;
+ case 4: // name
+ fname = arg;
+ break;
+ case 5: // timeout
+ timeout = strtol(arg, 0, 10);
+ if (timeout < 1 || timeout > 999999)
+ fatal("bad timeout value", timeout);
+ break;
+ case 6: // service id
+ sid = strtoul(arg, NULL, 0);
+ break;
+ case 7: // teletext pid
+ ttpid = strtoul(arg, NULL, 0);
+ break;
+ case 8: // vbi
+ vbi_name = arg;
+ break;
+ case -1: // non-option arg
+ if (not fmt)
+ fmt = export_open(out_fmt);
+ if (not fmt)
+ fatal("%s", export_errstr());
+ if (not(req = malloc(sizeof(*req))))
+ out_of_mem(sizeof(*req));
+ req->name = fname;
+ req->pgno_str = arg;
+ req->pgno = arg_pgno(arg, &req->subno);
+ req->export = fmt;
+ dl_insert_last(reqs, req->node);
+ break;
+ }
+
+ if (dl_empty(reqs))
+ fatal("no pages requested");
+
+ // setup device
+ if (not(vbi = vbi_open(vbi_name, 0, channel, outfile, sid, ttpid)))
+ fatal("cannot open %s", vbi_name);
+ vbi_add_handler(vbi, event, reqs); // register event handler
+
+ if (timeout)
+ alarm(timeout);
+
+ // capture pages (moves requests from reqs[0] to reqs[1])
+ while (not dl_empty(reqs) && not timed_out)
+ if (fdset_select(fds, 30000) == 0) // 30sec select time out
+ {
+ error("no signal.");
+ break;
+ }
+
+ alarm(0);
+ vbi_del_handler(vbi, event, reqs);
+ vbi_close(vbi);
+ if (not dl_empty(reqs))
+ error("capture aborted. Some pages are missing.");
+
+ for (req = PTR reqs[1].first; req->node->next; req = PTR req->node->next)
+ {
+ fname = export_mkname(req->export, req->name, req->vtp, req->pgno_str);
+ if (not fname || export(req->export, req->vtp, fname))
+ error("error saving page %s: %s", req->pgno_str, export_errstr());
+ if (fname)
+ free(fname);
+ }
+ exit(dl_empty(reqs) ? 0 : 1);
+}
diff --git a/util/alevt/alevt-date.1 b/util/alevt/alevt-date.1
new file mode 100644
index 0000000..69d2f6f
--- /dev/null
+++ b/util/alevt/alevt-date.1
@@ -0,0 +1,41 @@
+.TH alevt-date 1 "February 07, 2010"
+.SH NAME
+alevt-date \- print out UTC date.
+.SH SYNOPSIS
+.B alevt-date
+.RI [ options ]
+.br
+.SH DESCRIPTION
+This manual page documents briefly the
+.B alevt-date
+commands.
+.PP
+\fBalevt-date\fP is a program to print the UTC date.
+.SH OPTIONS
+.TP
+.B \-d -delta <max_secs>
+maximum delta
+.TP
+.B \-f -format <fmtstr>
+time format
+.TP
+.B \-h -help
+print this page
+.TP
+.B \-s -set
+set the system clock
+.TP
+.B \-t -timeout <seconds>
+timeout
+.TP
+.B \-v -vbi <vbidev>
+vbi device /dev/vbi; /dev/vbi0; /dev/video0; /dev/dvb/adapter0/demux0
+.TP
+.br
+.SH SEE ALSO
+.BR alevt-cap (1) , alevt (1).
+.br
+.SH AUTHOR
+alevt-date was written by Edgar Toernig <froese@gmx.de>.
+.PP
+This manual page was written by Uwe Bugla <uwe.bugla@gmx.de>.
diff --git a/util/alevt/alevt-date.c b/util/alevt/alevt-date.c
new file mode 100644
index 0000000..5496937
--- /dev/null
+++ b/util/alevt/alevt-date.c
@@ -0,0 +1,225 @@
+#include <stdio.h>
+#include <string.h>
+#include <sys/time.h>
+#include <time.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+#include "os.h"
+#include "vt.h"
+#include "fdset.h"
+#include "vbi.h"
+#include "lang.h"
+#include "misc.h"
+
+char *fmt = "%a %b %d %H:%M:%S %Z %Y";
+int max_diff = 2*60*60; // default: 2 hours
+int set_time = 0;
+char *outfile = "";
+static char *channel;
+u_int16_t sid;
+
+
+static void chk_time(int t)
+{
+ struct tm *tm;
+ time_t sys_t;
+ int dt;
+ char buf[256];
+
+ if (t < 0 || t > 235959 || t%100 > 59 || t/100%100 > 59)
+ return;
+
+ sys_t = time(0);
+ tm = localtime(&sys_t);
+
+ // Now convert to UTC seconds
+ t = t/100/100 * 60*60 + t/100%100 * 60 + t%100;
+#ifdef BSD
+ t -= tm->tm_gmtoff; // dst already included...
+#else
+ t += timezone;
+ if (tm->tm_isdst)
+ t -= 60*60;
+#endif
+
+ dt = t - sys_t % (24*60*60);
+ if (dt <= -12*60*60)
+ dt += 24*60*60;
+
+ if (dt <= -max_diff || dt >= max_diff)
+ fatal("time diff too big (%2d:%02d:%02d)", dt/60/60, abs(dt)/60%60, abs(dt)%60);
+
+ sys_t += dt;
+
+ if (set_time)
+ {
+ struct timeval tv[1];
+
+ tv->tv_sec = sys_t;
+ tv->tv_usec = 500000;
+ if (settimeofday(tv, 0) == -1)
+ ioerror("settimeofday");
+ }
+ if (*fmt)
+ {
+ tm = localtime(&sys_t);
+ if (strftime(buf, sizeof(buf), fmt, tm))
+ puts(buf);
+ }
+ exit(0);
+}
+
+
+static void event(void *_, struct vt_event *ev)
+{
+ switch (ev->type)
+ {
+ /* vbi may generate EV_PAGE, EV_HEADER, EV_XPACKET */
+ /* for event arguments see vt.h */
+
+ case EV_HEADER: // a new title line (for running headers)
+ {
+ static int last_t = -1;
+ u8 *s = ev->p1;
+ int i, t = 1;
+
+ if (ev->i2 & PG_OUTOFSEQ)
+ break;
+
+ for (i = 32; i < 40; ++i)
+ if (s[i] >= '0' && s[i] <= '9')
+ t = t * 10+ s[i] - '0';
+ if (t >= 1000000 && t <= 1235959)
+ if (t == last_t || t - last_t == 1)
+ chk_time(t - 1000000);
+ last_t = t;
+ break;
+ }
+ }
+}
+
+
+static void usage(FILE *fp, int exit_val)
+{
+ fprintf(fp, "usage: %s [options]\n", prgname);
+ fprintf(fp,
+ "\n"
+ " Valid options:\t\tDefault:\n"
+ " -d -delta <max_secs>\t7200 (2 hours)\n"
+ " -f -format <fmtstr>\t\t%%c\n"
+ " -h -help\n"
+ " -s -set\t\t\toff\n"
+ " -to -timeout <seconds>\t(none)\n"
+ " -v -vbi <vbidev>\t\t/dev/vbi\n"
+ " \t\t/dev/vbi0\n"
+ " \t\t/dev/video0\n"
+ " \t\t/dev/dvb/adapter0/demux0\n"
+ );
+ exit(exit_val);
+}
+
+
+static int option(int argc, char **argv, int *ind, char **arg)
+{
+ static struct { char *nam, *altnam; int arg; } opts[] = {
+ { "-delta", "-d", 1 },
+ { "-format", "-f", 1 },
+ { "-help", "-h", 0 },
+ { "-set", "-s", 0 },
+ { "-timeout", "-to", 1 },
+ { "-vbi", "-v", 1 },
+ };
+ int i;
+
+ if (*ind >= argc)
+ return 0;
+
+ *arg = argv[(*ind)++];
+ for (i = 0; i < NELEM(opts); ++i)
+ if (streq(*arg, opts[i].nam) || streq(*arg, opts[i].altnam))
+ {
+ if (opts[i].arg)
+ if (*ind < argc)
+ *arg = argv[(*ind)++];
+ else
+ fatal("option %s requires an argument", *arg);
+ return i+1;
+ }
+
+ if (**arg == '-')
+ {
+ fatal("%s: invalid option", *arg);
+ usage(stderr, 1);
+ }
+
+ return -1;
+}
+
+
+int main(int argc, char **argv)
+{
+ char *vbi_name = NULL;
+ int timeout = 0;
+ struct vbi *vbi;
+ int opt, ind;
+ char *arg;
+ int ttpid = -1;
+
+ setprgname(argv[0]);
+ ind = 1;
+ while (opt = option(argc, argv, &ind, &arg))
+ switch (opt)
+ {
+ case 1: // -delta
+ max_diff = atoi(arg);
+ if (max_diff < 1)
+ fatal("-delta: illegal value '%s'", arg);
+ if (max_diff > 12*60*60)
+ {
+ max_diff = 12*60*60;
+ error("-delta: %d too big. Assuming %d", arg, max_diff);
+ }
+ break;
+ case 2: // -format
+ fmt = arg;
+ break;
+ case 3: // help
+ usage(stdout, 0);
+ break;
+ case 4: // -set
+ set_time = 1;
+ break;
+ case 5: // -timeout
+ timeout = atoi(arg);
+ if (timeout < 1 || timeout > 60*60)
+ fatal("-timeout: illegal value '%s'", arg);
+ break;
+ case 6: // -vbi
+ vbi_name = arg;
+ break;
+ case -1:
+ usage(stderr, 1);
+ break;
+ }
+
+ fdset_init(fds);
+
+ if (timeout)
+ {
+ signal(SIGALRM, SIG_DFL); // kill me
+ alarm(timeout);
+ }
+ vbi = vbi_open(vbi_name, 0, channel, outfile, sid, ttpid); // open device
+ if (not vbi)
+ fatal_ioerror(vbi_name);
+ vbi_add_handler(vbi, event, 0); // register event handler
+
+ for (;;)
+ fdset_select(fds, -1); // call scheduler
+
+ /* never reached */
+ vbi_del_handler(vbi, event, 0);
+ vbi_close(vbi);
+ exit(0);
+}
diff --git a/util/alevt/alevt.1 b/util/alevt/alevt.1
new file mode 100644
index 0000000..68bff45
--- /dev/null
+++ b/util/alevt/alevt.1
@@ -0,0 +1,60 @@
+.TH alevt 1 "February 07, 2010"
+.SH NAME
+alevt \- a teletext browser for analogue and DVB channels.
+.SH SYNOPSIS
+.B alevt
+.RI [ options ]
+.br
+.SH DESCRIPTION
+This manual page documents briefly the
+.B alevt
+commands.
+.PP
+\fBalevt\fP is a program to read teletext from analogue or DVB channels.
+.SH OPTIONS
+.TP
+.B \-c <channel>
+channel name (dvb only)
+.TP
+.B \-ch -child <ppp.ss>
+child window
+.TP
+.B \-cs -charset <latin-1/2/koi8-r/iso8859-7>
+character set
+.TP
+.B \-h -help
+print this page
+.TP
+.B \-o <outfile>
+path + file for all services (dvb only)
+.TP
+.B \-p -parent <ppp.ss>
+parent window
+.TP
+.B \-s -sid <sid>
+service id (dvb only)
+.TP
+.B \-t -ttpid <ttpid>
+teletext pid (dvb only)
+.TP
+.B \-v -vbi <vbidev>
+vbi device
+.TP
+Sequence: /dev/vbi; /dev/vbi0; /dev/video0; /dev/dvb/adapter0/demux0
+.TP
+Order is important! Each page number opens a new window
+with the previously given geometry, device, and display.
+.TP
+ppp.ss stands for a page number and an optional
+subpage number (example: 123.4).
+.TP
+The -child option requires a parent window. So it must
+be preceded by a parent or another child window.
+.TP
+.SH SEE ALSO
+.BR alevt-cap (1), alevt-date (1).
+.br
+.SH AUTHOR
+alevt was written by Edgar Toernig <froese@gmx.de>.
+.PP
+This manual page was written by Uwe Bugla <uwe.bugla@gmx.de>.
diff --git a/util/alevt/alevt.desktop b/util/alevt/alevt.desktop
new file mode 100644
index 0000000..c125bb9
--- /dev/null
+++ b/util/alevt/alevt.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=alevt
+Comment=Teletext Browser
+Exec=alevt
+Icon=alevt
+Terminal=false
+Type=Application
+Categories=GNOME;GTK;AudioVideo;Video;
diff --git a/util/alevt/bdf2xbm.c b/util/alevt/bdf2xbm.c
new file mode 100644
index 0000000..74d238e
--- /dev/null
+++ b/util/alevt/bdf2xbm.c
@@ -0,0 +1,212 @@
+/*
+ Simple program to convert a bdf-font to a bitmap.
+ The characters are arranged in a 32x8 matrix.
+ usage: bdf2xbm [identifier] <bdf >xbm
+ Copyright 1998,1999 by E. Toernig (froese@gmx.de)
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <stdarg.h>
+
+#define not !
+#define streq(a,b) (strcmp((a),(b)) == 0)
+
+int lineno;
+char *word[64];
+int nword;
+
+char *font = "font%dx%d";
+int w, h, bpl;
+unsigned char *bmap;
+
+
+static void error(char *fmt, ...)
+{
+ va_list args;
+
+ va_start(args, fmt);
+ fprintf(stderr, "bdf2xbm");
+ if (lineno)
+ fprintf(stderr, ":%d", lineno);
+ fprintf(stderr, ": ");
+ vfprintf(stderr, fmt, args);
+ fputc('\n', stderr);
+ exit(1);
+}
+
+
+static int nextline()
+{
+ static char buf[256];
+ char *p;
+ int i;
+
+ do
+ {
+ nword = 0;
+ if (fgets(buf, sizeof(buf), stdin) == 0)
+ return nword;
+ lineno++;
+
+ p = buf;
+ for (;;)
+ {
+ while (isspace(*p))
+ p++;
+ if (*p == 0)
+ break;
+ word[nword++] = p;
+ while (*p && not isspace(*p))
+ *p = toupper(*p), p++;
+ if (*p == 0)
+ break;
+ *p++ = 0;
+ }
+ } while (nword == 0);
+
+ for (i = nword; i < 64; ++i)
+ word[i] = "";
+ return nword;
+}
+
+
+static inline void setbit(int ch, int x, int y)
+{
+
+ int yo = ch / 32 * h + y;
+ int xo = ch % 32 * w + x;
+
+ bmap[yo * bpl + xo / 8] |= 1 << (xo % 8);
+}
+
+
+static void dobitmap(int ch, int x, int y)
+{
+ int i, j;
+
+ for (i = 0; i < y; ++i)
+ {
+ nextline();
+ if (nword > 1 || strlen(word[0]) != (x + 7) / 8 * 2)
+ error("bad BITMAP");
+ for (j = 0; j < x; ++j)
+ {
+ int c = word[0][j / 4];
+ if (c >= '0' && c <= '9')
+ c -= '0';
+ else if (c >= 'A' && c <= 'F')
+ c -= 'A' - 10;
+ else
+ error("bad hexchar in BITMAP");
+ if (c & (8 >> (j % 4)))
+ setbit(ch, j, i);
+ }
+ }
+}
+
+
+static void dochar()
+{
+ int ch = -1, x = -1, y = -1;
+
+ while (nextline())
+ {
+ if (streq(word[0], "ENDCHAR"))
+ return;
+ else if (streq(word[0], "ENCODING") && nword == 2)
+ {
+ ch = atoi(word[1]);
+ if (ch < 0 || ch > 255)
+ error("bad character code %d", ch);
+ }
+ else if (streq(word[0], "BBX") && nword == 5)
+ {
+ x = atoi(word[1]), y = atoi(word[2]);
+ if (x < 1 || x > 64 || y < 1 || y > 64)
+ error("bad BBX (%dx%d)", x, y);
+ }
+ else if (streq(word[0], "BITMAP"))
+ {
+ if (x < 0)
+ error("missing BBX");
+ if (ch < 0)
+ error("missing ENDCODING");
+ dobitmap(ch, x, y);
+ }
+ }
+ error("unexpected EOF (missing ENDCHAR)");
+}
+
+
+static void dofile()
+{
+ lineno = 0;
+ w = h = 0;
+ bmap = 0;
+
+ nextline();
+ if (nword != 2 || not streq(word[0], "STARTFONT"))
+ error("not a bdf-file");
+
+ while (nextline())
+ {
+ if (streq(word[0], "ENDFONT"))
+ return;
+ else if (streq(word[0], "FONTBOUNDINGBOX") && nword == 5)
+ {
+ if (bmap)
+ error("multiple FONTBOUNDINGBOXes!?!");
+ w = atoi(word[1]), h = atoi(word[2]);
+ if (w < 1 || w > 64 || h < 1 || h > 64)
+ error("bad bounding box %dx%d\n", w, h);
+ bpl = (w*32+7)/8; // rounding is unnecessary
+ bmap = calloc(1, bpl * h*8);
+ if (bmap == 0)
+ error("out of memory");
+ }
+ else if (streq(word[0], "STARTCHAR"))
+ {
+ if (not bmap)
+ error("no FONTBOUNDINGBOX");
+ dochar();
+ }
+ }
+ error("unexpected EOF (missing ENDFONT)");
+}
+
+
+static void writexbm()
+{
+ char buf[256];
+ int i, j;
+ unsigned char *p = bmap;
+
+ if (not bmap)
+ return;
+
+ sprintf(buf, font, w, h);
+
+ printf("#define %s_width %d\n", buf, 32 * w);
+ printf("#define %s_height %d\n", buf, 8 * h);
+ printf("static unsigned char %s_bits[] = {\n", buf);
+ for (i = 0; i < 16 * h * w / 8; ++i)
+ {
+ for (j = 0; j < 16; ++j)
+ printf("0x%02x,", *p++);
+ printf("\n");
+ }
+ printf("};\n");
+}
+
+
+int main(int argc, char **argv)
+{
+ if (argc > 1)
+ font = argv[1];
+ dofile();
+ writexbm();
+ exit(0);
+}
diff --git a/util/alevt/cache.c b/util/alevt/cache.c
new file mode 100644
index 0000000..c747448
--- /dev/null
+++ b/util/alevt/cache.c
@@ -0,0 +1,229 @@
+#include <stdlib.h>
+#include <string.h>
+#include "misc.h"
+#include "dllist.h"
+#include "cache.h"
+#include "help.h"
+
+
+static inline int hash(int pgno)
+{
+ // very simple...
+ return pgno % HASH_SIZE;
+}
+
+
+static void do_erc(struct vt_page *ovtp, struct vt_page *nvtp)
+{
+ int l, c;
+
+ if (nvtp->errors == 0 && ovtp->lines == nvtp->lines)
+ return;
+
+ for (l = 0; l < H; ++l)
+ {
+ if (~nvtp->lines & (1 << l))
+ memcpy(nvtp->data[l], ovtp->data[l], W);
+ else if (ovtp->lines & (1 << l))
+ for (c = 0; c < W; ++c)
+ if (nvtp->data[l][c] == BAD_CHAR)
+ nvtp->data[l][c] = ovtp->data[l][c];
+ }
+ nvtp->lines |= ovtp->lines;
+}
+
+
+static void cache_close(struct cache *ca)
+{
+ struct cache_page *cp;
+ int i;
+
+ for (i = 0; i < HASH_SIZE; ++i)
+ while (not dl_empty(ca->hash + i))
+ {
+ cp = PTR ca->hash[i].first;
+ dl_remove(cp->node);
+ free(cp);
+ }
+ free(ca);
+}
+
+
+static void cache_reset(struct cache *ca)
+{
+ struct cache_page *cp, *cpn;
+ int i;
+
+ for (i = 0; i < HASH_SIZE; ++i)
+ for (cp = PTR ca->hash[i].first; cpn = PTR cp->node->next; cp = cpn)
+ if (cp->page->pgno / 256 != 9) // don't remove help pages
+ {
+ dl_remove(cp->node);
+ free(cp);
+ ca->npages--;
+ }
+ memset(ca->hi_subno, 0, sizeof(ca->hi_subno[0]) * 0x900);
+}
+
+/* Get a page from the cache.
+ If subno is SUB_ANY, the newest subpage of that page is returned */
+
+
+static struct vt_page * cache_get(struct cache *ca, int pgno, int subno)
+{
+ struct cache_page *cp;
+ int h = hash(pgno);
+
+ for (cp = PTR ca->hash[h].first; cp->node->next; cp = PTR cp->node->next)
+ if (cp->page->pgno == pgno)
+ if (subno == ANY_SUB || cp->page->subno == subno)
+ {
+ // found, move to front (make it 'new')
+ dl_insert_first(ca->hash + h, dl_remove(cp->node));
+ return cp->page;
+ }
+ return 0;
+}
+
+/* Put a page in the cache.
+ If it's already there, it is updated. */
+
+
+static struct vt_page * cache_put(struct cache *ca, struct vt_page *vtp)
+{
+ struct cache_page *cp;
+ int h = hash(vtp->pgno);
+
+ for (cp = PTR ca->hash[h].first; cp->node->next; cp = PTR cp->node->next)
+ if (cp->page->pgno == vtp->pgno && cp->page->subno == vtp->subno)
+ break;
+
+ if (cp->node->next)
+ {
+ // move to front.
+ dl_insert_first(ca->hash + h, dl_remove(cp->node));
+ if (ca->erc)
+ do_erc(cp->page, vtp);
+ }
+ else
+ {
+ cp = malloc(sizeof(*cp));
+ if (cp == 0)
+ return 0;
+ if (vtp->subno >= ca->hi_subno[vtp->pgno])
+ ca->hi_subno[vtp->pgno] = vtp->subno + 1;
+ ca->npages++;
+ dl_insert_first(ca->hash + h, cp->node);
+ }
+
+ *cp->page = *vtp;
+ return cp->page;
+}
+
+/* Same as cache_get but doesn't make the found entry new */
+
+
+static struct vt_page * cache_lookup(struct cache *ca, int pgno, int subno)
+{
+ struct cache_page *cp;
+ int h = hash(pgno);
+
+ for (cp = PTR ca->hash[h].first; cp->node->next; cp = PTR cp->node->next)
+ if (cp->page->pgno == pgno)
+ if (subno == ANY_SUB || cp->page->subno == subno)
+ return cp->page;
+ return 0;
+}
+
+
+static struct vt_page * cache_foreach_pg(struct cache *ca, int pgno, int subno,
+ int dir, int (*func)(), void *data)
+{
+ struct vt_page *vtp, *s_vtp = 0;
+
+ if (ca->npages == 0)
+ return 0;
+
+ if (vtp = cache_lookup(ca, pgno, subno))
+ subno = vtp->subno;
+ else if (subno == ANY_SUB)
+ subno = dir < 0 ? 0 : 0xffff;
+
+ for (;;)
+ {
+ subno += dir;
+ while (subno < 0 || subno >= ca->hi_subno[pgno])
+ {
+ pgno += dir;
+ if (pgno < 0x100)
+ pgno = 0x9ff;
+ if (pgno > 0x9ff)
+ pgno = 0x100;
+ subno = dir < 0 ? ca->hi_subno[pgno] - 1 : 0;
+ }
+ if (vtp = cache_lookup(ca, pgno, subno))
+ {
+ if (s_vtp == vtp)
+ return 0;
+ if (s_vtp == 0)
+ s_vtp = vtp;
+ if (func(data, vtp))
+ return vtp;
+ }
+ }
+}
+
+
+static int cache_mode(struct cache *ca, int mode, int arg)
+{
+ int res = -1;
+
+ switch (mode)
+ {
+ case CACHE_MODE_ERC:
+ res = ca->erc;
+ ca->erc = arg ? 1 : 0;
+ break;
+ }
+ return res;
+}
+
+
+static struct cache_ops cops =
+{
+ cache_close,
+ cache_get,
+ cache_put,
+ cache_reset,
+ cache_foreach_pg,
+ cache_mode,
+};
+
+
+struct cache * cache_open(void)
+{
+ struct cache *ca;
+ struct vt_page *vtp;
+ int i;
+
+ if (not(ca = malloc(sizeof(*ca))))
+ goto fail1;
+
+ for (i = 0; i < HASH_SIZE; ++i)
+ dl_init(ca->hash + i);
+
+ memset(ca->hi_subno, 0, sizeof(ca->hi_subno));
+ ca->erc = 1;
+ ca->npages = 0;
+ ca->op = &cops;
+
+ for (vtp = help_pages; vtp < help_pages + nr_help_pages; vtp++)
+ cache_put(ca, vtp);
+
+ return ca;
+
+fail2:
+ free(ca);
+fail1:
+ return 0;
+}
diff --git a/util/alevt/cache.h b/util/alevt/cache.h
new file mode 100644
index 0000000..934ef9a
--- /dev/null
+++ b/util/alevt/cache.h
@@ -0,0 +1,41 @@
+#ifndef CACHE_H
+#define CACHE_H
+
+#include "vt.h"
+#include "misc.h"
+#include "dllist.h"
+
+#define HASH_SIZE 113
+
+
+struct cache
+{
+ struct dl_head hash[HASH_SIZE];
+ int erc; // error reduction circuit on
+ int npages;
+ u16 hi_subno[0x9ff + 1]; // 0:pg not in cache, 1-3f80:highest subno + 1
+ struct cache_ops *op;
+};
+
+
+struct cache_page
+{
+ struct dl_node node[1];
+ struct vt_page page[1];
+};
+
+
+struct cache_ops
+{
+ void (*close)(struct cache *ca);
+ struct vt_page *(*get)(struct cache *ca, int pgno, int subno);
+ struct vt_page *(*put)(struct cache *ca, struct vt_page *vtp);
+ void (*reset)(struct cache *ca);
+ struct vt_page *(*foreach_pg)(struct cache *ca, int pgno, int subno, int dir,
+ int (*func)(), void *data);
+ int (*mode)(struct cache *ca, int mode, int arg);
+};
+
+struct cache *cache_open(void);
+#define CACHE_MODE_ERC 1
+#endif
diff --git a/util/alevt/dllist.h b/util/alevt/dllist.h
new file mode 100644
index 0000000..f925506
--- /dev/null
+++ b/util/alevt/dllist.h
@@ -0,0 +1,55 @@
+#ifndef DLLIST_H
+#define DLLIST_H
+
+
+struct dl_node
+{
+ struct dl_node *next;
+ struct dl_node *prev;
+};
+
+
+struct dl_head
+{
+ struct dl_node *first;
+ struct dl_node *null;
+ struct dl_node *last;
+};
+
+
+static inline struct dl_head * dl_init(struct dl_head *h)
+{
+ h->first = (struct dl_node *)&h->null;
+ h->null = 0;
+ h->last = (struct dl_node *)&h->first;
+ return h;
+}
+
+
+static inline struct dl_node * dl_remove(struct dl_node *n)
+{
+ n->prev->next = n->next;
+ n->next->prev = n->prev;
+ return n;
+}
+
+
+static inline struct dl_node *
+ dl_insert_after(struct dl_node *p, struct dl_node *n)
+{
+ n->next = p->next;
+ n->prev = p;
+ p->next = n;
+ n->next->prev = n;
+ return n;
+}
+
+#define dl_empty(h) ((h)->first->next == 0)
+#define dl_insert_before(p, n) dl_insert_after((p)->prev, (n))
+#define dl_insert_first(h, n) ({ struct dl_node *_n = (n); \
+ dl_insert_before((h)->first, _n); })
+#define dl_insert_last(h, n) ({ struct dl_node *_n = (n); \
+ dl_insert_after((h)->last, _n); })
+#define dl_remove_first(h) dl_remove((h)->first) // mustn't be empty!
+#define dl_remove_last(h) dl_remove((h)->last) // mustn't be empty!
+#endif
diff --git a/util/alevt/exp-gfx.c b/util/alevt/exp-gfx.c
new file mode 100644
index 0000000..82ab218
--- /dev/null
+++ b/util/alevt/exp-gfx.c
@@ -0,0 +1,258 @@
+/* Copyright 1999 by Paul Ortyl <ortylp@from.pl> */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "lang.h"
+#include "export.h"
+#include "font.h"
+#define WW (W*CW) /* pixel width of window */
+#define WH (H*CH) /* pixel hegiht of window */
+
+
+static inline void draw_char(unsigned char * colour_matrix, int fg, int bg,
+ int c, int dbl, int _x, int _y, int sep)
+{
+ int x,y;
+ unsigned char* src= (latin1==LATIN1 ? font1_bits : font2_bits);
+ int dest_x=_x*CW;
+ int dest_y=_y*CH;
+
+ for(y=0;y<(CH<<dbl); y++)
+ {
+ for(x=0;x<CW; x++)
+ {
+ int bitnr, bit, maskbitnr, maskbit;
+ bitnr=(c/32*CH + (y>>dbl))*CW*32+ c%32*CW +x;
+ bit=(*(src+bitnr/8))&(1<<bitnr%8);
+ if (sep)
+ {
+ maskbitnr=(0xa0/32*CH + (y>>dbl))*CW*32+ 0xa0%32*CW +x;
+ maskbit=(*(src+maskbitnr/8))&(1<<maskbitnr%8);
+ *(colour_matrix+WW*(dest_y+y)+dest_x+x)=
+ (char)((bit && (!maskbit)) ? fg : bg);
+ }
+ else
+ *(colour_matrix+WW*(dest_y+y)+dest_x+x)=
+ (char)(bit ? fg : bg);
+ }
+ }
+ return;
+}
+
+
+static void prepare_colour_matrix(/*struct export *e,*/
+ struct fmt_page *pg,
+ unsigned char *colour_matrix)
+{
+ int x, y;
+ for (y = 0; y < H; ++y)
+ {
+ for (x = 0; x < W; ++x)
+ {
+ if (pg->dbl & (1<<(y-1)))
+ {
+ if (pg->data[y-1][x].attr & EA_HDOUBLE)
+ draw_char(colour_matrix, pg->data[y][x].fg,
+ pg->data[y][x].bg, pg->data[y][x].ch,
+ (0),
+ x, y,
+ ((pg->data[y][x].attr & EA_SEPARATED) ? 1 : 0)
+ );
+ }
+ else
+ {
+ draw_char(colour_matrix, pg->data[y][x].fg,
+ pg->data[y][x].bg, pg->data[y][x].ch,
+ ((pg->data[y][x].attr & EA_DOUBLE) ? 1 : 0),
+ x, y,
+ ((pg->data[y][x].attr & EA_SEPARATED) ? 1 : 0)
+ );
+ }
+ }
+ }
+ return;
+}
+
+
+static int ppm_output(struct export *e, char *name, struct fmt_page *pg);
+
+struct export_module export_ppm = // exported module definition
+{
+ "ppm", // id
+ "ppm", // extension
+ 0, // options
+ 0, // size
+ 0, // open
+ 0, // close
+ 0, // option
+ ppm_output // output
+};
+
+
+static int ppm_output(struct export *e, char *name, struct fmt_page *pg)
+{
+ FILE *fp;
+ long n;
+ static u8 rgb1[][3]={{0,0,0},
+ {1,0,0},
+ {0,1,0},
+ {1,1,0},
+ {0,0,1},
+ {1,0,1},
+ {0,1,1},
+ {1,1,1}};
+ unsigned char *colour_matrix;
+
+ if (!(colour_matrix=malloc(WH*WW)))
+ {
+ export_error("cannot allocate memory");
+ return 0;
+ }
+
+ prepare_colour_matrix(/*e,*/ pg, (unsigned char *)colour_matrix);
+ if (not(fp = fopen(name, "w")))
+ {
+ free(colour_matrix);
+ export_error("cannot create file");
+ return -1;
+ }
+ fprintf(fp,"P6 %d %d 1\n", WW, WH);
+
+ for(n=0;n<WH*WW;n++)
+ {
+ if (!fwrite(rgb1[(int) *(colour_matrix+n)], 3, 1, fp))
+ {
+ export_error("error while writting to file");
+ free(colour_matrix);
+ fclose(fp);
+ return -1;
+ }
+ }
+ free(colour_matrix);
+ fclose(fp);
+ return 0;
+}
+
+
+#ifdef WITH_PNG
+
+#include <png.h>
+static int png_open(struct export *e);
+static int png_option(struct export *e, int opt, char *arg);
+static int png_output(struct export *e, char *name, struct fmt_page *pg);
+static char *png_opts[] = // module options
+{
+ "compression=<0-9>", // set compression level
+ 0
+};
+
+struct png_data // private data in struct export
+{
+ int compression;
+};
+
+struct export_module export_png = // exported module definition
+{
+ "png", // id
+ "png", // extension
+ png_opts, // options
+ sizeof(struct png_data), // size
+ png_open, // open
+ 0, // close
+ png_option, // option
+ png_output // output
+};
+
+#define D ((struct png_data *)e->data)
+
+
+static int png_open(struct export *e)
+{
+ D->compression = Z_DEFAULT_COMPRESSION;
+ return 0;
+}
+
+
+static int png_option(struct export *e, int opt, char *arg)
+{
+ switch (opt)
+ {
+ case 1: // compression=
+ if (*arg >= '0' && *arg <= '9')
+ D->compression = *arg - '0';
+ break;
+ }
+ return 0;
+}
+
+
+static int png_output(struct export *e, char *name, struct fmt_page *pg)
+{
+ FILE *fp;
+ int x;
+ png_structp png_ptr;
+ png_infop info_ptr;
+ png_byte *row_pointers[WH];
+ static u8 rgb8[][3]={{ 0, 0, 0},
+ {255, 0, 0},
+ { 0,255, 0},
+ {255,255, 0},
+ { 0, 0,255},
+ {255, 0,255},
+ { 0,255,255},
+ {255,255,255}};
+ unsigned char *colour_matrix;
+
+ if (!(colour_matrix=malloc(WH*WW)))
+ {
+ export_error("cannot allocate memory");
+ return -1;
+ }
+ prepare_colour_matrix(/*e,*/ pg, (unsigned char *)colour_matrix);
+ if (not(fp = fopen(name, "w")))
+ {
+ free(colour_matrix);
+ export_error("cannot create file");
+ return -1;
+ }
+ png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING,
+ NULL, NULL, NULL);
+ if (!png_ptr)
+ {
+ free(colour_matrix);
+ fclose(fp);
+ export_error("libpng init error");
+ return -1;
+ }
+ info_ptr = png_create_info_struct(png_ptr);
+ if (!info_ptr)
+ {
+ png_destroy_write_struct(&png_ptr,
+ (png_infopp)NULL);
+ free(colour_matrix);
+ fclose(fp);
+ export_error("libpng init error");
+ return -1;
+ }
+ png_init_io(png_ptr, fp);
+ png_set_compression_level(png_ptr, D->compression);
+ png_set_compression_mem_level(png_ptr, 9);
+ png_set_compression_window_bits(png_ptr, 15);
+ png_set_IHDR(png_ptr, info_ptr, WW, WH,
+ 8, PNG_COLOR_TYPE_PALETTE , PNG_INTERLACE_NONE,
+ PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+ png_set_PLTE(png_ptr, info_ptr,(png_color*) rgb8 , 8);
+ png_write_info(png_ptr, info_ptr);
+ for(x=0; x<WH; x++)
+ { row_pointers[x]=colour_matrix+x*WW; }
+ png_write_image(png_ptr, row_pointers);
+ png_write_end(png_ptr, info_ptr);
+ png_destroy_write_struct(&png_ptr, &info_ptr);
+ free(colour_matrix);
+ fclose(fp);
+ return 0;
+}
+
+#endif
+
diff --git a/util/alevt/exp-html.c b/util/alevt/exp-html.c
new file mode 100644
index 0000000..6c9312a
--- /dev/null
+++ b/util/alevt/exp-html.c
@@ -0,0 +1,299 @@
+/* Copyright 1999 by Paul Ortyl <ortylp@from.pl> */
+
+#include <stdio.h>
+#include <string.h>
+#include "lang.h"
+#include "export.h"
+
+static int html_open(struct export *e);
+static int html_option(struct export *e, int opt, char *arg);
+static int html_output(struct export *e, char *name, struct fmt_page *pg);
+static char *html_opts[] = // module options
+{
+ "gfx-chr=<char>", // substitute <char> for gfx-symbols
+ "bare", // no headers
+ 0
+};
+
+struct html_data // private data in struct export
+{
+ u8 gfx_chr;
+ u8 bare;
+};
+
+
+struct export_module export_html = // exported module definition
+{
+ "html", // id
+ "html", // extension
+ html_opts, // options
+ sizeof(struct html_data), // size
+ html_open, // open
+ 0, // close
+ html_option, // option
+ html_output // output
+};
+
+#define D ((struct html_data *)e->data)
+
+
+static int html_open(struct export *e)
+{
+ D->gfx_chr = '#';
+ D->bare = 0;
+ //e->reveal=1; // the default should be the same for all formats.
+ return 0;
+}
+
+
+static int html_option(struct export *e, int opt, char *arg)
+{
+ switch (opt)
+ {
+ case 1: // gfx-chr=
+ D->gfx_chr = *arg ?: ' ';
+ break;
+ case 2: // bare (no headers)
+ D->bare=1;
+ break;
+ }
+ return 0;
+}
+
+#define HTML_BLACK "#000000"
+#define HTML_RED "#FF0000"
+#define HTML_GREEN "#00FF00"
+#define HTML_YELLOW "#FFFF00"
+#define HTML_BLUE "#0000FF"
+#define HTML_MAGENTA "#FF00FF"
+#define HTML_CYAN "#00FFFF"
+#define HTML_WHITE "#FFFFFF"
+
+#undef UNREADABLE_HTML //no '\n'
+#define STRIPPED_HTML //only necessary fields in header
+
+static int html_output(struct export *e, char *name, struct fmt_page *pg)
+{
+
+ const char* html_colours[]={ HTML_BLACK,
+ HTML_RED,
+ HTML_GREEN,
+ HTML_YELLOW,
+ HTML_BLUE,
+ HTML_MAGENTA,
+ HTML_CYAN,
+ HTML_WHITE};
+ FILE *fp;
+ int x, y;
+
+#ifdef UNREADABLE_HTML
+#define HTML_NL
+#else
+#define HTML_NL fputc('\n',fp);
+#endif
+
+ if (not(fp = fopen(name, "w")))
+ {
+ export_error("cannot create file");
+ return -1;
+ }
+
+if (!D->bare)
+ {
+#ifndef STRIPPED_HTML
+ fputs("<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">",fp);
+ HTML_NL
+#endif
+ fputs("<html><head>",fp);
+ HTML_NL
+#ifndef STRIPPED_HTML
+ fputs("<meta http-equiv=\"Content-Type\" content=\"text/html;",fp);
+ switch(latin1) {
+ case LATIN1: fprintf(fp,"charset=iso-8859-1\">"); break;
+ case LATIN2: fprintf(fp,"charset=iso-8859-2\">"); break;
+ case KOI8: fprintf(fp,"charset=koi8-r\">"); break;
+ case GREEK: fprintf(fp,"charset=iso-8859-7\">"); break;
+ }
+ HTML_NL
+ fputs("<meta name=\"GENERATOR\" content=\"alevt-cap\">",fp);
+ HTML_NL
+#else
+ switch(latin1) {
+ case LATIN1: fprintf(fp,"<meta charset=iso-8859-1\">"); break;
+ case LATIN2: fprintf(fp,"<meta charset=iso-8859-2\">"); break;
+ case KOI8: fprintf(fp,"<meta charset=koi8-r\">"); break;
+ case GREEK: fprintf(fp,"<meta charset=iso-8859-7\">"); break;
+ }
+ HTML_NL
+#endif
+ fputs("</head>",fp);
+ fputs("<body text=\"#FFFFFF\" bgcolor=\"#000000\">",fp);
+ HTML_NL
+ } //bare
+
+ fputs("<tt><b>",fp);
+ HTML_NL
+
+ // write tables in form of HTML format
+ for (y = 0; y < 25; ++y)
+ {
+ int last_nonblank=0;
+ int first_unprinted=0;
+ int last_space=1;
+ // previous char was &nbsp;
+ // is used for deciding to put semicolon or not
+ int nbsp=0;
+
+ // for output filled with ' ' up to 40 chars
+ // set last_nonblank=39
+ for (x = 0 ; x < 40; ++x)
+ {
+ if (pg->data[y][x].attr & EA_GRAPHIC)
+ {pg->data[y][x].ch= D->gfx_chr;}
+
+ if (pg->data[y][x].ch!=' ')
+ {
+ last_nonblank=x;
+ }
+ }
+
+ for (x = 0 ; x <= last_nonblank ; ++x)
+ {
+ if (pg->data[y][x].ch==' ')
+ {
+ // if single space between blinking/colour words
+ // then make the space blinking/colour too
+ if ((x)&&(x<39))
+ {
+ if ((pg->data[y][x-1].ch!=' ')
+ &&(pg->data[y][x+1].ch!=' ')
+ &&(pg->data[y][x-1].attr & EA_BLINK)
+ &&(pg->data[y][x+1].attr & EA_BLINK))
+ {pg->data[y][x].attr |= EA_BLINK;}
+ else
+ {pg->data[y][x].attr &= ~EA_BLINK;}
+
+ if ((pg->data[y][x-1].ch!=' ')
+ &&(pg->data[y][x+1].ch!=' ')
+ &&(pg->data[y][x-1].fg==pg->data[y][x+1].fg))
+ {pg->data[y][x].fg=pg->data[y][x-1].fg;}
+ else
+ pg->data[y][x].fg=7;
+ }
+ else
+ {
+ pg->data[y][x].attr &= ~EA_BLINK;
+ pg->data[y][x].fg=7;
+ }
+ }
+ else
+ {
+ // if foreground is black set the foreground to previous
+ // background colour to let it be visible
+ if (!pg->data[y][x].fg)
+ {pg->data[y][x].fg=pg->data[y][x].bg;}
+ }
+ //check if attributes changed,
+ //if yes then print chars and update first_unprinted
+ //if not then go to next char
+ if (x)
+ {